update after upgrading demo server

This commit is contained in:
John Woodlock
2012-08-20 15:28:38 +10:00
parent 4bbd878ca5
commit 592b5378dc
9 changed files with 0 additions and 0 deletions
@@ -0,0 +1,39 @@
DROP TABLE if exists `portfolio_deposit_account`;
CREATE TABLE `portfolio_deposit_account` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
`external_id` varchar(100) DEFAULT NULL,
`client_id` bigint(20) NOT NULL,
`product_id` bigint(20) NOT NULL,
`currency_code` varchar(3) NOT NULL,
`currency_digits` smallint(5) NOT NULL,
`deposit_amount` decimal(19,6) DEFAULT NULL,
`maturity_nominal_interest_rate` decimal(19,6) NOT NULL,
`tenure_months` int(11) NOT NULL,
`interest_compounding_frequency` smallint(5) NOT NULL DEFAULT '1',
`interest_compounding_frequency_enum` smallint(5) NOT NULL DEFAULT '2',
`projected_commencement_date` DATE NOT NULL,
`actual_commencement_date` DATE DEFAULT NULL,
`projected_maturity_date` DATE NOT NULL,
`actual_maturity_date` DATE 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,
`can_renew` tinyint(1) NOT NULL DEFAULT '0',
`renewed_account_id` bigint(20) DEFAULT NULL,
`can_pre_close` tinyint(1) NOT NULL DEFAULT '0',
`pre_closure_interest_rate` decimal(19,6) NOT 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 `FKKW0000000000001` (`client_id`),
KEY `FKKW0000000000002` (`product_id`),
KEY `FKKW0000000000003` (`renewed_account_id`),
CONSTRAINT `FKKW0000000000001` FOREIGN KEY (`client_id`) REFERENCES `portfolio_client` (`id`),
CONSTRAINT `FKKW0000000000002` FOREIGN KEY (`product_id`) REFERENCES `portfolio_product_deposit` (`id`),
CONSTRAINT `FKKW0000000000003` FOREIGN KEY (`renewed_account_id`) REFERENCES `portfolio_deposit_account` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -0,0 +1,10 @@
UPDATE `ref_currency`
SET
`display_symbol` = 'R'
WHERE id=161;
UPDATE `org_organisation_currency`
SET
`display_symbol` = 'R'
WHERE code like 'ZAR';
@@ -0,0 +1,74 @@
DROP TABLE if exists `portfolio_deposit_account`;
DROP TABLE if exists `portfolio_product_deposit`;
CREATE TABLE `portfolio_product_deposit` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
`external_id` varchar(100) DEFAULT NULL,
`description` varchar(500) DEFAULT NULL,
`currency_code` varchar(3) NOT NULL,
`currency_digits` smallint(5) NOT NULL,
`minimum_balance` decimal(19,6) DEFAULT NULL,
`maximum_balance` decimal(19,6) DEFAULT NULL,
`tenure_months` int(11) NOT NULL,
`interest_compounded_every` smallint(5) NOT NULL DEFAULT '1',
`interest_compounded_every_period_enum` smallint(5) NOT NULL DEFAULT '2',
`maturity_default_interest_rate` decimal(19,6) NOT NULL,
`maturity_min_interest_rate` decimal(19,6) NOT NULL,
`maturity_max_interest_rate` decimal(19,6) NOT NULL,
`is_renewal_allowed` tinyint(1) NOT NULL DEFAULT '0',
`is_preclosure_allowed` tinyint(1) NOT NULL DEFAULT '0',
`pre_closure_interest_rate` decimal(19,6) NOT 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 `name_deposit_product` (`name`),
UNIQUE KEY `externalid_deposit_product` (`external_id`),
KEY `FKJPW0000000000003` (`createdby_id`),
KEY `FKJPW0000000000004` (`lastmodifiedby_id`),
CONSTRAINT `FKJPX0000000000003` FOREIGN KEY (`createdby_id`) REFERENCES `admin_appuser` (`id`),
CONSTRAINT `FKJPX0000000000004` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `admin_appuser` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `portfolio_deposit_account` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
`external_id` varchar(100) DEFAULT NULL,
`client_id` bigint(20) NOT NULL,
`product_id` bigint(20) NOT NULL,
`currency_code` varchar(3) NOT NULL,
`currency_digits` smallint(5) NOT NULL,
`deposit_amount` decimal(19,6) DEFAULT NULL,
`maturity_nominal_interest_rate` decimal(19,6) NOT NULL,
`tenure_months` int(11) NOT NULL,
`interest_compounded_every` smallint(5) NOT NULL DEFAULT '1',
`interest_compounded_every_period_enum` smallint(5) NOT NULL DEFAULT '2',
`projected_commencement_date` DATE NOT NULL,
`actual_commencement_date` DATE DEFAULT NULL,
`projected_maturity_date` DATE NOT NULL,
`actual_maturity_date` DATE 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_renewal_allowed` tinyint(1) NOT NULL DEFAULT '0',
`renewed_account_id` bigint(20) DEFAULT NULL,
`is_preclosure_allowed` tinyint(1) NOT NULL DEFAULT '0',
`pre_closure_interest_rate` decimal(19,6) NOT 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 `FKKW0000000000001` (`client_id`),
KEY `FKKW0000000000002` (`product_id`),
KEY `FKKW0000000000003` (`renewed_account_id`),
CONSTRAINT `FKKW0000000000001` FOREIGN KEY (`client_id`) REFERENCES `portfolio_client` (`id`),
CONSTRAINT `FKKW0000000000002` FOREIGN KEY (`product_id`) REFERENCES `portfolio_product_deposit` (`id`),
CONSTRAINT `FKKW0000000000003` FOREIGN KEY (`renewed_account_id`) REFERENCES `portfolio_deposit_account` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -0,0 +1,13 @@
CREATE TABLE `o_charge` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) DEFAULT NULL,
`amount` decimal(19,6) NOT NULL,
`is_deleted` tinyint(1) NOT NULL DEFAULT 0,
`createdby_id` bigint(20) DEFAULT NULL,
`created_date` datetime DEFAULT NULL,
`lastmodifiedby_id` bigint(20) DEFAULT NULL,
`lastmodified_date` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -0,0 +1,28 @@
CREATE TABLE `r_code` (
`id` int NOT NULL AUTO_INCREMENT,
`code_name` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `code_name` (`code_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `r_code_value` (
`id` int NOT NULL AUTO_INCREMENT,
`code_id` int NOT NULL,
`code_value` varchar(100) DEFAULT NULL,
`order_position` int NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `code_value` (`code_id`, `code_value`),
KEY `FKCFCEA42640BE071Z` (`code_id`),
CONSTRAINT `FKCFCEA42640BE071Z` FOREIGN KEY (`code_id`) REFERENCES `r_code` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*not a major table - just intended for database reporting use for enums and values that would be hidden in java*/
CREATE TABLE `r_enum_value` (
`enum_name` varchar(100) NOT NULL,
`enum_id` int NOT NULL,
`enum_message_property` varchar(100) NOT NULL,
`enum_value` varchar(100) NOT NULL,
PRIMARY KEY (`enum_name`, `enum_id`),
UNIQUE KEY `enum_message_property` (`enum_name`, `enum_message_property`),
UNIQUE KEY `enum_value` (`enum_name`, `enum_value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -0,0 +1,6 @@
ALTER TABLE `portfolio_loan` DROP FOREIGN KEY `FK7C885878B1147D1`;
ALTER TABLE `portfolio_loan` DROP INDEX `FK7C885878B1147D1`;
drop table `ref_loan_status`;
@@ -0,0 +1,24 @@
ALTER TABLE admin_appuser RENAME TO m_appuser;
ALTER TABLE admin_appuser_role RENAME TO m_appuser_role;
ALTER TABLE admin_permission RENAME TO m_permission;
ALTER TABLE admin_role RENAME TO m_role;
ALTER TABLE admin_role_permission RENAME TO m_role_permission;
ALTER TABLE o_charge RENAME TO m_charge;
ALTER TABLE org_fund RENAME TO m_fund;
ALTER TABLE org_office RENAME TO m_office;
ALTER TABLE org_organisation_currency RENAME TO m_organisation_currency;
ALTER TABLE portfolio_client RENAME TO m_client;
ALTER TABLE portfolio_deposit_account RENAME TO m_deposit_account;
ALTER TABLE portfolio_group RENAME TO m_group;
ALTER TABLE portfolio_group_client RENAME TO m_group_client;
ALTER TABLE portfolio_loan RENAME TO m_loan;
ALTER TABLE portfolio_loan_repayment_schedule RENAME TO m_loan_repayment_schedule;
ALTER TABLE portfolio_loan_transaction RENAME TO m_loan_transaction;
ALTER TABLE portfolio_note RENAME TO m_note;
ALTER TABLE portfolio_office_transaction RENAME TO m_office_transaction;
ALTER TABLE portfolio_product_deposit RENAME TO m_product_deposit;
ALTER TABLE portfolio_product_loan RENAME TO m_product_loan;
ALTER TABLE portfolio_product_savings RENAME TO m_product_savings;
ALTER TABLE r_code RENAME TO m_code;
ALTER TABLE r_code_value RENAME TO m_code_value;
ALTER TABLE ref_currency RENAME TO m_currency;
@@ -0,0 +1,6 @@
ALTER TABLE `portfolio_client_extra_Additional Information` RENAME TO `m_client_xAdditional Information` ;
ALTER TABLE `portfolio_client_extra_Highly Improbable Info` RENAME TO `m_client_xHighly Improbable Info`;
ALTER TABLE `portfolio_loan_extra_Additional Information` RENAME TO `m_loan_xAdditional Information`;
@@ -0,0 +1,16 @@
ALTER TABLE `m_charge`
ADD COLUMN `currency_code` VARCHAR(3) NOT NULL AFTER `name` ,
ADD COLUMN `charge_applies_to_enum` SMALLINT(5) NOT NULL AFTER `currency_code` ,
ADD COLUMN `charge_time_enum` SMALLINT(5) NOT NULL AFTER `charge_applies_to_enum` ,
ADD COLUMN `charge_calculation_enum` SMALLINT(5) NOT NULL AFTER `charge_time_enum` ,
ADD COLUMN `is_active` TINYINT(1) NOT NULL AFTER `amount` ;
CREATE TABLE `m_product_loan_charge` (
`product_loan_id` bigint(20) NOT NULL,
`charge_id` bigint(20) NOT NULL,
PRIMARY KEY (`product_loan_id`, `charge_id`),
KEY `charge_id` (`charge_id`),
CONSTRAINT `m_product_loan_charge_ibfk_1` FOREIGN KEY (`charge_id`) REFERENCES `m_charge` (`id`),
CONSTRAINT `m_product_loan_charge_ibfk_2` FOREIGN KEY (`product_loan_id`) REFERENCES `m_product_loan` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;