update default backup and patches after demo server update

This commit is contained in:
John Woodlock
2012-09-02 22:19:41 +10:00
parent db7c961587
commit b97353975a
14 changed files with 153 additions and 167 deletions
File diff suppressed because one or more lines are too long
@@ -1,8 +0,0 @@
CREATE TABLE `portfolio_group_client` (
`group_id` bigint(20) NOT NULL,
`client_id` bigint(20) NOT NULL,
PRIMARY KEY (`group_id`,`client_id`),
FOREIGN KEY (`group_id`) REFERENCES `portfolio_group` (`id`),
FOREIGN KEY (`client_id`) REFERENCES `portfolio_client` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -1 +0,0 @@
ALTER TABLE portfolio_group ADD UNIQUE (name);
@@ -1,2 +0,0 @@
DROP INDEX external_id ON portfolio_group;
ALTER TABLE portfolio_group ADD UNIQUE (external_id);
@@ -1,37 +0,0 @@
ALTER TABLE `portfolio_product_savings`
DROP COLUMN `ft_pre_closure_interest_rate` ,
DROP COLUMN `ft_can_pre_close` ,
DROP COLUMN `ft_can_renew` ,
DROP COLUMN `ft_maturity_max_interest_rate` ,
DROP COLUMN `ft_maturity_min_interest_rate` ,
DROP COLUMN `ft_maturity_default_interest_rate` ,
DROP COLUMN `ft_tenure_months` ,
DROP COLUMN `savings_type_enum` ;
CREATE TABLE `portfolio_product_deposit` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT 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,
`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,
`can_renew` tinyint(1) NOT NULL DEFAULT '0',
`can_pre_close` tinyint(1) NOT NULL DEFAULT '0',
`pre_closure_interest_rate` decimal(19,6) NOT 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 `FKJPX0000000000003` FOREIGN KEY (`createdby_id`) REFERENCES `admin_appuser` (`id`),
CONSTRAINT `FKJPX0000000000004` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `admin_appuser` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -1,27 +0,0 @@
DROP TABLE if exists `portfolio_deposit_account`;
CREATE TABLE `portfolio_deposit_account` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`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_interest_rate` decimal(19,6) NOT NULL,
`tenure_months` int(11) NOT NULL,
`can_renew` tinyint(1) NOT NULL DEFAULT '0',
`can_pre_close` tinyint(1) NOT NULL DEFAULT '0',
`pre_closure_interest_rate` decimal(19,6) NOT 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`),
UNIQUE KEY `deposit_acc_external_id` (`external_id`),
KEY `FKKW0000000000001` (`client_id`),
KEY `FKKW0000000000002` (`product_id`),
CONSTRAINT `FKKW0000000000001` FOREIGN KEY (`client_id`) REFERENCES `portfolio_client` (`id`),
CONSTRAINT `FKKW0000000000002` FOREIGN KEY (`product_id`) REFERENCES `portfolio_product_deposit` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -1,4 +0,0 @@
ALTER TABLE `stretchy_report`
ADD COLUMN `description` TEXT NULL DEFAULT NULL AFTER `report_sql` ,
ADD COLUMN `core_report` TINYINT(1) NULL DEFAULT '0' AFTER `description` ,
ADD COLUMN `use_report` TINYINT(1) NULL DEFAULT '0' AFTER `core_report` ;
@@ -0,0 +1,23 @@
insert into m_permission (group_enum, code, default_description, default_name)
select 3, concat("CAN_RUN_", report_name), concat("CAN_RUN_", report_name), concat("CAN_RUN_", report_name)
from stretchy_report r
where not exists
(select 'f' from m_permission x
where x.code = concat("CAN_RUN_", r.report_name));
insert into m_permission (group_enum, code, default_description, default_name)
select 3, concat("CAN_READ_", t.`name`, "_x", d.`name`), concat("CAN_READ_", t.`name`, "_x", d.`name`), concat("CAN_READ_", t.`name`, "_x", d.`name`)
from stretchydata_dataset d
join stretchydata_datasettype t on t.id = d.datasettype_id
where not exists
(select 'f' from m_permission x
where x.code = concat("CAN_READ_", t.`name`, "_x", d.`name`));
insert into m_permission (group_enum, code, default_description, default_name)
select 3, concat("CAN_UPDATE_", t.`name`, "_x", d.`name`), concat("CAN_UPDATE_", t.`name`, "_x", d.`name`), concat("CAN_UPDATE_", t.`name`, "_x", d.`name`)
from stretchydata_dataset d
join stretchydata_datasettype t on t.id = d.datasettype_id
where not exists
(select 'f' from m_permission x
where x.code = concat("CAN_UPDATE_", t.`name`, "_x", d.`name`));