ALTER TABLE ACCOUNTING_TRANSACTION ADD COLUMN KEY_TRANSACTION_DETAIL int(11) NULL;
ALTER TABLE ACCOUNTING_TRANSACTION MODIFY COLUMN WHEN_REGISTERED datetime null;
ALTER TABLE ACCOUNTING_TRANSACTION MODIFY COLUMN WHEN_PROCESSED datetime null;
ALTER TABLE ACCOUNTING_TRANSACTION MODIFY COLUMN PAYMENT_MODE varchar(255) null;


INSERT INTO ACCOUNTING_TRANSACTION_DETAIL(WHEN_REGISTERED,WHEN_PROCESSED,PAYMENT_MODE,OJB_CONCRETE_CLASS,KEY_TRANSACTION) 
SELECT WHEN_REGISTERED,WHEN_PROCESSED,PAYMENT_MODE,'net.sourceforge.fenixedu.domain.accounting.AccountingTransactionDetail',ID_INTERNAL FROM ACCOUNTING_TRANSACTION;
