reomve patches files. add demo backup that is up to date with patches. update ddl schema for loan terms changes.

This commit is contained in:
Keith Woodlock
2012-08-07 15:56:58 +01:00
parent 525902cbb2
commit 762e7b14d9
9 changed files with 1126 additions and 72 deletions
@@ -329,6 +329,8 @@ CREATE TABLE `portfolio_loan` (
`annual_nominal_interest_rate` decimal(19,6) NOT NULL,
`interest_method_enum` smallint(5) NOT NULL,
`interest_calculated_in_period_enum` smallint(5) NOT NULL DEFAULT '1',
`term_frequency` smallint(5) NOT NULL,
`term_period_frequency_enum` smallint(5) NOT NULL,
`repay_every` smallint(5) NOT NULL,
`repayment_period_frequency_enum` smallint(5) NOT NULL,
`number_of_repayments` smallint(5) NOT NULL,
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,15 +0,0 @@
CREATE TABLE `portfolio_group` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) DEFAULT NULL,
`external_id` varchar(100) 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`),
KEY `FKJPWG000000000003` (`createdby_id`),
KEY `FKJPWG000000000004` (`lastmodifiedby_id`),
CONSTRAINT `FKJPWG000000000003` FOREIGN KEY (`createdby_id`) REFERENCES `admin_appuser` (`id`),
KEY `external_id` (`external_id`),
CONSTRAINT `FKJPWG000000000004` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `admin_appuser` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -1,4 +0,0 @@
ALTER TABLE `portfolio_product_savings`
ADD COLUMN `currency_code` VARCHAR(3) NULL AFTER `description` ,
ADD COLUMN `currency_digits` SMALLINT(5) NULL AFTER `currency_code` ,
ADD COLUMN `interest_rate` DECIMAL(19,6) NULL AFTER `currency_digits` ;
@@ -1,2 +0,0 @@
ALTER TABLE `portfolio_product_savings`
ADD COLUMN `is_deleted` tinyint(1) NOT NULL DEFAULT '0' AFTER `interest_rate`;
@@ -1 +0,0 @@
ALTER TABLE `portfolio_group` ADD COLUMN `is_deleted` tinyint(1) NOT NULL DEFAULT 0 AFTER `external_id`;
@@ -1,30 +0,0 @@
DROP TABLE IF EXISTS `portfolio_product_savings`;
CREATE TABLE `portfolio_product_savings` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`description` varchar(500) DEFAULT NULL,
`savings_type_enum` smallint(5) NOT NULL,
`currency_code` varchar(3) DEFAULT NULL,
`currency_digits` smallint(5) DEFAULT NULL,
`interest_rate` decimal(19,6) DEFAULT NULL,
`minimum_balance` decimal(19,6) DEFAULT NULL,
`maximum_balance` decimal(19,6) DEFAULT NULL,
`ft_tenure_months` int(11) DEFAULT NULL,
`ft_maturity_default_interest_rate` decimal(19,6) DEFAULT NULL,
`ft_maturity_min_interest_rate` decimal(19,6) DEFAULT NULL,
`ft_maturity_max_interest_rate` decimal(19,6) DEFAULT NULL,
`ft_can_renew` tinyint(1) DEFAULT NULL,
`ft_can_pre_close` tinyint(1) DEFAULT NULL,
`ft_pre_closure_interest_rate` decimal(19,6) DEFAULT NULL,
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
`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`),
KEY `FKJPW0000000000003` (`createdby_id`),
KEY `FKJPW0000000000004` (`lastmodifiedby_id`),
CONSTRAINT `FKJPW0000000000003` FOREIGN KEY (`createdby_id`) REFERENCES `admin_appuser` (`id`),
CONSTRAINT `FKJPW0000000000004` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `admin_appuser` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -1,9 +0,0 @@
ALTER TABLE `portfolio_loan` ADD COLUMN `term_frequency` smallint(5) NOT NULL DEFAULT 0 AFTER `interest_calculated_in_period_enum`;
ALTER TABLE `portfolio_loan` ADD COLUMN `term_period_frequency_enum` smallint(5) NOT NULL DEFAULT 2 AFTER `term_frequency`;
UPDATE `mifostenant-default`.`portfolio_loan`
SET
`term_frequency` = `repay_every` * `number_of_repayments`,
`term_period_frequency_enum` = `repayment_period_frequency_enum`
WHERE id > 0;