From 00c4d5399a001dd7f86d485e2a7a51d58f9fe781 Mon Sep 17 00:00:00 2001 From: Keith Woodlock Date: Tue, 21 Aug 2012 14:37:15 +0100 Subject: [PATCH] MIFOSX-43: add database patch. --- ...sit-account-status-and-transactions-table.sql | 16 ++++++++++++++++ .../platform/saving/domain/DepositAccount.java | 5 ++--- 2 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 mifosng-db/patches/patch-0002-deposit-account-status-and-transactions-table.sql diff --git a/mifosng-db/patches/patch-0002-deposit-account-status-and-transactions-table.sql b/mifosng-db/patches/patch-0002-deposit-account-status-and-transactions-table.sql new file mode 100644 index 000000000..f76977ed2 --- /dev/null +++ b/mifosng-db/patches/patch-0002-deposit-account-status-and-transactions-table.sql @@ -0,0 +1,16 @@ +ALTER TABLE `m_deposit_account` ADD COLUMN `status_enum` smallint(5) NOT NULL AFTER `is_deleted`; + +DROP TABLE IF EXISTS `m_deposit_account_transaction`; +CREATE TABLE `m_deposit_account_transaction` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `deposit_account_id` bigint(20) NOT NULL, + `transaction_type_enum` smallint(5) NOT NULL, + `contra_id` bigint(20) DEFAULT NULL, + `transaction_date` date NOT NULL, + `amount` decimal(19,6) NOT NULL, + PRIMARY KEY (`id`), + KEY `FKKW00000000000005` (`deposit_account_id`), + KEY `FKKW00000000000006` (`contra_id`), + CONSTRAINT `FKKW00000000000005` FOREIGN KEY (`deposit_account_id`) REFERENCES `m_deposit_account` (`id`), + CONSTRAINT `FKKW00000000000006` FOREIGN KEY (`contra_id`) REFERENCES `m_deposit_account_transaction` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; \ No newline at end of file diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/saving/domain/DepositAccount.java b/mifosng-provider/src/main/java/org/mifosng/platform/saving/domain/DepositAccount.java index b955c141e..0f4f6eaf0 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/saving/domain/DepositAccount.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/saving/domain/DepositAccount.java @@ -20,14 +20,13 @@ import org.mifosng.platform.api.commands.DepositAccountCommand; import org.mifosng.platform.client.domain.Client; import org.mifosng.platform.currency.domain.MonetaryCurrency; import org.mifosng.platform.currency.domain.Money; -import org.mifosng.platform.infrastructure.AbstractAuditableCustom; import org.mifosng.platform.loan.domain.PeriodFrequencyType; import org.mifosng.platform.savingproduct.domain.DepositProduct; -import org.mifosng.platform.user.domain.AppUser; +import org.springframework.data.jpa.domain.AbstractPersistable; @Entity @Table(name = "m_deposit_account", uniqueConstraints = @UniqueConstraint(name="deposit_acc_external_id", columnNames = { "external_id" })) -public class DepositAccount extends AbstractAuditableCustom { +public class DepositAccount extends AbstractPersistable { @SuppressWarnings("unused") @ManyToOne