48 lines
2.2 KiB
SQL
48 lines
2.2 KiB
SQL
DROP TABLE if exists `m_saving_account`;
|
|
CREATE TABLE `m_saving_account` (
|
|
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
|
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
|
|
`status_enum` smallint(5) NOT NULL DEFAULT '0',
|
|
`external_id` varchar(100) DEFAULT NULL,
|
|
`client_id` bigint(20) NOT NULL,
|
|
`product_id` bigint(20) NOT NULL,
|
|
`deposit_amount_per_period` decimal(19,6) NOT NULL,
|
|
`savings_product_type` smallint(5) DEFAULT NULL,
|
|
`currency_code` varchar(3) NOT NULL,
|
|
`currency_digits` smallint(5) NOT NULL,
|
|
`total_deposit_amount` decimal(19,6) NOT NULL,
|
|
`reccuring_nominal_interest_rate` decimal(19,6) NOT NULL,
|
|
`regular_saving_nominal_interest_rate` decimal(19,6) NOT NULL,
|
|
`tenure` int(11) NOT NULL,
|
|
`tenure_type` smallint(5) DEFAULT NULL,
|
|
`frequency` int(11) DEFAULT NULL,
|
|
`interest_type` smallint(5) DEFAULT NULL,
|
|
`interest_calculation_method` smallint(5) DEFAULT NULL,
|
|
`projected_commencement_date` date NOT NULL,
|
|
`actual_commencement_date` date DEFAULT NULL,
|
|
`matures_on_date` datetime DEFAULT NULL,
|
|
`projected_interest_accrued_on_maturity` decimal(19,6) NOT NULL,
|
|
`actual_interest_accrued` decimal(19,6) DEFAULT NULL,
|
|
`projected_total_maturity_amount` decimal(19,6) NOT NULL,
|
|
`actual_total_amount` decimal(19,6) DEFAULT NULL,
|
|
`is_preclosure_allowed` tinyint(1) NOT NULL DEFAULT '0',
|
|
`pre_closure_interest_rate` decimal(19,6) NOT NULL,
|
|
`is_lock_in_period_allowed` tinyint(1) NOT NULL DEFAULT '0',
|
|
`lock_in_period` bigint(20) DEFAULT NULL,
|
|
`lock_in_period_type` smallint(5) NOT NULL DEFAULT '1',
|
|
`withdrawnon_date` datetime DEFAULT NULL,
|
|
`rejectedon_date` datetime DEFAULT NULL,
|
|
`closedon_date` datetime DEFAULT NULL,
|
|
`createdby_id` bigint(20) DEFAULT NULL,
|
|
`created_date` datetime DEFAULT NULL,
|
|
`lastmodified_date` datetime DEFAULT NULL,
|
|
`lastmodifiedby_id` bigint(20) DEFAULT NULL,
|
|
PRIMARY KEY (`id`),
|
|
UNIQUE KEY `deposit_acc_external_id` (`external_id`),
|
|
KEY `FKSA0000000000001` (`client_id`),
|
|
KEY `FKSA0000000000002` (`product_id`),
|
|
CONSTRAINT `FKSA0000000000001` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`),
|
|
CONSTRAINT `FKSA0000000000002` FOREIGN KEY (`product_id`) REFERENCES `m_product_savings` (`id`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
|
|
|