MIFOSX-322: update apidocs, remove legacy sql files.

This commit is contained in:
Keith Woodlock
2013-05-03 17:39:42 +01:00
parent 23b079f4a6
commit 339b95e615
71 changed files with 4 additions and 1634 deletions
+4 -1
View File
@@ -2054,8 +2054,11 @@ GET https://DomainName/api/v1/clients/{clientId}
<p>Example Requests:</p>
<div class=apiClick>clients</div>
<br>
<br>
<div class=apiClick>clients?fields=displayName,officeName,joinedDate</div>
<br>
<div class=apiClick>clients?offset=10&limit=50</div>
<br>
<div class=apiClick>clients?orderBy=displayName,sortOrder=DESC</div>
</div>
<div class="method-example">
<code class="method-declaration">
@@ -1,9 +0,0 @@
INSERT INTO `m_permission`
(`grouping`,
`code`,
`entity_name`,
`action_name`,
`can_maker_checker`)
VALUES
('transaction_loan', 'UPDATELOANOFFICER_LOAN', 'LOAN', 'UPDATELOANOFFICER', 1),
('transaction_loan', 'UPDATELOANOFFICER_LOAN_CHECKER', 'LOAN', 'UPDATELOANOFFICER', 0);
@@ -1,9 +0,0 @@
ALTER TABLE m_portfolio_command_source
ADD INDEX `action_name` (`action_name` ASC)
, ADD INDEX `entity_name` (`entity_name` ASC, `resource_id` ASC)
, ADD INDEX `made_on_date` (`made_on_date` ASC)
, ADD INDEX `checked_on_date` (`checked_on_date` ASC)
, ADD INDEX `processing_result_enum` (`processing_result_enum` ASC)
, ADD INDEX `api_operation` (`api_operation` ASC)
, ADD INDEX `api_resource` (`api_resource` ASC, `resource_id` ASC) ;
@@ -1,5 +0,0 @@
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('loan_status_id', '601', 'Closed - Written Off', 'Closed - Written Off');
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('loan_status_id', '602', 'Closed - Reschedule Outstanding Amount', 'Closed - Reschedule Outstanding Amount');
@@ -1,12 +0,0 @@
ALTER TABLE `m_client`
ADD COLUMN `account_no` VARCHAR(20) NOT NULL AFTER `id`;
UPDATE `m_client`
SET
`account_no` = `id`
WHERE `id` > 0;
ALTER TABLE `m_client` ADD UNIQUE INDEX `account_no_UNIQUE` (`account_no` ASC);
@@ -1,32 +0,0 @@
DROP TABLE IF EXISTS `m_portfolio_command_source`;
CREATE TABLE `m_portfolio_command_source` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`action_name` varchar(50) NOT NULL,
`entity_name` varchar(50) NOT NULL,
`office_id` bigint(20) DEFAULT NULL,
`group_id` bigint(20) DEFAULT NULL,
`client_id` bigint(20) DEFAULT NULL,
`loan_id` bigint(20) DEFAULT NULL,
`api_get_url` varchar(100) NOT NULL,
`resource_id` bigint(20) DEFAULT NULL,
`command_as_json` text NOT NULL,
`maker_id` bigint(20) NOT NULL,
`made_on_date` datetime NOT NULL,
`checker_id` bigint(20) DEFAULT NULL,
`checked_on_date` datetime DEFAULT NULL,
`processing_result_enum` smallint(5) NOT NULL,
PRIMARY KEY (`id`),
KEY `FK_m_maker_m_appuser` (`maker_id`),
KEY `FK_m_checker_m_appuser` (`checker_id`),
KEY `action_name` (`action_name`),
KEY `entity_name` (`entity_name`,`resource_id`),
KEY `made_on_date` (`made_on_date`),
KEY `checked_on_date` (`checked_on_date`),
KEY `processing_result_enum` (`processing_result_enum`),
KEY `office_id` (`office_id`),
KEY `group_id` (`office_id`),
KEY `client_id` (`office_id`),
KEY `loan_id` (`office_id`),
CONSTRAINT `FK_m_checker_m_appuser` FOREIGN KEY (`checker_id`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `FK_m_maker_m_appuser` FOREIGN KEY (`maker_id`) REFERENCES `m_appuser` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -1,25 +0,0 @@
DROP TABLE IF EXISTS `c_configuration`;
CREATE TABLE `c_configuration` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(50) DEFAULT NULL,
`enabled` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `c_configuration`
(`name`, `enabled`)
VALUES
('maker-checker', 0);
INSERT INTO `m_permission`
(
`grouping`,
`code`,
`entity_name`,
`action_name`,
`can_maker_checker`)
VALUES
('configuration','UPDATE_CONFIGURATION',
'CONFIGURATION','UPDATE',1),
('configuration','READ_CONFIGURATION',
'CONFIGURATION','READ',1);
@@ -1,20 +0,0 @@
ALTER TABLE `m_product_loan`
ADD COLUMN `accounting_type` SMALLINT(5) NOT NULL AFTER `amortization_method_enum`;
update m_product_loan set accounting_type=1;
DROP TABLE if exists `acc_product_mapping`;
CREATE TABLE `acc_product_mapping` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`gl_account_id` BIGINT(20) NULL DEFAULT NULL,
`product_id` BIGINT(20) NULL DEFAULT NULL,
`product_type` SMALLINT(5) NULL DEFAULT NULL,
`financial_account_type` SMALLINT(5) NULL DEFAULT NULL,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -1,15 +0,0 @@
ALTER TABLE `m_client`
ADD COLUMN `middlename` VARCHAR(50) DEFAULT NULL AFTER `firstname`;
ALTER TABLE `m_client`
ADD COLUMN `fullname` VARCHAR(100) DEFAULT NULL AFTER `lastname`;
UPDATE `m_client`
SET
`fullname` = `lastname`
WHERE `firstname` is NULL;
UPDATE `m_client`
SET
`lastname` = null
WHERE `fullname` is not NULL;
@@ -1,13 +0,0 @@
ALTER TABLE `m_loan`
ADD COLUMN `account_no` VARCHAR(20) NOT NULL AFTER `id`;
UPDATE `m_loan`
SET
`account_no` = `id`
WHERE `id` > 0;
ALTER TABLE `m_loan` ADD UNIQUE INDEX `loan_account_no_UNIQUE` (`account_no` ASC);
ALTER TABLE `m_loan` DROP INDEX `org_id`;
ALTER TABLE `m_loan` ADD UNIQUE INDEX `loan_externalid_UNIQUE` (`external_id` ASC);
@@ -1,45 +0,0 @@
-- Make classification an enumeration for GL Account table
update acc_gl_account
set acc_gl_account.classification=1 where acc_gl_account.classification="ASSET";
update acc_gl_account
set acc_gl_account.classification=2 where acc_gl_account.classification="LIABILITY";
update acc_gl_account
set acc_gl_account.classification=3 where acc_gl_account.classification="EQUITY";
update acc_gl_account
set acc_gl_account.classification=4 where acc_gl_account.classification="INCOME";
update acc_gl_account
set acc_gl_account.classification=5 where acc_gl_account.classification="EXPENSE";
ALTER TABLE `acc_gl_account`
ALTER `classification` DROP DEFAULT;
ALTER TABLE `acc_gl_account`
CHANGE COLUMN `classification` `classification_enum` SMALLINT(5) NOT NULL AFTER `header_account`;
-- Rename is header account to usage in GL Account Table
update acc_gl_account
set acc_gl_account.header_account=2 where acc_gl_account.header_account=1;
update acc_gl_account
set acc_gl_account.header_account=1 where acc_gl_account.header_account=0;
ALTER TABLE `acc_gl_account`
CHANGE COLUMN `header_account` `account_usage` TINYINT(1) NOT NULL DEFAULT '2' AFTER `manual_journal_entries_allowed`;
-- Update Type in journal entries table
update acc_gl_journal_entry
set acc_gl_journal_entry.type=1 where acc_gl_journal_entry.type="CREDIT";
update acc_gl_journal_entry
set acc_gl_journal_entry.type=2 where acc_gl_journal_entry.type="DEBIT";
ALTER TABLE `acc_gl_journal_entry`
ALTER `type` DROP DEFAULT;
ALTER TABLE `acc_gl_journal_entry`
CHANGE COLUMN `type` `type_enum` SMALLINT(50) NOT NULL AFTER `entry_date`;
@@ -1,4 +0,0 @@
ALTER TABLE m_note
ADD COLUMN `saving_account_id` bigint(20) DEFAULT NULL AFTER `deposit_account_id`,
ADD KEY `FK_m_note_m_saving_account` (`saving_account_id`),
ADD CONSTRAINT `FK_m_note_m_saving_account` FOREIGN KEY (`saving_account_id`) REFERENCES `m_saving_account` (`id`);
@@ -1,21 +0,0 @@
DROP TABLE IF EXISTS `m_saving_account_transaction`;
CREATE TABLE `m_saving_account_transaction` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`saving_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,
`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 `FKSAT0000000001` (`saving_account_id`),
KEY `FKSAT0000000002` (`contra_id`),
CONSTRAINT `FKSAT0000000001` FOREIGN KEY (`saving_account_id`) REFERENCES `m_saving_account` (`id`),
CONSTRAINT `FKSAT0000000002` FOREIGN KEY (`contra_id`) REFERENCES `m_saving_account_transaction` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `m_saving_account`
ADD COLUMN `outstanding_amount` decimal(19,6) NOT NULL AFTER `pre_closure_interest_rate`;
@@ -1,3 +0,0 @@
Alter TABLE `m_saving_account`
add column `interest_posting_every` int(11) DEFAULT NULL AFTER `frequency`,
add column `interest_posting_frequency` int(11) DEFAULT NULL AFTER `interest_posting_every`;
@@ -1,4 +0,0 @@
ALTER TABLE `m_saving_account`
ADD COLUMN `interest_posted_amount` decimal(19,6) DEFAULT '0.000000' AFTER `outstanding_amount`,
ADD COLUMN `last_interest_posted_date` date DEFAULT NULL AFTER `interest_posted_amount`,
ADD COLUMN `next_interest_posting_date` date DEFAULT NULL AFTER `last_interest_posted_date`;
@@ -1,3 +0,0 @@
Alter TABLE `m_saving_schedule`
ADD COLUMN `interest_accured` decimal(21,4) DEFAULT '0.0000' AFTER `deposit_paid`
@@ -1,11 +0,0 @@
ALTER TABLE `m_role`
DROP COLUMN `lastmodifiedby_id` ,
DROP COLUMN `lastmodified_date` ,
DROP COLUMN `created_date` ,
DROP COLUMN `createdby_id`;
ALTER TABLE `m_appuser`
DROP COLUMN `lastmodifiedby_id` ,
DROP COLUMN `lastmodified_date` ,
DROP COLUMN `created_date` ,
DROP COLUMN `createdby_id`;
@@ -1,11 +0,0 @@
ALTER TABLE `m_office`
DROP COLUMN `lastmodifiedby_id` ,
DROP COLUMN `lastmodified_date` ,
DROP COLUMN `created_date`,
DROP COLUMN `createdby_id`;
ALTER TABLE `m_office_transaction`
DROP COLUMN `lastmodifiedby_id` ,
DROP COLUMN `lastmodified_date` ,
DROP COLUMN `created_date`,
DROP COLUMN `createdby_id`;
@@ -1,5 +0,0 @@
ALTER TABLE `m_organisation_currency`
DROP COLUMN `lastmodifiedby_id` ,
DROP COLUMN `lastmodified_date` ,
DROP COLUMN `created_date`,
DROP COLUMN `createdby_id`;
@@ -1,11 +0,0 @@
ALTER TABLE `mifostenant-creocore`.`m_fund`
DROP FOREIGN KEY `FK4E56DB408F889C3F`,
DROP FOREIGN KEY `FK4E56DB40541F0A56`;
ALTER TABLE `mifostenant-creocore`.`m_fund`
DROP COLUMN `lastmodified_date`,
DROP COLUMN `lastmodifiedby_id`,
DROP COLUMN `created_date`,
DROP COLUMN `createdby_id`,
DROP INDEX `FK4E56DB408F889C3F`,
DROP INDEX `FK4E56DB40541F0A56`;
@@ -1,5 +0,0 @@
ALTER TABLE `m_fund`
DROP COLUMN `lastmodifiedby_id` ,
DROP COLUMN `lastmodified_date` ,
DROP COLUMN `created_date`,
DROP COLUMN `createdby_id`;
@@ -1,17 +0,0 @@
ALTER TABLE `m_staff`
DROP COLUMN `lastmodifiedby_id` ,
DROP COLUMN `lastmodified_date` ,
DROP COLUMN `created_date`,
DROP COLUMN `createdby_id`;
ALTER TABLE `m_charge`
DROP COLUMN `lastmodifiedby_id` ,
DROP COLUMN `lastmodified_date` ,
DROP COLUMN `created_date`,
DROP COLUMN `createdby_id`;
ALTER TABLE `m_document`
DROP COLUMN `lastmodifiedby_id` ,
DROP COLUMN `lastmodified_date` ,
DROP COLUMN `created_date`,
DROP COLUMN `createdby_id`;
@@ -1,4 +0,0 @@
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('organisation', 'DELETE_OFFICETRANSACTION', 'OFFICETRANSACTION', 'DELETE', 1);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('organisation', 'DELETE_OFFICETRANSACTION_CHECKER',
'OFFICETRANSACTION', 'DELETE', 0);
@@ -1,57 +0,0 @@
-- Guarantor table is no longer an external Table
DELETE FROM `x_registered_table` WHERE `registered_table_name`='m_guarantor_external' LIMIT 1;
-- drop guarantor table
drop table m_guarantor_external;
-- New m_guarantor table
CREATE TABLE `m_guarantor` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`loan_id` BIGINT(20) NOT NULL,
`type_enum` SMALLINT(5) NOT NULL,
`entity_id` BIGINT(20) NULL DEFAULT NULL,
`firstname` VARCHAR(50) NULL DEFAULT NULL,
`lastname` VARCHAR(50) NULL DEFAULT NULL,
`dob` DATE NULL DEFAULT NULL,
`address_line_1` VARCHAR(500) NULL DEFAULT NULL,
`address_line_2` VARCHAR(500) NULL DEFAULT NULL,
`city` VARCHAR(50) NULL DEFAULT NULL,
`state` VARCHAR(50) NULL DEFAULT NULL,
`country` VARCHAR(50) NULL DEFAULT NULL,
`zip` VARCHAR(20) NULL DEFAULT NULL,
`house_phone_number` VARCHAR(20) NULL DEFAULT NULL,
`mobile_number` VARCHAR(20) NULL DEFAULT NULL,
`comment` VARCHAR(500) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
INDEX `FK_m_guarantor_m_loan` (`loan_id`),
CONSTRAINT `FK_m_guarantor_m_loan` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`)
)
ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Update loan table
ALTER TABLE `m_loan`
DROP FOREIGN KEY `FK_m_loan_guarantor`;
update m_loan
set guarantor_id=null;
ALTER TABLE `m_loan`
ADD CONSTRAINT `FK_m_loan_guarantor` FOREIGN KEY (`guarantor_id`) REFERENCES `m_guarantor` (`id`);
-- Insert new permissions
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'READ_GUARANTOR', 'GUARANTOR', 'READ', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'CREATE_GUARANTOR', 'GUARANTOR', 'CREATE', 1);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UPDATE_GUARANTOR', 'GUARANTOR', 'UPDATE', 1);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'DELETE_GUARANTOR', 'GUARANTOR', 'DELETE', 1);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'CREATE_GUARANTOR_CHECKER', 'GUARANTOR', 'CREATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UPDATE_GUARANTOR_CHECKER', 'GUARANTOR', 'UPDATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'DELETE_GUARANTOR_CHECKER', 'GUARANTOR', 'DELETE', 0);
@@ -1,23 +0,0 @@
ALTER TABLE `m_client`
DROP FOREIGN KEY `FKAUD0000000000002` ,
DROP FOREIGN KEY `FKAUD0000000000001`;
ALTER TABLE `m_client`
DROP COLUMN `lastmodifiedby_id` ,
DROP COLUMN `lastmodified_date` ,
DROP COLUMN `created_date` ,
DROP COLUMN `createdby_id` ,
DROP INDEX `FKAUD0000000000002` ,
DROP INDEX `FKAUD0000000000001`;
ALTER TABLE `m_group`
DROP FOREIGN KEY `FKJPWG000000000004` ,
DROP FOREIGN KEY `FKJPWG000000000003`;
ALTER TABLE `m_group`
DROP COLUMN `lastmodifiedby_id` ,
DROP COLUMN `lastmodified_date` ,
DROP COLUMN `created_date` ,
DROP COLUMN `createdby_id` ,
DROP INDEX `FKJPWG000000000004` ,
DROP INDEX `FKJPWG000000000003`;
@@ -1,11 +0,0 @@
ALTER TABLE `m_product_loan`
DROP FOREIGN KEY `FKAUD0000000000004` ,
DROP FOREIGN KEY `FKAUD0000000000003` ;
ALTER TABLE `m_product_loan`
DROP COLUMN `lastmodifiedby_id` ,
DROP COLUMN `lastmodified_date` ,
DROP COLUMN `created_date` ,
DROP COLUMN `createdby_id` ,
DROP INDEX `FKAUD0000000000004`,
DROP INDEX `FKAUD0000000000003`;
@@ -1,16 +0,0 @@
truncate table `r_enum_value`;
INSERT INTO `r_enum_value`
VALUES ('amortization_method_enum',0,'Equal installments','Equal installments'),('amortization_method_enum',1,'Equal principle payments','Equal principle payments'),
('interest_calculated_in_period_enum',0,'Daily','Daily'),('interest_calculated_in_period_enum',1,'Same as repayment period','Same as repayment period'),
('interest_method_enum',0,'Declining Balance','Declining Balance'),('interest_method_enum',1,'Flat','Flat'),
('interest_period_frequency_enum',2,'Per month','Per month'),('interest_period_frequency_enum',3,'Per year','Per year'),
('loan_status_id',100,'Submitted and awaiting approval','Submitted and awaiting approval'),('loan_status_id',200,'Approved','Approved'),
('loan_status_id',300,'Active','Active'),('loan_status_id',400,'Withdrawn by client','Withdrawn by client'),('loan_status_id',500,'Rejected','Rejected'),
('loan_status_id',600,'Closed','Closed'),('loan_status_id',700,'Overpaid','Overpaid'),
('loan_transaction_strategy_id',1,'mifos-standard-strategy','Mifos style'),('loan_transaction_strategy_id',2,'heavensfamily-strategy','Heavensfamily'),
('loan_transaction_strategy_id',3,'creocore-strategy','Creocore'),('loan_transaction_strategy_id',4,'rbi-india-strategy','RBI (India)'),
('processing_result_enum',0,'invalid','Invalid'),('processing_result_enum',1,'processed','Processed'),
('processing_result_enum',2,'awaiting.approval','Awaiting Approval'),('processing_result_enum',3,'rejected','Rejected'),
('repayment_period_frequency_enum',0,'Days','Days'),('repayment_period_frequency_enum',1,'Weeks','Weeks'),
('repayment_period_frequency_enum',2,'Months','Months'),('term_period_frequency_enum',0,'Days','Days'),
('term_period_frequency_enum',1,'Weeks','Weeks'),('term_period_frequency_enum',2,'Months','Months'),('term_period_frequency_enum',3,'Years','Years');
@@ -1,4 +0,0 @@
UPDATE m_role SET name = CONCAT(id,'-',name);
ALTER TABLE m_role
ADD CONSTRAINT unq_name UNIQUE (name);
@@ -1,6 +0,0 @@
UPDATE m_product_loan SET name = CONCAT(id,'-',name);
-- concating unique value to make sure column does not contain any duplicate value
ALTER TABLE m_product_loan
ADD CONSTRAINT unq_name UNIQUE (name);
@@ -1,2 +0,0 @@
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('transaction_loan', 'REMOVELOANOFFICER_LOAN', 'LOAN', 'REMOVELOANOFFICER', 1);
@@ -1,2 +0,0 @@
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('transaction_loan', 'REMOVELOANOFFICER_LOAN_CHECKER', 'LOAN', 'REMOVELOANOFFICER', 0);
@@ -1,8 +0,0 @@
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES('configuration', 'CREATE_CODEVALUE', 'CODEVALUE', 'CREATE', '0'),
('configuration', 'READ_CODEVALUE', 'CODEVALUE', 'READ', '0'),
('configuration', 'UPDATE_CODEVALUE', 'CODEVALUE', 'UPDATE', '0'),
('configuration', 'DELETE_CODEVALUE', 'CODEVALUE', 'DELETE', '0'),
('configuration', 'CREATE_CODEVALUE_CHECKER', 'CODEVALUE', 'CREATE', '0'),
('configuration', 'UPDATE_CODEVALUE_CHECKER', 'CODEVALUE', 'UPDATE', '0'),
('configuration', 'DELETE_CODEVALUE_CHECKER', 'CODEVALUE', 'DELETE', '0');
@@ -1,7 +0,0 @@
-- modified patch to update column (as nullable first), populate all tenants with indian timezone as default and then set timezone as not null for tenants
USE `mifosplatform-tenants`;
-- timezone are refferd with names rather than numerics
ALTER TABLE `mifosplatform-tenants`.`tenants` CHANGE COLUMN `timezone_id` `timezone_id` VARCHAR(100) NULL DEFAULT NULL;
-- setting Indian time zone
UPDATE `tenants` SET `timezone_id`='Asia/Kolkata' WHERE `id`>0;
ALTER TABLE `mifosplatform-tenants`.`tenants` CHANGE COLUMN `timezone_id` `timezone_id` VARCHAR(100) NOT NULL;
@@ -1,426 +0,0 @@
USE `mifosplatform-tenants`;
DROP TABLE IF EXISTS `timezones`;
CREATE TABLE IF NOT EXISTS `timezones` (
`id` int(3) NOT NULL AUTO_INCREMENT,
`country_code` varchar(2) NOT NULL,
`timezonename` varchar(100) NOT NULL,
`comments` varchar(150) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=416 DEFAULT CHARSET=utf8;
INSERT INTO `timezones` (`id`, `country_code`, `timezonename`, `comments`) VALUES
(1, 'AD', 'Europe/Andorra', NULL),
(2, 'AE', 'Asia/Dubai', ''),
(3, 'AF', 'Asia/Kabul', ''),
(4, 'AG', 'America/Antigua', ''),
(5, 'AI', 'America/Anguilla', ''),
(6, 'AL', 'Europe/Tirane', ''),
(7, 'AM', 'Asia/Yerevan', ''),
(8, 'AO', 'Africa/Luanda', ''),
(9, 'AQ', 'Antarctica/McMurdo', 'McMurdo Station, Ross Island'),
(10, 'AQ', 'Antarctica/South_Pole', 'Amundsen-Scott Station, South Pole'),
(11, 'AQ', 'Antarctica/Rothera', 'Rothera Station, Adelaide Island'),
(12, 'AQ', 'Antarctica/Palmer', 'Palmer Station, Anvers Island'),
(13, 'AQ', 'Antarctica/Mawson', 'Mawson Station, Holme Bay'),
(14, 'AQ', 'Antarctica/Davis', 'Davis Station, Vestfold Hills'),
(15, 'AQ', 'Antarctica/Casey', 'Casey Station, Bailey Peninsula'),
(16, 'AQ', 'Antarctica/Vostok', 'Vostok Station, Lake Vostok'),
(17, 'AQ', 'Antarctica/DumontDUrville', 'Dumont-dUrville Station, Terre Adelie'),
(18, 'AQ', 'Antarctica/Syowa', 'Syowa Station, E Ongul I'),
(19, 'AQ', 'Antarctica/Macquarie', 'Macquarie Island Station, Macquarie Island'),
(20, 'AR', 'America/Argentina/Buenos_Aires', 'Buenos Aires (BA, CF)'),
(21, 'AR', 'America/Argentina/Cordoba', 'most locations (CB, CC, CN, ER, FM, MN, SE, SF)'),
(22, 'AR', 'America/Argentina/Salta', '(SA, LP, NQ, RN)'),
(23, 'AR', 'America/Argentina/Jujuy', 'Jujuy (JY)'),
(24, 'AR', 'America/Argentina/Tucuman', 'Tucuman (TM)'),
(25, 'AR', 'America/Argentina/Catamarca', 'Catamarca (CT), Chubut (CH)'),
(26, 'AR', 'America/Argentina/La_Rioja', 'La Rioja (LR)'),
(27, 'AR', 'America/Argentina/San_Juan', 'San Juan (SJ)'),
(28, 'AR', 'America/Argentina/Mendoza', 'Mendoza (MZ)'),
(29, 'AR', 'America/Argentina/San_Luis', 'San Luis (SL)'),
(30, 'AR', 'America/Argentina/Rio_Gallegos', 'Santa Cruz (SC)'),
(31, 'AR', 'America/Argentina/Ushuaia', 'Tierra del Fuego (TF)'),
(32, 'AS', 'Pacific/Pago_Pago', ''),
(33, 'AT', 'Europe/Vienna', ''),
(34, 'AU', 'Australia/Lord_Howe', 'Lord Howe Island'),
(35, 'AU', 'Australia/Hobart', 'Tasmania - most locations'),
(36, 'AU', 'Australia/Currie', 'Tasmania - King Island'),
(37, 'AU', 'Australia/Melbourne', 'Victoria'),
(38, 'AU', 'Australia/Sydney', 'New South Wales - most locations'),
(39, 'AU', 'Australia/Broken_Hill', 'New South Wales - Yancowinna'),
(40, 'AU', 'Australia/Brisbane', 'Queensland - most locations'),
(41, 'AU', 'Australia/Lindeman', 'Queensland - Holiday Islands'),
(42, 'AU', 'Australia/Adelaide', 'South Australia'),
(43, 'AU', 'Australia/Darwin', 'Northern Territory'),
(44, 'AU', 'Australia/Perth', 'Western Australia - most locations'),
(45, 'AU', 'Australia/Eucla', 'Western Australia - Eucla area'),
(46, 'AW', 'America/Aruba', ''),
(47, 'AX', 'Europe/Mariehamn', ''),
(48, 'AZ', 'Asia/Baku', ''),
(49, 'BA', 'Europe/Sarajevo', ''),
(50, 'BB', 'America/Barbados', ''),
(51, 'BD', 'Asia/Dhaka', ''),
(52, 'BE', 'Europe/Brussels', ''),
(53, 'BF', 'Africa/Ouagadougou', ''),
(54, 'BG', 'Europe/Sofia', ''),
(55, 'BH', 'Asia/Bahrain', ''),
(56, 'BI', 'Africa/Bujumbura', ''),
(57, 'BJ', 'Africa/Porto-Novo', ''),
(58, 'BL', 'America/St_Barthelemy', ''),
(59, 'BM', 'Atlantic/Bermuda', ''),
(60, 'BN', 'Asia/Brunei', ''),
(61, 'BO', 'America/La_Paz', ''),
(62, 'BQ', 'America/Kralendijk', ''),
(63, 'BR', 'America/Noronha', 'Atlantic islands'),
(64, 'BR', 'America/Belem', 'Amapa, E Para'),
(65, 'BR', 'America/Fortaleza', 'NE Brazil (MA, PI, CE, RN, PB)'),
(66, 'BR', 'America/Recife', 'Pernambuco'),
(67, 'BR', 'America/Araguaina', 'Tocantins'),
(68, 'BR', 'America/Maceio', 'Alagoas, Sergipe'),
(69, 'BR', 'America/Bahia', 'Bahia'),
(70, 'BR', 'America/Sao_Paulo', 'S & SE Brazil (GO, DF, MG, ES, RJ, SP, PR, SC, RS)'),
(71, 'BR', 'America/Campo_Grande', 'Mato Grosso do Sul'),
(72, 'BR', 'America/Cuiaba', 'Mato Grosso'),
(73, 'BR', 'America/Santarem', 'W Para'),
(74, 'BR', 'America/Porto_Velho', 'Rondonia'),
(75, 'BR', 'America/Boa_Vista', 'Roraima'),
(76, 'BR', 'America/Manaus', 'E Amazonas'),
(77, 'BR', 'America/Eirunepe', 'W Amazonas'),
(78, 'BR', 'America/Rio_Branco', 'Acre'),
(79, 'BS', 'America/Nassau', ''),
(80, 'BT', 'Asia/Thimphu', ''),
(81, 'BW', 'Africa/Gaborone', ''),
(82, 'BY', 'Europe/Minsk', ''),
(83, 'BZ', 'America/Belize', ''),
(84, 'CA', 'America/St_Johns', 'Newfoundland Time, including SE Labrador'),
(85, 'CA', 'America/Halifax', 'Atlantic Time - Nova Scotia (most places), PEI'),
(86, 'CA', 'America/Glace_Bay', 'Atlantic Time - Nova Scotia - places that did not observe DST 1966-1971'),
(87, 'CA', 'America/Moncton', 'Atlantic Time - New Brunswick'),
(88, 'CA', 'America/Goose_Bay', 'Atlantic Time - Labrador - most locations'),
(89, 'CA', 'America/Blanc-Sablon', 'Atlantic Standard Time - Quebec - Lower North Shore'),
(90, 'CA', 'America/Montreal', 'Eastern Time - Quebec - most locations'),
(91, 'CA', 'America/Toronto', 'Eastern Time - Ontario - most locations'),
(92, 'CA', 'America/Nipigon', 'Eastern Time - Ontario & Quebec - places that did not observe DST 1967-1973'),
(93, 'CA', 'America/Thunder_Bay', 'Eastern Time - Thunder Bay, Ontario'),
(94, 'CA', 'America/Iqaluit', 'Eastern Time - east Nunavut - most locations'),
(95, 'CA', 'America/Pangnirtung', 'Eastern Time - Pangnirtung, Nunavut'),
(96, 'CA', 'America/Resolute', 'Central Standard Time - Resolute, Nunavut'),
(97, 'CA', 'America/Atikokan', 'Eastern Standard Time - Atikokan, Ontario and Southampton I, Nunavut'),
(98, 'CA', 'America/Rankin_Inlet', 'Central Time - central Nunavut'),
(99, 'CA', 'America/Winnipeg', 'Central Time - Manitoba & west Ontario'),
(100, 'CA', 'America/Rainy_River', 'Central Time - Rainy River & Fort Frances, Ontario'),
(101, 'CA', 'America/Regina', 'Central Standard Time - Saskatchewan - most locations'),
(102, 'CA', 'America/Swift_Current', 'Central Standard Time - Saskatchewan - midwest'),
(103, 'CA', 'America/Edmonton', 'Mountain Time - Alberta, east British Columbia & west Saskatchewan'),
(104, 'CA', 'America/Cambridge_Bay', 'Mountain Time - west Nunavut'),
(105, 'CA', 'America/Yellowknife', 'Mountain Time - central Northwest Territories'),
(106, 'CA', 'America/Inuvik', 'Mountain Time - west Northwest Territories'),
(107, 'CA', 'America/Creston', 'Mountain Standard Time - Creston, British Columbia'),
(108, 'CA', 'America/Dawson_Creek', 'Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia'),
(109, 'CA', 'America/Vancouver', 'Pacific Time - west British Columbia'),
(110, 'CA', 'America/Whitehorse', 'Pacific Time - south Yukon'),
(111, 'CA', 'America/Dawson', 'Pacific Time - north Yukon'),
(112, 'CC', 'Indian/Cocos', ''),
(113, 'CD', 'Africa/Kinshasa', 'west Dem. Rep. of Congo'),
(114, 'CD', 'Africa/Lubumbashi', 'east Dem. Rep. of Congo'),
(115, 'CF', 'Africa/Bangui', ''),
(116, 'CG', 'Africa/Brazzaville', ''),
(117, 'CH', 'Europe/Zurich', ''),
(118, 'CI', 'Africa/Abidjan', ''),
(119, 'CK', 'Pacific/Rarotonga', ''),
(120, 'CL', 'America/Santiago', 'most locations'),
(121, 'CL', 'Pacific/Easter', 'Easter Island & Sala y Gomez'),
(122, 'CM', 'Africa/Douala', ''),
(123, 'CN', 'Asia/Shanghai', 'east China - Beijing, Guangdong, Shanghai, etc.'),
(124, 'CN', 'Asia/Harbin', 'Heilongjiang (except Mohe), Jilin'),
(125, 'CN', 'Asia/Chongqing', 'central China - Sichuan, Yunnan, Guangxi, Shaanxi, Guizhou, etc.'),
(126, 'CN', 'Asia/Urumqi', 'most of Tibet & Xinjiang'),
(127, 'CN', 'Asia/Kashgar', 'west Tibet & Xinjiang'),
(128, 'CO', 'America/Bogota', ''),
(129, 'CR', 'America/Costa_Rica', ''),
(130, 'CU', 'America/Havana', ''),
(131, 'CV', 'Atlantic/Cape_Verde', ''),
(132, 'CW', 'America/Curacao', ''),
(133, 'CX', 'Indian/Christmas', ''),
(134, 'CY', 'Asia/Nicosia', ''),
(135, 'CZ', 'Europe/Prague', ''),
(136, 'DE', 'Europe/Berlin', ''),
(137, 'DJ', 'Africa/Djibouti', ''),
(138, 'DK', 'Europe/Copenhagen', ''),
(139, 'DM', 'America/Dominica', ''),
(140, 'DO', 'America/Santo_Domingo', ''),
(141, 'DZ', 'Africa/Algiers', ''),
(142, 'EC', 'America/Guayaquil', 'mainland'),
(143, 'EC', 'Pacific/Galapagos', 'Galapagos Islands'),
(144, 'EE', 'Europe/Tallinn', ''),
(145, 'EG', 'Africa/Cairo', ''),
(146, 'EH', 'Africa/El_Aaiun', ''),
(147, 'ER', 'Africa/Asmara', ''),
(148, 'ES', 'Europe/Madrid', 'mainland'),
(149, 'ES', 'Africa/Ceuta', 'Ceuta & Melilla'),
(150, 'ES', 'Atlantic/Canary', 'Canary Islands'),
(151, 'ET', 'Africa/Addis_Ababa', ''),
(152, 'FI', 'Europe/Helsinki', ''),
(153, 'FJ', 'Pacific/Fiji', ''),
(154, 'FK', 'Atlantic/Stanley', ''),
(155, 'FM', 'Pacific/Chuuk', 'Chuuk (Truk) and Yap'),
(156, 'FM', 'Pacific/Pohnpei', 'Pohnpei (Ponape)'),
(157, 'FM', 'Pacific/Kosrae', 'Kosrae'),
(158, 'FO', 'Atlantic/Faroe', ''),
(159, 'FR', 'Europe/Paris', ''),
(160, 'GA', 'Africa/Libreville', ''),
(161, 'GB', 'Europe/London', ''),
(162, 'GD', 'America/Grenada', ''),
(163, 'GE', 'Asia/Tbilisi', ''),
(164, 'GF', 'America/Cayenne', ''),
(165, 'GG', 'Europe/Guernsey', ''),
(166, 'GH', 'Africa/Accra', ''),
(167, 'GI', 'Europe/Gibraltar', ''),
(168, 'GL', 'America/Godthab', 'most locations'),
(169, 'GL', 'America/Danmarkshavn', 'east coast, north of Scoresbysund'),
(170, 'GL', 'America/Scoresbysund', 'Scoresbysund / Ittoqqortoormiit'),
(171, 'GL', 'America/Thule', 'Thule / Pituffik'),
(172, 'GM', 'Africa/Banjul', ''),
(173, 'GN', 'Africa/Conakry', ''),
(174, 'GP', 'America/Guadeloupe', ''),
(175, 'GQ', 'Africa/Malabo', ''),
(176, 'GR', 'Europe/Athens', ''),
(177, 'GS', 'Atlantic/South_Georgia', ''),
(178, 'GT', 'America/Guatemala', ''),
(179, 'GU', 'Pacific/Guam', ''),
(180, 'GW', 'Africa/Bissau', ''),
(181, 'GY', 'America/Guyana', ''),
(182, 'HK', 'Asia/Hong_Kong', ''),
(183, 'HN', 'America/Tegucigalpa', ''),
(184, 'HR', 'Europe/Zagreb', ''),
(185, 'HT', 'America/Port-au-Prince', ''),
(186, 'HU', 'Europe/Budapest', ''),
(187, 'ID', 'Asia/Jakarta', 'Java & Sumatra'),
(188, 'ID', 'Asia/Pontianak', 'west & central Borneo'),
(189, 'ID', 'Asia/Makassar', 'east & south Borneo, Sulawesi (Celebes), Bali, Nusa Tengarra, west Timor'),
(190, 'ID', 'Asia/Jayapura', 'west New Guinea (Irian Jaya) & Malukus (Moluccas)'),
(191, 'IE', 'Europe/Dublin', ''),
(192, 'IL', 'Asia/Jerusalem', ''),
(193, 'IM', 'Europe/Isle_of_Man', ''),
(194, 'IN', 'Asia/Kolkata', ''),
(195, 'IO', 'Indian/Chagos', ''),
(196, 'IQ', 'Asia/Baghdad', ''),
(197, 'IR', 'Asia/Tehran', ''),
(198, 'IS', 'Atlantic/Reykjavik', ''),
(199, 'IT', 'Europe/Rome', ''),
(200, 'JE', 'Europe/Jersey', ''),
(201, 'JM', 'America/Jamaica', ''),
(202, 'JO', 'Asia/Amman', ''),
(203, 'JP', 'Asia/Tokyo', ''),
(204, 'KE', 'Africa/Nairobi', ''),
(205, 'KG', 'Asia/Bishkek', ''),
(206, 'KH', 'Asia/Phnom_Penh', ''),
(207, 'KI', 'Pacific/Tarawa', 'Gilbert Islands'),
(208, 'KI', 'Pacific/Enderbury', 'Phoenix Islands'),
(209, 'KI', 'Pacific/Kiritimati', 'Line Islands'),
(210, 'KM', 'Indian/Comoro', ''),
(211, 'KN', 'America/St_Kitts', ''),
(212, 'KP', 'Asia/Pyongyang', ''),
(213, 'KR', 'Asia/Seoul', ''),
(214, 'KW', 'Asia/Kuwait', ''),
(215, 'KY', 'America/Cayman', ''),
(216, 'KZ', 'Asia/Almaty', 'most locations'),
(217, 'KZ', 'Asia/Qyzylorda', 'Qyzylorda (Kyzylorda, Kzyl-Orda)'),
(218, 'KZ', 'Asia/Aqtobe', 'Aqtobe (Aktobe)'),
(219, 'KZ', 'Asia/Aqtau', 'Atyrau (Atirau, Guryev), Mangghystau (Mankistau)'),
(220, 'KZ', 'Asia/Oral', 'West Kazakhstan'),
(221, 'LA', 'Asia/Vientiane', ''),
(222, 'LB', 'Asia/Beirut', ''),
(223, 'LC', 'America/St_Lucia', ''),
(224, 'LI', 'Europe/Vaduz', ''),
(225, 'LK', 'Asia/Colombo', ''),
(226, 'LR', 'Africa/Monrovia', ''),
(227, 'LS', 'Africa/Maseru', ''),
(228, 'LT', 'Europe/Vilnius', ''),
(229, 'LU', 'Europe/Luxembourg', ''),
(230, 'LV', 'Europe/Riga', ''),
(231, 'LY', 'Africa/Tripoli', ''),
(232, 'MA', 'Africa/Casablanca', ''),
(233, 'MC', 'Europe/Monaco', ''),
(234, 'MD', 'Europe/Chisinau', ''),
(235, 'ME', 'Europe/Podgorica', ''),
(236, 'MF', 'America/Marigot', ''),
(237, 'MG', 'Indian/Antananarivo', ''),
(238, 'MH', 'Pacific/Majuro', 'most locations'),
(239, 'MH', 'Pacific/Kwajalein', 'Kwajalein'),
(240, 'MK', 'Europe/Skopje', ''),
(241, 'ML', 'Africa/Bamako', ''),
(242, 'MM', 'Asia/Rangoon', ''),
(243, 'MN', 'Asia/Ulaanbaatar', 'most locations'),
(244, 'MN', 'Asia/Hovd', 'Bayan-Olgiy, Govi-Altai, Hovd, Uvs, Zavkhan'),
(245, 'MN', 'Asia/Choibalsan', 'Dornod, Sukhbaatar'),
(246, 'MO', 'Asia/Macau', ''),
(247, 'MP', 'Pacific/Saipan', ''),
(248, 'MQ', 'America/Martinique', ''),
(249, 'MR', 'Africa/Nouakchott', ''),
(250, 'MS', 'America/Montserrat', ''),
(251, 'MT', 'Europe/Malta', ''),
(252, 'MU', 'Indian/Mauritius', ''),
(253, 'MV', 'Indian/Maldives', ''),
(254, 'MW', 'Africa/Blantyre', ''),
(255, 'MX', 'America/Mexico_City', 'Central Time - most locations'),
(256, 'MX', 'America/Cancun', 'Central Time - Quintana Roo'),
(257, 'MX', 'America/Merida', 'Central Time - Campeche, Yucatan'),
(258, 'MX', 'America/Monterrey', 'Mexican Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas away from US border'),
(259, 'MX', 'America/Matamoros', 'US Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas near US border'),
(260, 'MX', 'America/Mazatlan', 'Mountain Time - S Baja, Nayarit, Sinaloa'),
(261, 'MX', 'America/Chihuahua', 'Mexican Mountain Time - Chihuahua away from US border'),
(262, 'MX', 'America/Ojinaga', 'US Mountain Time - Chihuahua near US border'),
(263, 'MX', 'America/Hermosillo', 'Mountain Standard Time - Sonora'),
(264, 'MX', 'America/Tijuana', 'US Pacific Time - Baja California near US border'),
(265, 'MX', 'America/Santa_Isabel', 'Mexican Pacific Time - Baja California away from US border'),
(266, 'MX', 'America/Bahia_Banderas', 'Mexican Central Time - Bahia de Banderas'),
(267, 'MY', 'Asia/Kuala_Lumpur', 'peninsular Malaysia'),
(268, 'MY', 'Asia/Kuching', 'Sabah & Sarawak'),
(269, 'MZ', 'Africa/Maputo', ''),
(270, 'NA', 'Africa/Windhoek', ''),
(271, 'NC', 'Pacific/Noumea', ''),
(272, 'NE', 'Africa/Niamey', ''),
(273, 'NF', 'Pacific/Norfolk', ''),
(274, 'NG', 'Africa/Lagos', ''),
(275, 'NI', 'America/Managua', ''),
(276, 'NL', 'Europe/Amsterdam', ''),
(277, 'NO', 'Europe/Oslo', ''),
(278, 'NP', 'Asia/Kathmandu', ''),
(279, 'NR', 'Pacific/Nauru', ''),
(280, 'NU', 'Pacific/Niue', ''),
(281, 'NZ', 'Pacific/Auckland', 'most locations'),
(282, 'NZ', 'Pacific/Chatham', 'Chatham Islands'),
(283, 'OM', 'Asia/Muscat', ''),
(284, 'PA', 'America/Panama', ''),
(285, 'PE', 'America/Lima', ''),
(286, 'PF', 'Pacific/Tahiti', 'Society Islands'),
(287, 'PF', 'Pacific/Marquesas', 'Marquesas Islands'),
(288, 'PF', 'Pacific/Gambier', 'Gambier Islands'),
(289, 'PG', 'Pacific/Port_Moresby', ''),
(290, 'PH', 'Asia/Manila', ''),
(291, 'PK', 'Asia/Karachi', ''),
(292, 'PL', 'Europe/Warsaw', ''),
(293, 'PM', 'America/Miquelon', ''),
(294, 'PN', 'Pacific/Pitcairn', ''),
(295, 'PR', 'America/Puerto_Rico', ''),
(296, 'PS', 'Asia/Gaza', 'Gaza Strip'),
(297, 'PS', 'Asia/Hebron', 'West Bank'),
(298, 'PT', 'Europe/Lisbon', 'mainland'),
(299, 'PT', 'Atlantic/Madeira', 'Madeira Islands'),
(300, 'PT', 'Atlantic/Azores', 'Azores'),
(301, 'PW', 'Pacific/Palau', ''),
(302, 'PY', 'America/Asuncion', ''),
(303, 'QA', 'Asia/Qatar', ''),
(304, 'RE', 'Indian/Reunion', ''),
(305, 'RO', 'Europe/Bucharest', ''),
(306, 'RS', 'Europe/Belgrade', ''),
(307, 'RU', 'Europe/Kaliningrad', 'Moscow-01 - Kaliningrad'),
(308, 'RU', 'Europe/Moscow', 'Moscow+00 - west Russia'),
(309, 'RU', 'Europe/Volgograd', 'Moscow+00 - Caspian Sea'),
(310, 'RU', 'Europe/Samara', 'Moscow+00 - Samara, Udmurtia'),
(311, 'RU', 'Asia/Yekaterinburg', 'Moscow+02 - Urals'),
(312, 'RU', 'Asia/Omsk', 'Moscow+03 - west Siberia'),
(313, 'RU', 'Asia/Novosibirsk', 'Moscow+03 - Novosibirsk'),
(314, 'RU', 'Asia/Novokuznetsk', 'Moscow+03 - Novokuznetsk'),
(315, 'RU', 'Asia/Krasnoyarsk', 'Moscow+04 - Yenisei River'),
(316, 'RU', 'Asia/Irkutsk', 'Moscow+05 - Lake Baikal'),
(317, 'RU', 'Asia/Yakutsk', 'Moscow+06 - Lena River'),
(318, 'RU', 'Asia/Vladivostok', 'Moscow+07 - Amur River'),
(319, 'RU', 'Asia/Sakhalin', 'Moscow+07 - Sakhalin Island'),
(320, 'RU', 'Asia/Magadan', 'Moscow+08 - Magadan'),
(321, 'RU', 'Asia/Kamchatka', 'Moscow+08 - Kamchatka'),
(322, 'RU', 'Asia/Anadyr', 'Moscow+08 - Bering Sea'),
(323, 'RW', 'Africa/Kigali', ''),
(324, 'SA', 'Asia/Riyadh', ''),
(325, 'SB', 'Pacific/Guadalcanal', ''),
(326, 'SC', 'Indian/Mahe', ''),
(327, 'SD', 'Africa/Khartoum', ''),
(328, 'SE', 'Europe/Stockholm', ''),
(329, 'SG', 'Asia/Singapore', ''),
(330, 'SH', 'Atlantic/St_Helena', ''),
(331, 'SI', 'Europe/Ljubljana', ''),
(332, 'SJ', 'Arctic/Longyearbyen', ''),
(333, 'SK', 'Europe/Bratislava', ''),
(334, 'SL', 'Africa/Freetown', ''),
(335, 'SM', 'Europe/San_Marino', ''),
(336, 'SN', 'Africa/Dakar', ''),
(337, 'SO', 'Africa/Mogadishu', ''),
(338, 'SR', 'America/Paramaribo', ''),
(339, 'SS', 'Africa/Juba', ''),
(340, 'ST', 'Africa/Sao_Tome', ''),
(341, 'SV', 'America/El_Salvador', ''),
(342, 'SX', 'America/Lower_Princes', ''),
(343, 'SY', 'Asia/Damascus', ''),
(344, 'SZ', 'Africa/Mbabane', ''),
(345, 'TC', 'America/Grand_Turk', ''),
(346, 'TD', 'Africa/Ndjamena', ''),
(347, 'TF', 'Indian/Kerguelen', ''),
(348, 'TG', 'Africa/Lome', ''),
(349, 'TH', 'Asia/Bangkok', ''),
(350, 'TJ', 'Asia/Dushanbe', ''),
(351, 'TK', 'Pacific/Fakaofo', ''),
(352, 'TL', 'Asia/Dili', ''),
(353, 'TM', 'Asia/Ashgabat', ''),
(354, 'TN', 'Africa/Tunis', ''),
(355, 'TO', 'Pacific/Tongatapu', ''),
(356, 'TR', 'Europe/Istanbul', ''),
(357, 'TT', 'America/Port_of_Spain', ''),
(358, 'TV', 'Pacific/Funafuti', ''),
(359, 'TW', 'Asia/Taipei', ''),
(360, 'TZ', 'Africa/Dar_es_Salaam', ''),
(361, 'UA', 'Europe/Kiev', 'most locations'),
(362, 'UA', 'Europe/Uzhgorod', 'Ruthenia'),
(363, 'UA', 'Europe/Zaporozhye', 'Zaporozhye, E Lugansk / Zaporizhia, E Luhansk'),
(364, 'UA', 'Europe/Simferopol', 'central Crimea'),
(365, 'UG', 'Africa/Kampala', ''),
(366, 'UM', 'Pacific/Johnston', 'Johnston Atoll'),
(367, 'UM', 'Pacific/Midway', 'Midway Islands'),
(368, 'UM', 'Pacific/Wake', 'Wake Island'),
(369, 'US', 'America/New_York', 'Eastern Time'),
(370, 'US', 'America/Detroit', 'Eastern Time - Michigan - most locations'),
(371, 'US', 'America/Kentucky/Louisville', 'Eastern Time - Kentucky - Louisville area'),
(372, 'US', 'America/Kentucky/Monticello', 'Eastern Time - Kentucky - Wayne County'),
(373, 'US', 'America/Indiana/Indianapolis', 'Eastern Time - Indiana - most locations'),
(374, 'US', 'America/Indiana/Vincennes', 'Eastern Time - Indiana - Daviess, Dubois, Knox & Martin Counties'),
(375, 'US', 'America/Indiana/Winamac', 'Eastern Time - Indiana - Pulaski County'),
(376, 'US', 'America/Indiana/Marengo', 'Eastern Time - Indiana - Crawford County'),
(377, 'US', 'America/Indiana/Petersburg', 'Eastern Time - Indiana - Pike County'),
(378, 'US', 'America/Indiana/Vevay', 'Eastern Time - Indiana - Switzerland County'),
(379, 'US', 'America/Chicago', 'Central Time'),
(380, 'US', 'America/Indiana/Tell_City', 'Central Time - Indiana - Perry County'),
(381, 'US', 'America/Indiana/Knox', 'Central Time - Indiana - Starke County'),
(382, 'US', 'America/Menominee', 'Central Time - Michigan - Dickinson, Gogebic, Iron & Menominee Counties'),
(383, 'US', 'America/North_Dakota/Center', 'Central Time - North Dakota - Oliver County'),
(384, 'US', 'America/North_Dakota/New_Salem', 'Central Time - North Dakota - Morton County (except Mandan area)'),
(385, 'US', 'America/North_Dakota/Beulah', 'Central Time - North Dakota - Mercer County'),
(386, 'US', 'America/Denver', 'Mountain Time'),
(387, 'US', 'America/Boise', 'Mountain Time - south Idaho & east Oregon'),
(388, 'US', 'America/Shiprock', 'Mountain Time - Navajo'),
(389, 'US', 'America/Phoenix', 'Mountain Standard Time - Arizona'),
(390, 'US', 'America/Los_Angeles', 'Pacific Time'),
(391, 'US', 'America/Anchorage', 'Alaska Time'),
(392, 'US', 'America/Juneau', 'Alaska Time - Alaska panhandle'),
(393, 'US', 'America/Sitka', 'Alaska Time - southeast Alaska panhandle'),
(394, 'US', 'America/Yakutat', 'Alaska Time - Alaska panhandle neck'),
(395, 'US', 'America/Nome', 'Alaska Time - west Alaska'),
(396, 'US', 'America/Adak', 'Aleutian Islands'),
(397, 'US', 'America/Metlakatla', 'Metlakatla Time - Annette Island'),
(398, 'US', 'Pacific/Honolulu', 'Hawaii'),
(399, 'UY', 'America/Montevideo', ''),
(400, 'UZ', 'Asia/Samarkand', 'west Uzbekistan'),
(401, 'UZ', 'Asia/Tashkent', 'east Uzbekistan'),
(402, 'VA', 'Europe/Vatican', ''),
(403, 'VC', 'America/St_Vincent', ''),
(404, 'VE', 'America/Caracas', ''),
(405, 'VG', 'America/Tortola', ''),
(406, 'VI', 'America/St_Thomas', ''),
(407, 'VN', 'Asia/Ho_Chi_Minh', ''),
(408, 'VU', 'Pacific/Efate', ''),
(409, 'WF', 'Pacific/Wallis', ''),
(410, 'WS', 'Pacific/Apia', ''),
(411, 'YE', 'Asia/Aden', ''),
(412, 'YT', 'Indian/Mayotte', ''),
(413, 'ZA', 'Africa/Johannesburg', ''),
(414, 'ZM', 'Africa/Lusaka', ''),
(415, 'ZW', 'Africa/Harare', '');
@@ -1,17 +0,0 @@
CREATE TABLE `extra_client_details_hugo_specific` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`client_id` bigint(20) NOT NULL,
`client_dob` date DEFAULT NULL,
`client_address` varchar(60) DEFAULT NULL,
`father_name` varchar(40) DEFAULT NULL,
`nominee` varchar(40) DEFAULT NULL,
`nominee_relationship` varchar(40) DEFAULT NULL,
`nominee_address` varchar(60) DEFAULT NULL,
`crime_no` varchar(40) DEFAULT NULL,
`police_station` varchar(40) DEFAULT NULL,
`other_notes` text,
PRIMARY KEY (`id`),
UNIQUE KEY `client_id` (`client_id`),
KEY `FK_extra_client_details_hugo_specific_1` (`client_id`),
CONSTRAINT `FK_extra_client_details_hugo_specific` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
@@ -1,18 +0,0 @@
DROP TABLE IF EXISTS `m_loan_collateral`;
CREATE TABLE `m_loan_collateral` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`loan_id` bigint(20) NOT NULL,
`type_cv_id` int(11) NOT NULL,
`description` varchar(500) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `FK_collateral_m_loan` (`loan_id`),
KEY `FK_collateral_code_value` (`type_cv_id`),
CONSTRAINT `FK_collateral_m_loan` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`),
CONSTRAINT `FK_collateral_code_value` FOREIGN KEY (`type_cv_id`) REFERENCES `m_code_value` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `m_loan`
ADD COLUMN `loanpurpose_cv_id` INT(11) DEFAULT NULL AFTER `guarantor_id`,
ADD KEY `FK_m_loanpurpose_codevalue` (`loanpurpose_cv_id`),
ADD CONSTRAINT `FK_m_loanpurpose_codevalue` FOREIGN KEY (`loanpurpose_cv_id`) REFERENCES `m_code_value` (`id`);
@@ -1,48 +0,0 @@
ALTER TABLE `m_loan`
DROP FOREIGN KEY `FK_m_loan_guarantor`;
ALTER TABLE `m_loan`
DROP COLUMN `guarantor_id`,
DROP INDEX `FK_m_loan_guarantor`;
ALTER TABLE `m_loan`
CHANGE COLUMN `submittedon_date` `submittedon_date` DATE NULL DEFAULT NULL,
CHANGE COLUMN `approvedon_date` `approvedon_date` DATE NULL DEFAULT NULL,
CHANGE COLUMN `closedon_date` `closedon_date` DATE NULL DEFAULT NULL,
CHANGE COLUMN `rejectedon_date` `rejectedon_date` DATE NULL DEFAULT NULL,
CHANGE COLUMN `rescheduledon_date` `rescheduledon_date` DATE NULL DEFAULT NULL,
CHANGE COLUMN `withdrawnon_date` `withdrawnon_date` DATE NULL DEFAULT NULL,
CHANGE COLUMN `writtenoffon_date` `writtenoffon_date` DATE NULL DEFAULT NULL;
ALTER TABLE `m_loan`
ADD COLUMN `submittedon_userid` BIGINT(20) DEFAULT NULL AFTER `submittedon_date`,
ADD KEY `FK_submittedon_userid` (`submittedon_userid`),
ADD CONSTRAINT `FK_submittedon_userid` FOREIGN KEY (`submittedon_userid`) REFERENCES `m_appuser` (`id`);
ALTER TABLE `m_loan`
ADD COLUMN `approvedon_userid` BIGINT(20) DEFAULT NULL AFTER `approvedon_date`,
ADD KEY `FK_approvedon_userid` (`approvedon_userid`),
ADD CONSTRAINT `FK_approvedon_userid` FOREIGN KEY (`approvedon_userid`) REFERENCES `m_appuser` (`id`);
ALTER TABLE `m_loan`
ADD COLUMN `rejectedon_userid` BIGINT(20) DEFAULT NULL AFTER `rejectedon_date`,
ADD KEY `FK_rejectedon_userid` (`rejectedon_userid`),
ADD CONSTRAINT `FK_rejectedon_userid` FOREIGN KEY (`rejectedon_userid`) REFERENCES `m_appuser` (`id`);
ALTER TABLE `m_loan`
ADD COLUMN `withdrawnon_userid` BIGINT(20) DEFAULT NULL AFTER `withdrawnon_date`,
ADD KEY `FK_withdrawnon_userid` (`withdrawnon_userid`),
ADD CONSTRAINT `FK_withdrawnon_userid` FOREIGN KEY (`withdrawnon_userid`) REFERENCES `m_appuser` (`id`);
ALTER TABLE `m_loan`
ADD COLUMN `disbursedon_userid` BIGINT(20) DEFAULT NULL AFTER `disbursedon_date`,
ADD KEY `FK_disbursedon_userid` (`disbursedon_userid`),
ADD CONSTRAINT `FK_disbursedon_userid` FOREIGN KEY (`disbursedon_userid`) REFERENCES `m_appuser` (`id`);
ALTER TABLE `m_loan`
ADD COLUMN `closedon_userid` BIGINT(20) DEFAULT NULL AFTER `closedon_date`,
ADD KEY `FK_closedon_userid` (`closedon_userid`),
ADD CONSTRAINT `FK_closedon_userid` FOREIGN KEY (`closedon_userid`) REFERENCES `m_appuser` (`id`);
@@ -1,23 +0,0 @@
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('accounting', 'CREATE_GLACCOUNT', 'GLACCOUNT', 'CREATE', 1);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('accounting', 'UPDATE_GLACCOUNT', 'GLACCOUNT', 'UPDATE', 1);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('accounting', 'DELETE_GLACCOUNT', 'GLACCOUNT', 'DELETE', 1);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('accounting', 'CREATE_GLCLOSURE', 'GLCLOSURE', 'CREATE', 1);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('accounting', 'UPDATE_GLCLOSURE', 'GLCLOSURE', 'UPDATE', 1);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('accounting', 'DELETE_GLCLOSURE', 'GLCLOSURE', 'DELETE', 1);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('accounting', 'CREATE_JOURNALENTRY', 'JOURNALENTRY', 'CREATE', 1);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('accounting', 'REVERSE_JOURNALENTRY', 'JOURNALENTRY', 'REVERSE', 1);
@@ -1,18 +0,0 @@
ALTER TABLE `m_loan_transaction`
ADD COLUMN `is_reversed` TINYINT(1) NOT NULL AFTER `penalty_charges_portion_derived`;
-- === update is_reversed column to true for all fields where contra_id is not null
UPDATE `m_loan_transaction` SET `is_reversed` = 1 WHERE contra_id is not null;
ALTER TABLE `m_loan_transaction` DROP FOREIGN KEY `FKCFCEA426FC69F3F1`;
ALTER TABLE `m_loan_transaction`
DROP COLUMN `contra_id` ,
DROP INDEX `FKCFCEA426FC69F3F1`;
ALTER TABLE `m_loan_transaction`
DROP COLUMN `lastmodifiedby_id`,
DROP COLUMN `lastmodified_date`,
DROP COLUMN `created_date`,
DROP COLUMN `createdby_id`;
@@ -1,14 +0,0 @@
INSERT INTO `m_permission` (grouping, code, entity_name, action_name, can_maker_checker) VALUES
('transaction_savings', 'APPROVE_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'APPROVE', 1 ),
('transaction_savings', 'REJECT_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'REJECT', 1 ),
('transaction_savings', 'WITHDRAW_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'WITHDRAW', 1 ),
('transaction_savings', 'APPROVALUNDO_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'APPROVALUNDO', 1 ),
('transaction_savings', 'WITHDRAWAL_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'WITHDRAWAL', 1 ),
('transaction_savings', 'DEPOSIT_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'DEPOSIT', 1 ),
('transaction_savings', 'APPROVE_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'APPROVE', 1 ),
('transaction_savings', 'REJECT_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'REJECT', 1 ),
('transaction_savings', 'WITHDRAW_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'WITHDRAW', 1 ),
('transaction_savings', 'APPROVALUNDO_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'APPROVALUNDO', 1 ),
('transaction_savings', 'WITHDRAWAL_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'WITHDRAWAL', 1 ),
('transaction_savings', 'DEPOSIT_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'DEPOSIT', 1 );
@@ -1,2 +0,0 @@
ALTER TABLE m_group ADD COLUMN `loan_officer_id` BIGINT(20) NULL DEFAULT NULL AFTER `office_id`;
ALTER TABLE `m_group` ADD CONSTRAINT `FK_m_group_m_staff` FOREIGN KEY (`loan_officer_id`) REFERENCES `m_staff` (`id`);
@@ -1,24 +0,0 @@
CREATE TABLE `m_group_level` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`parent_id` INT(11) NULL DEFAULT NULL,
`is_super_parent` TINYINT(1) NOT NULL,
`level_name` VARCHAR(100) NOT NULL,
`recursable` TINYINT(1) NOT NULL,
`can_have_clients` TINYINT(1) NOT NULL,
PRIMARY KEY (`id`),
INDEX `Parent_levelId_reference` (`parent_id`),
CONSTRAINT `Parent_levelId_reference` FOREIGN KEY (`parent_id`) REFERENCES `m_group_level` (`id`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `m_group_level` (`id`, `parent_id`, `is_super_parent`, `level_name`, `recursable`, `can_have_clients`) VALUES (1, NULL, 1, 'Center', 1, 0);
INSERT INTO `m_group_level` (`id`, `parent_id`, `is_super_parent`, `level_name`, `recursable`, `can_have_clients`) VALUES (2, 1, 0, 'Group', 0, 1);
ALTER TABLE m_group DROP FOREIGN KEY `FK_m_group_m_staff`;
ALTER TABLE m_group CHANGE `loan_officer_id` `staff_id` BIGINT(20) NULL DEFAULT NULL;
ALTER TABLE m_group ADD COLUMN `level_Id` INT(11) NOT NULL AFTER `office_id`;
ALTER TABLE m_group ADD COLUMN `parent_id` BIGINT(20) NULL DEFAULT NULL AFTER `level_Id`;
ALTER TABLE m_group ADD COLUMN `hierarchy` VARCHAR(100) NULL DEFAULT NULL AFTER `parent_id`;
ALTER TABLE m_group ADD CONSTRAINT `FK_m_group_m_staff` FOREIGN KEY (`staff_id`) REFERENCES `m_staff` (`id`);
ALTER TABLE m_group ADD CONSTRAINT `Parent_Id_reference` FOREIGN KEY (`parent_id`) REFERENCES `m_group` (`id`);
UPDATE m_group mg SET mg.level_Id = 1;
ALTER TABLE m_group ADD CONSTRAINT `FK_m_group_level` FOREIGN KEY (`level_Id`) REFERENCES `m_group_level` (`id`);
@@ -1 +0,0 @@
ALTER TABLE m_group_level CHANGE `is_super_parent` `super_parent` TINYINT(1) NOT NULL;
@@ -1,11 +0,0 @@
ALTER TABLE `acc_gl_journal_entry`
CHANGE COLUMN `portfolio_generated` `manual_entry` TINYINT(1) NOT NULL DEFAULT '0' AFTER `reversed`;
update acc_gl_journal_entry
set acc_gl_journal_entry.manual_entry=1
where acc_gl_journal_entry.entity_type is null;
update acc_gl_journal_entry
set acc_gl_journal_entry.manual_entry=0
where acc_gl_journal_entry.entity_type is not null;
@@ -1,11 +0,0 @@
update acc_gl_journal_entry
set acc_gl_journal_entry.entity_type=1
where acc_gl_journal_entry.entity_type='LOAN';
ALTER TABLE `acc_gl_journal_entry`
ALTER `type_enum` DROP DEFAULT;
ALTER TABLE `acc_gl_journal_entry`
CHANGE COLUMN `type_enum` `type_enum` SMALLINT(5) NOT NULL AFTER `entry_date`,
CHANGE COLUMN `entity_type` `entity_type_enum` SMALLINT(5) NULL DEFAULT NULL AFTER `description`;
@@ -1,9 +0,0 @@
ALTER TABLE `m_product_deposit`
DROP FOREIGN KEY FKJPX0000000000003,
DROP FOREIGN KEY FKJPX0000000000004,
DROP KEY FKJPW0000000000003,
DROP KEY FKJPW0000000000004,
DROP COLUMN createdby_id,
DROP COLUMN created_date,
DROP COLUMN lastmodified_date,
DROP COLUMN lastmodifiedby_id;
@@ -1,25 +0,0 @@
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '1', 'Disbursement', 'Disbursement');
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '2', 'Repayment', 'Repayment');
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '3', 'Contra', 'Contra');
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '4', 'Waive Interest', 'Waive Interest');
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '5', 'Repayment At Disbursement', 'Repayment At Disbursement');
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '6', 'Write-Off', 'Write-Off');
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '8', 'Recovery Repayment', 'Recovery Repayment');
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '9', 'Waive Charges', 'Waive Charges');
@@ -1,43 +0,0 @@
ALTER TABLE `m_loan`
DROP COLUMN `lastmodifiedby_id`,
DROP COLUMN `lastmodified_date`,
DROP COLUMN `created_date`,
DROP COLUMN `createdby_id`;
ALTER TABLE `m_loan`
CHANGE COLUMN `total_charges_due_at_disbursement_derived` `total_charges_due_at_disbursement_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `closedon_userid` ;
ALTER TABLE `m_loan`
ADD COLUMN `principal_disbursed_derived` DECIMAL(19,6) NOT NULL DEFAULT 0.0 AFTER `total_charges_due_at_disbursement_derived` ,
ADD COLUMN `principal_repaid_derived` DECIMAL(19,6) NOT NULL DEFAULT 0.0 AFTER `principal_disbursed_derived` ,
ADD COLUMN `principal_writtenoff_derived` DECIMAL(19,6) NOT NULL DEFAULT 0.0 AFTER `principal_repaid_derived` ,
ADD COLUMN `principal_outstanding_derived` DECIMAL(19,6) NOT NULL DEFAULT 0.0 AFTER `principal_writtenoff_derived`,
ADD COLUMN `principal_overdue_derived` DECIMAL(19,6) NOT NULL DEFAULT 0.0 AFTER `principal_outstanding_derived`,
ADD COLUMN `interest_charged_derived` DECIMAL(19,6) NOT NULL DEFAULT 0.0 AFTER `principal_overdue_derived` ,
ADD COLUMN `interest_repaid_derived` DECIMAL(19,6) NOT NULL DEFAULT 0.0 AFTER `interest_charged_derived` ,
ADD COLUMN `interest_waived_derived` DECIMAL(19,6) NOT NULL DEFAULT 0.0 AFTER `interest_repaid_derived` ,
ADD COLUMN `interest_writtenoff_derived` DECIMAL(19,6) NOT NULL DEFAULT 0.0 AFTER `interest_waived_derived` ,
ADD COLUMN `interest_outstanding_derived` DECIMAL(19,6) NOT NULL DEFAULT 0.0 AFTER `interest_writtenoff_derived`,
ADD COLUMN `interest_overdue_derived` DECIMAL(19,6) NOT NULL DEFAULT 0.0 AFTER `interest_outstanding_derived`,
ADD COLUMN `fee_charges_charged_derived` DECIMAL(19,6) NOT NULL DEFAULT 0.0 AFTER `interest_overdue_derived` ,
ADD COLUMN `fee_charges_repaid_derived` DECIMAL(19,6) NOT NULL DEFAULT 0.0 AFTER `fee_charges_charged_derived` ,
ADD COLUMN `fee_charges_waived_derived` DECIMAL(19,6) NOT NULL DEFAULT 0.0 AFTER `fee_charges_repaid_derived` ,
ADD COLUMN `fee_charges_writtenoff_derived` DECIMAL(19,6) NOT NULL DEFAULT 0.0 AFTER `fee_charges_waived_derived` ,
ADD COLUMN `fee_charges_outstanding_derived` DECIMAL(19,6) NOT NULL DEFAULT 0.0 AFTER `fee_charges_writtenoff_derived`,
ADD COLUMN `fee_charges_overdue_derived` DECIMAL(19,6) NOT NULL DEFAULT 0.0 AFTER `fee_charges_outstanding_derived`,
ADD COLUMN `penalty_charges_charged_derived` DECIMAL(19,6) NOT NULL DEFAULT 0.0 AFTER `fee_charges_overdue_derived` ,
ADD COLUMN `penalty_charges_repaid_derived` DECIMAL(19,6) NOT NULL DEFAULT 0.0 AFTER `penalty_charges_charged_derived` ,
ADD COLUMN `penalty_charges_waived_derived` DECIMAL(19,6) NOT NULL DEFAULT 0.0 AFTER `penalty_charges_repaid_derived` ,
ADD COLUMN `penalty_charges_writtenoff_derived` DECIMAL(19,6) NOT NULL DEFAULT 0.0 AFTER `penalty_charges_waived_derived`,
ADD COLUMN `penalty_charges_outstanding_derived` DECIMAL(19,6) NOT NULL DEFAULT 0.0 AFTER `penalty_charges_writtenoff_derived`,
ADD COLUMN `penalty_charges_overdue_derived` DECIMAL(19,6) NOT NULL DEFAULT 0.0 AFTER `penalty_charges_outstanding_derived`,
ADD COLUMN `total_expected_repayment_derived` DECIMAL(19,6) NOT NULL DEFAULT 0.0 AFTER `penalty_charges_overdue_derived`,
ADD COLUMN `total_repayment_derived` DECIMAL(19,6) NOT NULL DEFAULT 0.0 AFTER `total_expected_repayment_derived`,
ADD COLUMN `total_expected_costofloan_derived` DECIMAL(19,6) NOT NULL DEFAULT 0.0 AFTER `total_repayment_derived`,
ADD COLUMN `total_costofloan_derived` DECIMAL(19,6) NOT NULL DEFAULT 0.0 AFTER `total_expected_costofloan_derived`,
ADD COLUMN `total_waived_derived` DECIMAL(19,6) NOT NULL DEFAULT 0.0 AFTER `total_costofloan_derived`,
ADD COLUMN `total_writtenoff_derived` DECIMAL(19,6) NOT NULL DEFAULT 0.0 AFTER `total_waived_derived`,
ADD COLUMN `total_outstanding_derived` DECIMAL(19,6) NOT NULL DEFAULT 0.0 AFTER `total_writtenoff_derived`,
ADD COLUMN `total_overdue_derived` DECIMAL(19,6) NOT NULL DEFAULT 0.0 AFTER `total_outstanding_derived`,
ADD COLUMN `overdue_since_date_derived` DATE NULL AFTER `total_overdue_derived`;
@@ -1,22 +0,0 @@
DROP TABLE IF EXISTS `m_loan_arrears_aging`;
CREATE TABLE `m_loan_arrears_aging` (
`loan_id` bigint(20) NOT NULL AUTO_INCREMENT,
`principal_overdue_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`interest_overdue_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`fee_charges_overdue_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`penalty_charges_overdue_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`total_overdue_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`overdue_since_date_derived` date DEFAULT NULL,
PRIMARY KEY (`loan_id`),
CONSTRAINT `m_loan_arrears_aging_ibfk_1` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE m_loan
DROP COLUMN `total_overdue_derived` ,
DROP COLUMN `overdue_since_date_derived` ,
DROP COLUMN `penalty_charges_overdue_derived` ,
DROP COLUMN `fee_charges_overdue_derived` ,
DROP COLUMN `interest_overdue_derived` ,
DROP COLUMN `principal_overdue_derived` ;
@@ -1,80 +0,0 @@
update m_loan
join
(SELECT ml.id AS loanId,
SUM(mr.principal_amount) as principal_disbursed_derived,
SUM(IFNULL(mr.principal_completed_derived,0)) as principal_repaid_derived,
SUM(IFNULL(mr.principal_writtenoff_derived,0)) as principal_writtenoff_derived,
SUM(IFNULL(mr.interest_amount,0)) as interest_charged_derived,
SUM(IFNULL(mr.interest_completed_derived,0)) as interest_repaid_derived,
SUM(IFNULL(mr.interest_waived_derived,0)) as interest_waived_derived,
SUM(IFNULL(mr.interest_writtenoff_derived,0)) as interest_writtenoff_derived,
SUM(IFNULL(mr.fee_charges_amount,0)) as fee_charges_charged_derived,
SUM(IFNULL(mr.fee_charges_completed_derived,0)) as fee_charges_repaid_derived,
SUM(IFNULL(mr.fee_charges_waived_derived,0)) as fee_charges_waived_derived,
SUM(IFNULL(mr.fee_charges_writtenoff_derived,0)) as fee_charges_writtenoff_derived,
SUM(IFNULL(mr.penalty_charges_amount,0)) as penalty_charges_charged_derived,
SUM(IFNULL(mr.penalty_charges_completed_derived,0)) as penalty_charges_repaid_derived,
SUM(IFNULL(mr.penalty_charges_waived_derived,0)) as penalty_charges_waived_derived,
SUM(IFNULL(mr.penalty_charges_writtenoff_derived,0)) as penalty_charges_writtenoff_derived
FROM m_loan ml
INNER JOIN m_loan_repayment_schedule mr on mr.loan_id = ml.id
WHERE ml.disbursedon_date is not null
GROUP BY ml.id) x on x.loanId = m_loan.id
set m_loan.principal_disbursed_derived = x.principal_disbursed_derived,
m_loan.principal_repaid_derived = x.principal_repaid_derived,
m_loan.principal_writtenoff_derived = x.principal_writtenoff_derived,
m_loan.principal_outstanding_derived = (x.principal_disbursed_derived -
(x.principal_repaid_derived + x.principal_writtenoff_derived)),
m_loan.interest_charged_derived = x.interest_charged_derived,
m_loan.interest_repaid_derived = x.interest_repaid_derived,
m_loan.interest_waived_derived = x.interest_waived_derived,
m_loan.interest_writtenoff_derived = x.interest_writtenoff_derived,
m_loan.interest_outstanding_derived = (x.interest_charged_derived -
(x.interest_repaid_derived + x.interest_waived_derived + x.interest_writtenoff_derived)),
m_loan.fee_charges_charged_derived = x.fee_charges_charged_derived,
m_loan.fee_charges_repaid_derived = x.fee_charges_repaid_derived,
m_loan.fee_charges_waived_derived = x.fee_charges_waived_derived,
m_loan.fee_charges_writtenoff_derived = x.fee_charges_writtenoff_derived,
m_loan.fee_charges_outstanding_derived = (x.fee_charges_charged_derived -
(x.fee_charges_repaid_derived + x.fee_charges_waived_derived + x.fee_charges_writtenoff_derived)),
m_loan.penalty_charges_charged_derived = x.penalty_charges_charged_derived,
m_loan.penalty_charges_repaid_derived = x.penalty_charges_repaid_derived,
m_loan.penalty_charges_waived_derived = x.penalty_charges_waived_derived,
m_loan.penalty_charges_writtenoff_derived = x.penalty_charges_writtenoff_derived,
m_loan.fee_charges_outstanding_derived = (x.penalty_charges_charged_derived -
(x.penalty_charges_repaid_derived + x.penalty_charges_waived_derived + x.penalty_charges_writtenoff_derived)),
m_loan.total_expected_repayment_derived = (x.principal_disbursed_derived + x.interest_charged_derived +
x.fee_charges_charged_derived + x.penalty_charges_charged_derived),
m_loan.total_repayment_derived = (x.principal_repaid_derived + x.interest_repaid_derived +
x.fee_charges_repaid_derived + x.penalty_charges_repaid_derived),
m_loan.total_expected_costofloan_derived = (x.interest_charged_derived +
x.fee_charges_charged_derived + x.penalty_charges_charged_derived),
m_loan.total_costofloan_derived = (x.interest_repaid_derived +
x.fee_charges_repaid_derived + x.penalty_charges_repaid_derived),
m_loan.total_waived_derived = (x.interest_waived_derived +
x.fee_charges_waived_derived + x.penalty_charges_waived_derived),
m_loan.total_writtenoff_derived = (x.interest_writtenoff_derived +
x.fee_charges_writtenoff_derived + x.penalty_charges_writtenoff_derived),
m_loan.total_outstanding_derived =
(x.principal_disbursed_derived -
(x.principal_repaid_derived + x.principal_writtenoff_derived)) +
(x.interest_charged_derived -
(x.interest_repaid_derived + x.interest_waived_derived + x.interest_writtenoff_derived)) +
(x.fee_charges_charged_derived -
(x.fee_charges_repaid_derived + x.fee_charges_waived_derived + x.fee_charges_writtenoff_derived)) +
(x.penalty_charges_charged_derived -
(x.penalty_charges_repaid_derived + x.penalty_charges_waived_derived + x.penalty_charges_writtenoff_derived))
@@ -1,53 +0,0 @@
/*
This patch (or something like it) needs to run daily (after midnight and before next day opening)
against each tenant to keep the arrears values accurate
*/
truncate table m_loan_arrears_aging;
INSERT INTO m_loan_arrears_aging
(`loan_id`,
`principal_overdue_derived`,
`interest_overdue_derived`,
`fee_charges_overdue_derived`,
`penalty_charges_overdue_derived`,
`total_overdue_derived`,
`overdue_since_date_derived`)
select ml.id as loanId,
SUM(
(ifnull(mr.principal_amount,0) - ifnull(mr.principal_completed_derived, 0))
) as principal_overdue_derived,
SUM(
(ifnull(mr.interest_amount,0) - ifnull(mr.interest_completed_derived, 0))
) as interest_overdue_derived,
SUM(
(ifnull(mr.fee_charges_amount,0) - ifnull(mr.fee_charges_completed_derived, 0))
) as fee_charges_overdue_derived,
SUM(
(ifnull(mr.penalty_charges_amount,0) - ifnull(mr.penalty_charges_completed_derived, 0))
) as penalty_charges_overdue_derived,
SUM(
(ifnull(mr.principal_amount,0) - ifnull(mr.principal_completed_derived, 0))
) +
SUM(
(ifnull(mr.interest_amount,0) - ifnull(mr.interest_completed_derived, 0))
) +
SUM(
(ifnull(mr.fee_charges_amount,0) - ifnull(mr.fee_charges_completed_derived, 0))
) +
SUM(
(ifnull(mr.penalty_charges_amount,0) - ifnull(mr.penalty_charges_completed_derived, 0))
) as total_overdue_derived,
MIN(mr.duedate) as overdue_since_date_derived
FROM m_loan ml
INNER JOIN m_loan_repayment_schedule mr on mr.loan_id = ml.id
WHERE ml.loan_status_id = 300 /*active*/
and mr.completed_derived is false
and mr.duedate < CURDATE()
GROUP BY ml.id;
@@ -1,19 +0,0 @@
CREATE TABLE IF NOT EXISTS `m_calendar` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`entity_id` bigint(20) NOT NULL DEFAULT '0',
`entity_type_enum` smallint(5) NOT NULL DEFAULT '0',
`title` varchar(50) NOT NULL,
`description` varchar(100) DEFAULT NULL,
`location` varchar(50) DEFAULT NULL,
`start_date` date NOT NULL,
`end_date` date DEFAULT NULL,
`created_date` datetime DEFAULT NULL,
`duration` smallint(6) DEFAULT NULL,
`calendar_type_enum` smallint(5) NOT NULL,
`repeating` tinyint(1) NOT NULL DEFAULT '0',
`recurrence` varchar(100) NOT NULL,
`remind_by_enum` smallint(5) DEFAULT NULL,
`first_reminder` smallint(11) NOT NULL,
`second_reminder` smallint(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -1,8 +0,0 @@
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES('configuration', 'CREATE_CALENDAR', 'CALENDAR', 'CREATE', '0'),
('configuration', 'READ_CALENDAR', 'CALENDAR', 'READ', '0'),
('configuration', 'UPDATE_CALENDAR', 'CALENDAR', 'UPDATE', '0'),
('configuration', 'DELETE_CALENDAR', 'CALENDAR', 'DELETE', '0'),
('configuration', 'CREATE_CALENDAR_CHECKER', 'CALENDAR', 'CREATE', '0'),
('configuration', 'UPDATE_CALENDAR_CHECKER', 'CALENDAR', 'UPDATE', '0'),
('configuration', 'DELETE_CALENDAR_CHECKER', 'CALENDAR', 'DELETE', '0');
@@ -1,11 +0,0 @@
ALTER TABLE m_product_deposit
CHANGE `maturity_default_interest_rate` `default_interest_rate` decimal(19,6) NOT NULL,
CHANGE `maturity_min_interest_rate` `min_interest_rate` decimal(19,6) NOT NULL,
CHANGE `maturity_max_interest_rate` `max_interest_rate` decimal(19,6) NOT NULL,
CHANGE `minimum_balance` `min_deposit` decimal(19,6) NOT NULL,
CHANGE `maximum_balance` `max_deposit` decimal(19,6) NOT NULL,
ADD COLUMN `default_deposit` decimal(19,6) NOT NULL AFTER `min_deposit`;
ALTER TABLE `m_product_deposit`
CHANGE COLUMN `max_deposit` `max_deposit` DECIMAL(19,6) NOT NULL AFTER `min_deposit` ,
CHANGE COLUMN `default_interest_rate` `default_interest_rate` DECIMAL(19,6) NOT NULL AFTER `max_interest_rate`;
@@ -1,37 +0,0 @@
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES('portfolio', 'CREATE_LOANNOTE', 'LOANNOTE', 'CREATE', '0'),
('portfolio', 'READ_GROUPNOTE', 'GROUPNOTE', 'READ', '0'),
('portfolio', 'CREATE_GROUPNOTE', 'GROUPNOTE', 'CREATE', '1'),
('portfolio', 'UPDATE_GROUPNOTE', 'GROUPNOTE', 'UPDATE', '1'),
('portfolio', 'DELETE_GROUPNOTE', 'GROUPNOTE', 'DELETE', '1'),
('portfolio', 'CREATE_GROUPNOTE_CHECKER', 'GROUPNOTE', 'CREATE', '0'),
('portfolio', 'UPDATE_GROUPNOTE_CHECKER', 'GROUPNOTE', 'UPDATE', '0'),
('portfolio', 'DELETE_GROUPNOTE_CHECKER', 'GROUPNOTE', 'DELETE', '0'),
('portfolio', 'READ_LOANNOTE', 'LOANNOTE', 'READ', '0'),
('portfolio', 'CREATE_LOANNOTE', 'LOANNOTE', 'CREATE', '1'),
('portfolio', 'UPDATE_LOANNOTE', 'LOANNOTE', 'UPDATE', '1'),
('portfolio', 'DELETE_LOANNOTE', 'LOANNOTE', 'DELETE', '1'),
('portfolio', 'CREATE_LOANNOTE_CHECKER', 'LOANNOTE', 'CREATE', '0'),
('portfolio', 'UPDATE_LOANNOTE_CHECKER', 'LOANNOTE', 'UPDATE', '0'),
('portfolio', 'DELETE_LOANNOTE_CHECKER', 'LOANNOTE', 'DELETE', '0'),
('portfolio', 'READ_LOANTRANSACTIONNOTE', 'LOANTRANSACTIONNOTE', 'READ', '0'),
('portfolio', 'CREATE_LOANTRANSACTIONNOTE', 'LOANTRANSACTIONNOTE', 'CREATE', '1'),
('portfolio', 'UPDATE_LOANTRANSACTIONNOTE', 'LOANTRANSACTIONNOTE', 'UPDATE', '1'),
('portfolio', 'DELETE_LOANTRANSACTIONNOTE', 'LOANTRANSACTIONNOTE', 'DELETE', '1'),
('portfolio', 'CREATE_LOANTRANSACTIONNOTE_CHECKER', 'LOANTRANSACTIONNOTE', 'CREATE', '0'),
('portfolio', 'UPDATE_LOANTRANSACTIONNOTE_CHECKER', 'LOANTRANSACTIONNOTE', 'UPDATE', '0'),
('portfolio', 'DELETE_LOANTRANSACTIONNOTE_CHECKER', 'LOANTRANSACTIONNOTE', 'DELETE', '0'),
('portfolio', 'READ_DEPOSITNOTE', 'DEPOSITNOTE', 'READ', '0'),
('portfolio', 'CREATE_DEPOSITNOTE', 'DEPOSITNOTE', 'CREATE', '1'),
('portfolio', 'UPDATE_DEPOSITNOTE', 'DEPOSITNOTE', 'UPDATE', '1'),
('portfolio', 'DELETE_DEPOSITNOTE', 'DEPOSITNOTE', 'DELETE', '1'),
('portfolio', 'CREATE_DEPOSITNOTE_CHECKER', 'DEPOSITNOTE', 'CREATE', '0'),
('portfolio', 'UPDATE_DEPOSITNOTE_CHECKER', 'DEPOSITNOTE', 'UPDATE', '0'),
('portfolio', 'DELETE_DEPOSITNOTE_CHECKER', 'DEPOSITNOTE', 'DELETE', '0'),
('portfolio', 'READ_SAVINGNOTE', 'SAVINGNOTE', 'READ', '0'),
('portfolio', 'CREATE_SAVINGNOTE', 'SAVINGNOTE', 'CREATE', '1'),
('portfolio', 'UPDATE_SAVINGNOTE', 'SAVINGNOTE', 'UPDATE', '1'),
('portfolio', 'DELETE_SAVINGNOTE', 'SAVINGNOTE', 'DELETE', '1'),
('portfolio', 'CREATE_SAVINGNOTE_CHECKER', 'SAVINGNOTE', 'CREATE', '0'),
('portfolio', 'UPDATE_SAVINGNOTE_CHECKER', 'SAVINGNOTE', 'UPDATE', '0'),
('portfolio', 'DELETE_SAVINGNOTE_CHECKER', 'SAVINGNOTE', 'DELETE', '0');
@@ -1,8 +0,0 @@
ALTER TABLE `m_note`
ADD COLUMN `group_id` BIGINT(20) NULL AFTER `client_id`,
ADD CONSTRAINT `FK_m_note_m_group` FOREIGN KEY (`group_id`) REFERENCES `m_group` (`id`);
ALTER TABLE `m_note`
ALTER `client_id` DROP DEFAULT;
ALTER TABLE `m_note`
CHANGE COLUMN `client_id` `client_id` BIGINT(20) NULL AFTER `id`;
@@ -1,2 +0,0 @@
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UNASSIGNSTAFF_GROUP', 'GROUP', 'UNASSIGNSTAFF', 1);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UNASSIGNSTAFF_GROUP_CHECKER', 'GROUP', 'UNASSIGNSTAFF', 1);
@@ -1,10 +0,0 @@
ALTER TABLE stretchy_parameter
ADD COLUMN `parent_parameter_id` INT(11) NULL AFTER `parameter_sql` ,
ADD CONSTRAINT `fk_stretchy_parameter_0001`
FOREIGN KEY (`parent_parameter_id` )
REFERENCES stretchy_parameter (`parameter_id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION
, ADD INDEX `fk_stretchy_parameter_0001_idx` (`parent_parameter_id` ASC) ;
@@ -1,2 +0,0 @@
ALTER TABLE `m_loan_charge`
ADD COLUMN `waived` TINYINT(1) NOT NULL DEFAULT '0' AFTER `is_paid_derived`;
@@ -1,5 +0,0 @@
ALTER TABLE m_group MODIFY name VARCHAR(100) NOT NULL;
ALTER TABLE m_group DROP INDEX name;
ALTER TABLE m_group DROP INDEX external_id;
ALTER TABLE m_group ADD UNIQUE INDEX name (name, level_Id);
ALTER TABLE m_group ADD UNIQUE INDEX external_id (external_id, level_Id);
@@ -1,32 +0,0 @@
DROP TABLE IF EXISTS `m_calendar`;
CREATE TABLE IF NOT EXISTS `m_calendar` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`title` varchar(50) NOT NULL,
`description` varchar(100) DEFAULT NULL,
`location` varchar(50) DEFAULT NULL,
`start_date` date NOT NULL,
`end_date` date DEFAULT NULL,
`duration` smallint(6) DEFAULT NULL,
`calendar_type_enum` smallint(5) NOT NULL,
`repeating` tinyint(1) NOT NULL DEFAULT '0',
`recurrence` varchar(100) DEFAULT NULL,
`remind_by_enum` smallint(5) DEFAULT NULL,
`first_reminder` smallint(11) DEFAULT NULL,
`second_reminder` smallint(11) DEFAULT NULL,
`createdby_id` bigint(20) DEFAULT NULL,
`lastmodifiedby_id` bigint(20) DEFAULT NULL,
`created_date` datetime DEFAULT NULL,
`lastmodified_date` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `m_calendar_instance`;
CREATE TABLE IF NOT EXISTS `m_calendar_instance` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`calendar_id` bigint(20) NOT NULL,
`entity_id` bigint(20) NOT NULL,
`entity_type_enum` smallint(5) NOT NULL,
PRIMARY KEY (`id`),
KEY `FK_m_calendar_m_calendar_instance` (`calendar_id`),
CONSTRAINT `FK_m_calendar_m_calendar_instance` FOREIGN KEY (`calendar_id`) REFERENCES `m_calendar` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
@@ -1,66 +0,0 @@
ALTER TABLE `m_note`
DROP FOREIGN KEY `FK_m_note_m_saving_account`,
DROP FOREIGN KEY `FK_m_note_m_deposit_account`;
ALTER TABLE `m_note`
DROP COLUMN `saving_account_id`,
DROP COLUMN `deposit_account_id`,
DROP INDEX `FK_m_note_m_saving_account`,
DROP INDEX `FK_m_note_m_deposit_account`;
drop table `m_saving_account_transaction`;
drop table `m_saving_schedule`;
drop table `m_saving_account`;
drop table `m_deposit_account_transaction`;
drop table `m_deposit_account`;
drop table `m_product_savings`;
drop table `m_product_deposit`;
DROP TABLE IF EXISTS `m_savings_account`;
DROP TABLE IF EXISTS `m_savings_product`;
CREATE TABLE `m_savings_product` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`description` varchar(500) NOT NULL,
`currency_code` varchar(3) NOT NULL,
`currency_digits` smallint(5) NOT NULL,
`nominal_interest_rate_per_period` decimal(19,6) NOT NULL,
`nominal_interest_rate_period_frequency_enum` smallint(5) NOT NULL,
`min_required_opening_balance` decimal(19,6) DEFAULT NULL,
`lockin_period_frequency` decimal(19,6) DEFAULT NULL,
`lockin_period_frequency_enum` smallint(5) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `sp_unq_name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `m_savings_account` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`account_no` varchar(20) NOT NULL,
`external_id` varchar(100) DEFAULT NULL,
`client_id` bigint(20) DEFAULT NULL,
`group_id` bigint(20) DEFAULT NULL,
`product_id` bigint(20) DEFAULT NULL,
`currency_code` varchar(3) NOT NULL,
`currency_digits` smallint(5) NOT NULL,
`nominal_interest_rate_per_period` decimal(19,6) NOT NULL,
`nominal_interest_rate_period_frequency_enum` smallint(5) NOT NULL,
`annual_nominal_interest_rate` decimal(19,6) NOT NULL,
`min_required_opening_balance` decimal(19,6) DEFAULT NULL,
`lockin_period_frequency` decimal(19,6) DEFAULT NULL,
`lockin_period_frequency_enum` smallint(5) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `sa_account_no_UNIQUE` (`account_no`),
UNIQUE KEY `sa_externalid_UNIQUE` (`external_id`),
KEY `FKSA00000000000001` (`client_id`),
KEY `FKSA00000000000002` (`group_id`),
KEY `FKSA00000000000003` (`product_id`),
CONSTRAINT `FKSA00000000000001` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`),
CONSTRAINT `FKSA00000000000002` FOREIGN KEY (`group_id`) REFERENCES `m_group` (`id`),
CONSTRAINT `FKSA00000000000003` FOREIGN KEY (`product_id`) REFERENCES `m_savings_product` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -1,5 +0,0 @@
/* authorised user has to instead decide which to turn on for maker-checker */
update m_permission set can_maker_checker = false;
@@ -1,7 +0,0 @@
/*
Datatables defined as one to many need a subresource_id for maker-checker approval
*/
ALTER TABLE m_portfolio_command_source
ADD COLUMN `subresource_id` BIGINT(20) NULL AFTER `resource_id` ;
@@ -1,51 +0,0 @@
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES
('transaction_savings', 'DEPOSIT_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'DEPOSIT', '1'),
('transaction_savings', 'DEPOSIT_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'DEPOSIT', '0'),
('transaction_savings', 'WITHDRAWAL_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'WITHDRAWAL', '1'),
('transaction_savings', 'WITHDRAWAL_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'WITHDRAWAL', '0');
DROP TABLE IF EXISTS `m_savings_account_transaction`;
DROP TABLE IF EXISTS `m_savings_account`;
CREATE TABLE `m_savings_account` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`account_no` varchar(20) NOT NULL,
`external_id` varchar(100) DEFAULT NULL,
`client_id` bigint(20) DEFAULT NULL,
`group_id` bigint(20) DEFAULT NULL,
`product_id` bigint(20) DEFAULT NULL,
`currency_code` varchar(3) NOT NULL,
`currency_digits` smallint(5) NOT NULL,
`nominal_interest_rate_per_period` decimal(19,6) NOT NULL,
`nominal_interest_rate_period_frequency_enum` smallint(5) NOT NULL,
`annual_nominal_interest_rate` decimal(19,6) NOT NULL,
`min_required_opening_balance` decimal(19,6) DEFAULT NULL,
`lockin_period_frequency` decimal(19,6) DEFAULT NULL,
`lockin_period_frequency_enum` smallint(5) DEFAULT NULL,
`total_deposits_derived` decimal(19,6) DEFAULT NULL,
`total_withdrawals_derived` decimal(19,6) DEFAULT NULL,
`total_interest_posted_derived` decimal(19,6) DEFAULT NULL,
`account_balance_derived` decimal(19,6) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
UNIQUE KEY `sa_account_no_UNIQUE` (`account_no`),
UNIQUE KEY `sa_externalid_UNIQUE` (`external_id`),
KEY `FKSA00000000000001` (`client_id`),
KEY `FKSA00000000000002` (`group_id`),
KEY `FKSA00000000000003` (`product_id`),
CONSTRAINT `FKSA00000000000001` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`),
CONSTRAINT `FKSA00000000000002` FOREIGN KEY (`group_id`) REFERENCES `m_group` (`id`),
CONSTRAINT `FKSA00000000000003` FOREIGN KEY (`product_id`) REFERENCES `m_savings_product` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `m_savings_account_transaction` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`savings_account_id` bigint(20) NOT NULL,
`transaction_type_enum` smallint(5) NOT NULL,
`transaction_date` date NOT NULL,
`amount` decimal(19,6) NOT NULL,
`is_reversed` tinyint(1) NOT NULL,
PRIMARY KEY (`id`),
KEY `FKSAT0000000001` (`savings_account_id`),
CONSTRAINT `FKSAT0000000001` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -1,8 +0,0 @@
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '7', 'Marked for Rescheduling', 'Marked for Rescheduling');
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '10', 'Apply Charges', 'Apply Charges');
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '11', 'Apply Interest', 'Apply Interest');
@@ -1,16 +0,0 @@
ALTER TABLE `m_savings_account`
ADD COLUMN `status_enum` SMALLINT(5) NOT NULL DEFAULT 300 AFTER `product_id` ;
ALTER TABLE `m_savings_account`
ADD COLUMN `activation_date` DATE DEFAULT NULL AFTER `status_enum`;
ALTER TABLE `m_savings_account`
ADD COLUMN `lockedin_until_date_derived` DATE DEFAULT NULL AFTER `lockin_period_frequency_enum`;
ALTER TABLE `m_portfolio_command_source`
ADD COLUMN `savings_id` BIGINT(20) NULL DEFAULT NULL AFTER `loan_id` ;
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES
('transaction_savings', 'ACTIVATE_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'ACTIVATE', '1'),
('transaction_savings', 'ACTIVATE_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'ACTIVATE', '0');
@@ -1,4 +0,0 @@
ALTER TABLE m_portfolio_command_source
CHANGE COLUMN `savings_id` `savings_account_id` BIGINT(20) NULL DEFAULT NULL ;
@@ -1,12 +0,0 @@
ALTER TABLE `m_loan_collateral`
ADD COLUMN `value` DECIMAL(19,6) NULL DEFAULT NULL AFTER `type_cv_id`;
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES('portfolio', 'CREATE_COLLATERAL', 'COLLATERAL', 'CREATE', '0'),
('portfolio', 'READ_COLLATERAL', 'COLLATERAL', 'READ', '0'),
('portfolio', 'UPDATE_COLLATERAL', 'COLLATERAL', 'UPDATE', '0'),
('portfolio', 'DELETE_COLLATERAL', 'COLLATERAL', 'DELETE', '0'),
('portfolio', 'CREATE_COLLATERAL_CHECKER', 'COLLATERAL', 'CREATE', '0'),
('portfolio', 'UPDATE_COLLATERAL_CHECKER', 'COLLATERAL', 'UPDATE', '0'),
('portfolio', 'DELETE_COLLATERAL_CHECKER', 'COLLATERAL', 'DELETE', '0');
@@ -1,31 +0,0 @@
ALTER TABLE `m_savings_product`
ADD COLUMN `interest_period_enum` SMALLINT(5) NOT NULL AFTER `nominal_interest_rate_period_frequency_enum`,
ADD COLUMN `interest_calculation_type_enum` SMALLINT(5) NOT NULL AFTER `interest_period_enum`;
ALTER TABLE `m_savings_account`
ADD COLUMN `interest_period_enum` SMALLINT(5) NOT NULL AFTER `annual_nominal_interest_rate`,
ADD COLUMN `interest_calculation_type_enum` SMALLINT(5) NOT NULL AFTER `interest_period_enum`;
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES
('transaction_savings', 'CALCULATEINTEREST_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'CALCULATEINTEREST', '1'),
('transaction_savings', 'CALCULATEINTEREST_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'CALCULATEINTEREST', '0');
ALTER TABLE `m_savings_account_transaction`
ADD COLUMN `running_balance_derived` DECIMAL(19,6) NULL AFTER `is_reversed`,
ADD COLUMN `balance_number_of_days_derived` INT NULL AFTER `running_balance_derived`,
ADD COLUMN `balance_end_date_derived` DATE NULL AFTER `balance_number_of_days_derived`,
ADD COLUMN `cumulative_balance_derived` DECIMAL(19,6) NULL AFTER `balance_end_date_derived`;
ALTER TABLE `m_savings_account`
ADD COLUMN `total_interest_earned_derived` DECIMAL(19,6) DEFAULT NULL AFTER `total_withdrawals_derived`;
ALTER TABLE `m_savings_product`
ADD COLUMN `interest_calculation_days_in_year_type_enum` SMALLINT(5) NOT NULL AFTER `interest_calculation_type_enum`;
ALTER TABLE `m_savings_account`
ADD COLUMN `interest_calculation_days_in_year_type_enum` SMALLINT(5) NOT NULL AFTER `interest_calculation_type_enum`;
@@ -1,34 +0,0 @@
-- Adding new system defined code for tracking guarantor relation ship type
insert into m_code (code_name,is_system_defined) values ('GuarantorRelationship',1);
-- Adding a few Default Guarantor Relationships
insert into m_code_value (code_id,code_value,order_position)
select id,"Spouse",0
from m_code
where m_code.code_name="GuarantorRelationship";
insert into m_code_value (code_id,code_value,order_position)
select id,"Parent",0
from m_code
where m_code.code_name="GuarantorRelationship";
insert into m_code_value (code_id,code_value,order_position)
select id,"Sibling",0
from m_code
where m_code.code_name="GuarantorRelationship";
insert into m_code_value (code_id,code_value,order_position)
select id,"Business Associate",0
from m_code
where m_code.code_name="GuarantorRelationship";
insert into m_code_value (code_id,code_value,order_position)
select id,"Other",0
from m_code
where m_code.code_name="GuarantorRelationship";
-- Add a column to link Guarantor to Code value
ALTER TABLE `m_guarantor`
ADD COLUMN `client_reln_cv_id` INT(11) NULL DEFAULT NULL AFTER `loan_id`,
ADD CONSTRAINT `FK_m_guarantor_m_code_value` FOREIGN KEY (`client_reln_cv_id`) REFERENCES `m_code_value` (`id`);