diff --git a/mifosng-db/0001a-mifosplatform-core-ddl-latest.sql b/mifosng-db/0001a-mifosplatform-core-ddl-latest.sql index 27b783100..e72e89f1e 100644 --- a/mifosng-db/0001a-mifosplatform-core-ddl-latest.sql +++ b/mifosng-db/0001a-mifosplatform-core-ddl-latest.sql @@ -96,6 +96,7 @@ CREATE TABLE `ref_loan_transaction_processing_strategy` ( CREATE TABLE `m_code` ( `id` int(11) NOT NULL AUTO_INCREMENT, `code_name` varchar(100) DEFAULT NULL, + `is_system_defined` TINYINT(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `code_name` (`code_name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -194,10 +195,9 @@ CREATE TABLE `m_permission` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `grouping` varchar(45) DEFAULT NULL, `code` varchar(100) NOT NULL, - `default_description` varchar(500) NOT NULL, - `default_name` varchar(100) NOT NULL, `entity_name` varchar(100) DEFAULT NULL, `action_name` varchar(100) DEFAULT NULL, + `is_maker_checker` TINYINT(1) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `code` (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -265,7 +265,7 @@ CREATE TABLE `m_portfolio_command_source` ( `api_operation` varchar(20) NOT NULL, `api_resource` varchar(20) NOT NULL, `resource_id` bigint(20) DEFAULT NULL, - `command_as_json` varchar(1000) NOT NULL, + `command_as_json` varchar(5000) NOT NULL, `maker_id` bigint(20) NOT NULL, `made_on_date` date NOT NULL, `checker_id` bigint(20) DEFAULT NULL, diff --git a/mifosng-db/0002-mifosng-base-reference-data.sql b/mifosng-db/0002-mifosng-base-reference-data.sql index 45f7e2607..d3de240df 100644 --- a/mifosng-db/0002-mifosng-base-reference-data.sql +++ b/mifosng-db/0002-mifosng-base-reference-data.sql @@ -127,9 +127,10 @@ Pound','currency.SYP'),(136,'SZL',2,NULL,'Swaziland Lilangeni','currency.SZL'),( (148,'USD',2,'$','US Dollar','currency.USD'), (149,'UYU',2,NULL,'Peso Uruguayo','currency.UYU'),(150,'UZS',2,NULL,'Uzbekistan Sum','currency.UZS'),(151,'VEB',2,NULL,'Venezuelan Bolivar','currency.VEB'), -(152,'VND',2,NULL,'Vietnamese Dong','currency.VND'),(153,'VUV',0,NULL,'Vanuatu Vatu','currency.VUV'),(154,'WST',2,NULL,'Samoa Tala','currency.WST'), - -(155,'XAF',0,NULL,'CFA Franc BEAC','currency.XAF'),(156,'XCD',2,NULL,'East Caribbean Dollar','currency.XCD'), +(152,'VND',2,NULL,'Vietnamese Dong','currency.VND'),(153,'VUV',0,NULL,'Vanuatu Vatu','currency.VUV'), +(154,'WST',2,NULL,'Samoa Tala','currency.WST'), +(155,'XAF',0,NULL,'CFA Franc BEAC','currency.XAF'), +(156,'XCD',2,NULL,'East Caribbean Dollar','currency.XCD'), (157,'XDR',5,NULL,'SDR (Special Drawing Rights)','currency.XDR'), (158,'XOF',0, 'CFA','CFA Franc BCEAO','currency.XOF'), (159,'XPF',0,NULL,'CFP Franc','currency.XPF'), @@ -144,7 +145,7 @@ VALUES (21,'USD',2,'US Dollar','$','currency.USD',1,'2012-05-01 22:43:02','2012- -- create single code and code value for client identifiers INSERT INTO `m_code` -(`id`,`code_name`) VALUES (1,'Customer Identifier'); +(`id`,`code_name`, `is_system_defined`) VALUES (1,'Customer Identifier',1); INSERT INTO `m_code_value` (`id`,`code_id`,`code_value`,`order_position`) @@ -169,14 +170,10 @@ delete from m_role_permission; delete from m_permission; /* System Supplied Permissons */ -INSERT INTO `m_permission` VALUES (1,'special','USER_ADMINISTRATION_SUPER_USER','An application user will have permission to execute all tasks related to user administration.','User administration ALL',NULL,NULL),(2,'special','ORGANISATION_ADMINISTRATION_SUPER_USER','An application user will have permission to execute all tasks related to organisation administration.','Organisation adminsitration ALL',NULL,NULL),(3,'special','PORTFOLIO_MANAGEMENT_SUPER_USER','An application user will have permission to execute all tasks related to portfolio management.','Portfolio management ALL',NULL,NULL),(4,'special','REPORTING_SUPER_USER','An application user will have permission to execute and view all reports.','Reporting ALL',NULL,NULL),(5,'portfolio','CREATE_LOAN','Allows an application user to sumit new loan application.','Can submit new loan application','LOAN','CREATE'),(6,'portfolio','CREATEHISTORIC_LOAN','Allows an application user to sumit new loan application where the submitted on date is in the past.','Can submit historic loan application','LOAN','CREATEHISTORIC'),(7,'transaction_loan','APPROVE_LOAN','Allows an application user to approve a loan application.','Can approve loan application','LOAN','APPROVE'),(8,'transaction_loan','APPROVEINPAST_LOAN','Allows an application user to approve a loan application where the approval date is in the past.','Can approve loan application in the past','LOAN','APPROVEINPAST'),(9,'transaction_loan','REJECT_LOAN','Allows an application user to reject a loan application.','Can reject loan application','LOAN','REJECT'),(10,'transaction_loan','REJECTINPAST_LOAN','Allows an application user to reject a loan application where the rejected date is in the past.','Can reject loan application in the past','LOAN','REJECTINPAST'), -(11,'transaction_loan','WITHDRAW_LOAN','Allows an application user to mark loan application as withdrawn by client.','Can withdraw loan application','LOAN','WITHDRAW'),(12,'transaction_loan','WITHDRAWINPAST_LOAN','Allows an application user to mark loan application as withdrawn by client where the withdran on date is in the past.','Can withdraw loan application in the past','LOAN','WITHDRAWINPAST'),(13,'portfolio','DELETE_LOAN','Allows an application user to complete delete the loan application if it is submitted but not approved.','Can delete submitted loan application','LOAN','DELETE'),(14,'transaction_loan','APPROVALUNDO_LOAN','Allows an application user to undo a loan approval.','Can undo loan approval','LOAN','APPROVALUNDO'),(15,'transaction_loan','DISBURSE_LOAN','Allows an application user to disburse a loan application.','Can disburse loan','LOAN','DISBURSE'),(16,'transaction_loan','DISBURSEINPAST_LOAN','Allows an application user to disburse a loan where the disbursement date is in the past.','Can disburse loan in the past','LOAN','DISBURSEINPAST'),(17,'transaction_loan','DISBURSALUNDO_LOAN','Allows an application user to undo a loan disbursal if not payments already made.','Can undo loan disbursal','LOAN','DISBURSALUNDO'),(18,'transaction_loan','REPAYMENT_LOAN','Allows an application user to enter a repayment on the loan.','Can enter a repayment against a loan','LOAN','REPAYMENT'),(19,'transaction_loan','REPAYMENTINPAST_LOAN','Allows an application user to enter a repayment on the loan where the repayment date is in the past.','Can enter a repayment against a loan in the past','LOAN','REPAYMENTINPAST'),(20,'portfolio','CREATE_CLIENT','Allows an application user to add a new client.','Can add a new client.','CLIENT','CREATE'), -(42,'special','ALL_FUNCTIONS','An application user will have permission to execute all tasks.','ALL',NULL,NULL),(43,'special','ALL_FUNCTIONS_READ','An application user will have permission to execute all read tasks.','ALL READ',NULL,NULL),(112,'organisation','CREATE_CHARGE','Create a Charge','Create a Charge','CHARGE','CREATE'),(113,'organisation','READ_CHARGE','Read Charges','Read Charges','CHARGE','READ'),(114,'organisation','UPDATE_CHARGE','Update a Charge','Update a Charge','CHARGE','UPDATE'),(115,'organisation','DELETE_CHARGE','Delete a Charge','Delete a Charge','CHARGE','DELETE'),(120,'portfolio','READ_CLIENT','Read Clients','Read Clients','CLIENT','READ'),(121,'portfolio','UPDATE_CLIENT','Update a Client','Update a Client','CLIENT','UPDATE'),(122,'portfolio','DELETE_CLIENT','Delete a Client','Delete a Client','CLIENT','DELETE'),(123,'portfolio','CREATE_CLIENTIMAGE','Create/Update Client Image','Create/Update Client Image','CLIENTIMAGE','CREATE'),(124,'portfolio','READ_CLIENTIMAGE','Read Client Images','Read Client Images','CLIENTIMAGE','READ'),(126,'portfolio','DELETE_CLIENTIMAGE','Delete Client Image','Delete Client Image','CLIENTIMAGE','DELETE'),(127,'portfolio','CREATE_CLIENTNOTE','Create a Client Note','Create a Client Note','CLIENTNOTE','CREATE'),(128,'portfolio','READ_CLIENTNOTE','Read Client Notes','Read Client Notes','CLIENTNOTE','READ'),(129,'portfolio','UPDATE_CLIENTNOTE','Update a Client Note','Update a Client Note','CLIENTNOTE','UPDATE'),(130,'portfolio','DELETE_CLIENTNOTE','Delete a Client Note','Delete a Client Note','CLIENTNOTE','DELETE'),(131,'portfolio','CREATE_CLIENTIDENTIFIER','Create a Client Identifier','Create a Client Identifier','CLIENTIDENTIFIER','CREATE'), -(132,'portfolio','READ_CLIENTIDENTIFIER','Read Client Identifiers','Read Client Identifiers','CLIENTIDENTIFIER','READ'),(133,'portfolio','UPDATE_CLIENTIDENTIFIER','Update a Client Identifier','Update a Client Identifier','CLIENTIDENTIFIER','UPDATE'),(134,'portfolio','DELETE_CLIENTIDENTIFIER','Delete a Client Identifier','Delete a Client Identifier','CLIENTIDENTIFIER','DELETE'),(135,'configuration','CREATE_CODE','Create a Code','Create a Code','CODE','CREATE'),(136,'configuration','READ_CODE','Read Codes','Read Codes','CODE','READ'),(137,'configuration','UPDATE_CODE','Update a Code','Update a Code','CODE','UPDATE'),(138,'configuration','DELETE_CODE','Delete a Code','Delete a Code','CODE','DELETE'),(139,'configuration','READ_CURRENCY','Read Currencies','Read Currencies','CURRENCY','READ'),(140,'configuration','UPDATE_CURRENCY','Update Currencies','Update Currencies','CURRENCY','UPDATE'),(141,'portfolio','CREATE_DOCUMENT','Create and Upload a Document','Create and Upload a Document','DOCUMENT','CREATE'),(142,'portfolio','READ_DOCUMENT','Read Documents','Read Documents','DOCUMENT','READ'),(143,'portfolio','UPDATE_DOCUMENT','Update and Upload a Document','Update and Upload a Document','DOCUMENT','UPDATE'),(144,'portfolio','DELETE_DOCUMENT','Delete a Document','Delete a Document','DOCUMENT','DELETE'),(145,'organisation','CREATE_FUND','Create a Fund','Create a Fund','FUND','CREATE'),(146,'organisation','READ_FUND','Read Funds','Read Funds','FUND','READ'),(147,'organisation','UPDATE_FUND','Update a Fund','Update a Fund','FUND','UPDATE'),(148,'organisation','DELETE_FUND','Delete Fund','Delete Fund','FUND','DELETE'),(149,'portfolio','CREATE_GROUP','Create a Group','Create a Group','GROUP','CREATE'), -(150,'portfolio','READ_GROUP','Read Groups','Read Groups','GROUP','READ'),(151,'portfolio','UPDATE_GROUP','Update a Group','Update a Group','GROUP','UPDATE'),(152,'portfolio','DELETE_GROUP','Delete a Group','Delete a Group','GROUP','DELETE'),(153,'organisation','CREATE_LOANPRODUCT','Create a Loan Product','Create a Loan Product','LOANPRODUCT','CREATE'),(154,'organisation','READ_LOANPRODUCT','Read Loan Products','Read Loan Products','LOANPRODUCT','READ'),(155,'organisation','UPDATE_LOANPRODUCT','Update a Loan Product','Update a Loan Product','LOANPRODUCT','UPDATE'),(156,'organisation','DELETE_LOANPRODUCT','Delete a Loan Product','Delete a Loan Product','LOANPRODUCT','DELETE'),(157,'portfolio','READ_LOAN','Read Loans','Read Loans','LOAN','READ'),(158,'portfolio','UPDATE_LOAN','Update a Loan','Update a Loan','LOAN','UPDATE'),(159,'portfolio','UPDATEHISTORIC_LOAN','Update a Loan that was Created Historically','Update a Loan that was Created Historically','LOAN','UPDATEHISTORIC'),(160,'portfolio','CREATE_LOANCHARGE','Create a Loan Charge','Create a Loan Charge','LOANCHARGE','CREATE'),(161,'portfolio','UPDATE_LOANCHARGE','Update a Loan Charge','Update a Loan Charge','LOANCHARGE','UPDATE'),(162,'portfolio','DELETE_LOANCHARGE','Delete a Loan Charge','Delete a Loan Charge','LOANCHARGE','DELETE'),(163,'portfolio','WAIVE_LOANCHARGE','Waive a Loan Charge','Waive a Loan Charge','LOANCHARGE','WAIVE'),(164,'transaction_loan','BULKREASSIGN_LOAN','Bulk Reassign Loans','Bulk Reassign Loans','LOAN','BULKREASSIGN'),(165,'transaction_loan','ADJUST_LOAN','Adjust a Loan Transaction','Adjust a Loan Transaction','LOAN','ADJUST'),(166,'transaction_loan','WAIVEINTERESTPORTION_LOAN','Waive Portion of Loan Interest','Waive Portion of Loan Interest','LOAN','WAIVEINTERESTPORTION'), -(167,'transaction_loan','WRITEOFF_LOAN','Write-Off a Loan','Write-Off a Loan','LOAN','WRITEOFF'),(168,'transaction_loan','CLOSE_LOAN','Close a Loan','Close a Loan','LOAN','CLOSE'),(169,'transaction_loan','CLOSEASRESCHEDULED_LOAN','Close a Loan (having been Rescheduled (Mifos Legacy Need)','Close a Loan (having been Rescheduled (Mifos Legacy Need)','LOAN','CLOSEASRESCHEDULED'),(170,'organisation','READ_MAKERCHECKER','Read Maker-Checker Entries','Read Maker-Checker Entries','MAKERCHECKER','READ'),(171,'organisation','CREATE_OFFICE','Create an Office','Create an Office','OFFICE','CREATE'),(172,'organisation','READ_OFFICE','Read Offices','Read Offices','OFFICE','READ'),(173,'organisation','UPDATE_OFFICE','Update an Office','Update an Office','OFFICE','UPDATE'),(174,'organisation','DELETE_OFFICE','Delete an Office','Delete an Office','OFFICE','DELETE'),(175,'organisation','READ_OFFICETRANSACTION','Read Office Transactions','Read Office Transactions','OFFICETRANSACTION','READ'),(176,'organisation','CREATE_OFFICETRANSACTION','Create an Office Transaction','Create an Office Transaction','OFFICETRANSACTION','CREATE'),(177,'authorisation','READ_PERMISSION','Read Permissions','Read Permissions','PERMISSION','READ'),(178,'authorisation','CREATE_ROLE','Create a Role','Create a Role','ROLE','CREATE'),(179,'authorisation','READ_ROLE','Read Roles','Read Roles','ROLE','READ'),(180,'authorisation','UPDATE_ROLE','Update a Role','Update a Role','ROLE','UPDATE'),(181,'authorisation','DELETE_ROLE','Delete a Role','Delete a Role','ROLE','DELETE'),(182,'authorisation','CREATE_USER','Create a User','Create a User','USER','CREATE'),(183,'authorisation','READ_USER','Read Users','Read Users','USER','READ'),(184,'authorisation','UPDATE_USER','Update a User','Update a User','USER','UPDATE'), -(185,'authorisation','DELETE_USER','Create a User','Create a User','USER','DELETE'),(186,'organisation','CREATE_STAFF','Create a Staff Member','Create a Staff Member','STAFF','CREATE'),(187,'organisation','READ_STAFF','Read Staff','Read Staff','STAFF','READ'),(188,'organisation','UPDATE_STAFF','Update a Staff Member','Update a Staff Member','STAFF','UPDATE'),(189,'organisation','DELETE_STAFF','Delete a Staff Member','Delete a Staff Member','STAFF','DELETE'),(190,'organisation','CREATE_SAVINGSPRODUCT','Create a Savings Product','Create a Savings Product','SAVINGSPRODUCT','CREATE'),(191,'organisation','READ_SAVINGSPRODUCT','Read Savings Products','Read Savings Products','SAVINGSPRODUCT','READ'),(192,'organisation','UPDATE_SAVINGSPRODUCT','Update a Savings Product','Update a Savings Product','SAVINGSPRODUCT','UPDATE'),(193,'organisation','DELETE_SAVINGSPRODUCT','Delete a Savings Product','Delete a Savings Product','SAVINGSPRODUCT','DELETE'),(194,'organisation','CREATE_DEPOSITPRODUCT','Create a Deposit Product','Create a Deposit Product','DEPOSITPRODUCT','CREATE'),(195,'organisation','READ_DEPOSITPRODUCT','Read Deposit Products','Read Deposit Products','DEPOSITPRODUCT','READ'),(196,'organisation','UPDATE_DEPOSITPRODUCT','Update a Deposit Product','Update a Deposit Product','DEPOSITPRODUCT','UPDATE'),(197,'organisation','DELETE_DEPOSITPRODUCT','Delete a Deposit Product','Delete a Deposit Product','DEPOSITPRODUCT','DELETE'),(198,'portfolio','CREATE_DEPOSITACCOUNT','Create a Deposit Account','Create a Deposit Account','DEPOSITACCOUNT','CREATE'),(199,'portfolio','READ_DEPOSITACCOUNT','Read Deposit Accounts','Read Deposit Accounts','DEPOSITACCOUNT','READ'),(200,'portfolio','UPDATE_DEPOSITACCOUNT','Update a Deposit Account','Update a Deposit Account','DEPOSITACCOUNT','UPDATE'), -(201,'portfolio','DELETE_DEPOSITACCOUNT','Delete a Deposit Account','Delete a Deposit Account','DEPOSITACCOUNT','DELETE'),(202,'transaction_deposit','APPROVE_DEPOSITACCOUNT','Approve a Deposit Account','Approve a Deposit Account','DEPOSITACCOUNT','APPROVE'),(203,'transaction_deposit','REJECT_DEPOSITACCOUNT','Reject Deposit Account','Reject Deposit Account','DEPOSITACCOUNT','REJECT'),(204,'transaction_deposit','WITHDRAW_DEPOSITACCOUNT','Withdraw Deposit Account','Withdraw Deposit Account','DEPOSITACCOUNT','WITHDRAW'),(205,'transaction_deposit','APPROVALUNDO_DEPOSITACCOUNT','Undo Approval of Deposit Account','Undo Approval of Deposit Account','DEPOSITACCOUNT','APPROVALUNDO'),(206,'transaction_deposit','WITHDRAWAL_DEPOSITACCOUNT','Make a Withdrawal From Deposit Account','Make a Withdrawal From Deposit Account','DEPOSITACCOUNT','WITHDRAWAL'),(207,'transaction_deposit','INTEREST_DEPOSITACCOUNT','Apply Interest to Deposit Accounts','Apply Interest to Deposit Accounts','DEPOSITACCOUNT','INTEREST'),(208,'transaction_deposit','RENEW_DEPOSITACCOUNT','Renew Deposit Account','Renew Deposit Account','DEPOSITACCOUNT','RENEW'),(209,'portfolio','CREATE_SAVINGSACCOUNT','Create a Savings Account','Create a Savings Account','SAVINGSACCOUNT','CREATE'),(210,'portfolio','READ_SAVINGSACCOUNT','Read Savings Accounts','Read Savings Accounts','SAVINGSACCOUNT','READ'),(211,'portfolio','UPDATE_SAVINGSACCOUNT','Update a Savings Account','Update a Savings Account','SAVINGSACCOUNT','UPDATE'),(212,'portfolio','DELETE_SAVINGSACCOUNT','Delete a Savings Account','Delete a Savings Account','SAVINGSACCOUNT','DELETE'); +INSERT INTO `m_permission` VALUES +(1,'special','USER_ADMINISTRATION_SUPER_USER',NULL,NULL,0), +(2,'special','ORGANISATION_ADMINISTRATION_SUPER_USER',NULL,NULL,0),(3,'special','PORTFOLIO_MANAGEMENT_SUPER_USER',NULL,NULL,0),(4,'special','REPORTING_SUPER_USER',NULL,NULL,0),(5,'portfolio','CREATE_LOAN','LOAN','CREATE',1),(6,'portfolio','CREATEHISTORIC_LOAN','LOAN','CREATEHISTORIC',1),(7,'transaction_loan','APPROVE_LOAN','LOAN','APPROVE',1),(8,'transaction_loan','APPROVEINPAST_LOAN','LOAN','APPROVEINPAST',1),(9,'transaction_loan','REJECT_LOAN','LOAN','REJECT',1),(10,'transaction_loan','REJECTINPAST_LOAN','LOAN','REJECTINPAST',1),(11,'transaction_loan','WITHDRAW_LOAN','LOAN','WITHDRAW',1),(12,'transaction_loan','WITHDRAWINPAST_LOAN','LOAN','WITHDRAWINPAST',1),(13,'portfolio','DELETE_LOAN','LOAN','DELETE',1),(14,'transaction_loan','APPROVALUNDO_LOAN','LOAN','APPROVALUNDO',1),(15,'transaction_loan','DISBURSE_LOAN','LOAN','DISBURSE',1),(16,'transaction_loan','DISBURSEINPAST_LOAN','LOAN','DISBURSEINPAST',1),(17,'transaction_loan','DISBURSALUNDO_LOAN','LOAN','DISBURSALUNDO',1),(18,'transaction_loan','REPAYMENT_LOAN','LOAN','REPAYMENT',1),(19,'transaction_loan','REPAYMENTINPAST_LOAN','LOAN','REPAYMENTINPAST',1),(20,'portfolio','CREATE_CLIENT','CLIENT','CREATE',1),(42,'special','ALL_FUNCTIONS',NULL,NULL,0),(43,'special','ALL_FUNCTIONS_READ',NULL,NULL,0),(112,'organisation','CREATE_CHARGE','CHARGE','CREATE',1),(113,'organisation','READ_CHARGE','CHARGE','READ',0),(114,'organisation','UPDATE_CHARGE','CHARGE','UPDATE',1),(115,'organisation','DELETE_CHARGE','CHARGE','DELETE',1),(120,'portfolio','READ_CLIENT','CLIENT','READ',0),(121,'portfolio','UPDATE_CLIENT','CLIENT','UPDATE',1),(122,'portfolio','DELETE_CLIENT','CLIENT','DELETE',1),(123,'portfolio','CREATE_CLIENTIMAGE','CLIENTIMAGE','CREATE',1),(124,'portfolio','READ_CLIENTIMAGE','CLIENTIMAGE','READ',0),(126,'portfolio','DELETE_CLIENTIMAGE','CLIENTIMAGE','DELETE',1),(127,'portfolio','CREATE_CLIENTNOTE','CLIENTNOTE','CREATE',1),(128,'portfolio','READ_CLIENTNOTE','CLIENTNOTE','READ',0),(129,'portfolio','UPDATE_CLIENTNOTE','CLIENTNOTE','UPDATE',1),(130,'portfolio','DELETE_CLIENTNOTE','CLIENTNOTE','DELETE',1),(131,'portfolio','CREATE_CLIENTIDENTIFIER','CLIENTIDENTIFIER','CREATE',1),(132,'portfolio','READ_CLIENTIDENTIFIER','CLIENTIDENTIFIER','READ',0),(133,'portfolio','UPDATE_CLIENTIDENTIFIER','CLIENTIDENTIFIER','UPDATE',1),(134,'portfolio','DELETE_CLIENTIDENTIFIER','CLIENTIDENTIFIER','DELETE',1),(135,'configuration','CREATE_CODE','CODE','CREATE',1),(136,'configuration','READ_CODE','CODE','READ',0),(137,'configuration','UPDATE_CODE','CODE','UPDATE',1),(138,'configuration','DELETE_CODE','CODE','DELETE',1),(139,'configuration','READ_CURRENCY','CURRENCY','READ',0),(140,'configuration','UPDATE_CURRENCY','CURRENCY','UPDATE',1),(141,'portfolio','CREATE_DOCUMENT','DOCUMENT','CREATE',1),(142,'portfolio','READ_DOCUMENT','DOCUMENT','READ',0),(143,'portfolio','UPDATE_DOCUMENT','DOCUMENT','UPDATE',1),(144,'portfolio','DELETE_DOCUMENT','DOCUMENT','DELETE',1),(145,'organisation','CREATE_FUND','FUND','CREATE',1),(146,'organisation','READ_FUND','FUND','READ',0),(147,'organisation','UPDATE_FUND','FUND','UPDATE',1),(148,'organisation','DELETE_FUND','FUND','DELETE',1),(149,'portfolio','CREATE_GROUP','GROUP','CREATE',1),(150,'portfolio','READ_GROUP','GROUP','READ',0),(151,'portfolio','UPDATE_GROUP','GROUP','UPDATE',1),(152,'portfolio','DELETE_GROUP','GROUP','DELETE',1),(153,'organisation','CREATE_LOANPRODUCT','LOANPRODUCT','CREATE',1),(154,'organisation','READ_LOANPRODUCT','LOANPRODUCT','READ',0),(155,'organisation','UPDATE_LOANPRODUCT','LOANPRODUCT','UPDATE',1),(156,'organisation','DELETE_LOANPRODUCT','LOANPRODUCT','DELETE',1),(157,'portfolio','READ_LOAN','LOAN','READ',0),(158,'portfolio','UPDATE_LOAN','LOAN','UPDATE',1),(159,'portfolio','UPDATEHISTORIC_LOAN','LOAN','UPDATEHISTORIC',1),(160,'portfolio','CREATE_LOANCHARGE','LOANCHARGE','CREATE',1),(161,'portfolio','UPDATE_LOANCHARGE','LOANCHARGE','UPDATE',1),(162,'portfolio','DELETE_LOANCHARGE','LOANCHARGE','DELETE',1),(163,'portfolio','WAIVE_LOANCHARGE','LOANCHARGE','WAIVE',1),(164,'transaction_loan','BULKREASSIGN_LOAN','LOAN','BULKREASSIGN',1),(165,'transaction_loan','ADJUST_LOAN','LOAN','ADJUST',1),(166,'transaction_loan','WAIVEINTERESTPORTION_LOAN','LOAN','WAIVEINTERESTPORTION',1),(167,'transaction_loan','WRITEOFF_LOAN','LOAN','WRITEOFF',1),(168,'transaction_loan','CLOSE_LOAN','LOAN','CLOSE',1),(169,'transaction_loan','CLOSEASRESCHEDULED_LOAN','LOAN','CLOSEASRESCHEDULED',1),(170,'organisation','READ_MAKERCHECKER','MAKERCHECKER','READ',0),(171,'organisation','CREATE_OFFICE','OFFICE','CREATE',1),(172,'organisation','READ_OFFICE','OFFICE','READ',0),(173,'organisation','UPDATE_OFFICE','OFFICE','UPDATE',1),(174,'organisation','DELETE_OFFICE','OFFICE','DELETE',1),(175,'organisation','READ_OFFICETRANSACTION','OFFICETRANSACTION','READ',0),(176,'organisation','CREATE_OFFICETRANSACTION','OFFICETRANSACTION','CREATE',1),(177,'authorisation','READ_PERMISSION','PERMISSION','READ',0),(178,'authorisation','CREATE_ROLE','ROLE','CREATE',1),(179,'authorisation','READ_ROLE','ROLE','READ',0),(180,'authorisation','UPDATE_ROLE','ROLE','UPDATE',1),(181,'authorisation','DELETE_ROLE','ROLE','DELETE',1),(182,'authorisation','CREATE_USER','USER','CREATE',1),(183,'authorisation','READ_USER','USER','READ',0),(184,'authorisation','UPDATE_USER','USER','UPDATE',1),(185,'authorisation','DELETE_USER','USER','DELETE',1),(186,'organisation','CREATE_STAFF','STAFF','CREATE',1),(187,'organisation','READ_STAFF','STAFF','READ',0),(188,'organisation','UPDATE_STAFF','STAFF','UPDATE',1),(189,'organisation','DELETE_STAFF','STAFF','DELETE',1),(190,'organisation','CREATE_SAVINGSPRODUCT','SAVINGSPRODUCT','CREATE',1),(191,'organisation','READ_SAVINGSPRODUCT','SAVINGSPRODUCT','READ',0),(192,'organisation','UPDATE_SAVINGSPRODUCT','SAVINGSPRODUCT','UPDATE',1),(193,'organisation','DELETE_SAVINGSPRODUCT','SAVINGSPRODUCT','DELETE',1),(194,'organisation','CREATE_DEPOSITPRODUCT','DEPOSITPRODUCT','CREATE',1),(195,'organisation','READ_DEPOSITPRODUCT','DEPOSITPRODUCT','READ',0),(196,'organisation','UPDATE_DEPOSITPRODUCT','DEPOSITPRODUCT','UPDATE',1),(197,'organisation','DELETE_DEPOSITPRODUCT','DEPOSITPRODUCT','DELETE',1),(198,'portfolio','CREATE_DEPOSITACCOUNT','DEPOSITACCOUNT','CREATE',1),(199,'portfolio','READ_DEPOSITACCOUNT','DEPOSITACCOUNT','READ',0),(200,'portfolio','UPDATE_DEPOSITACCOUNT','DEPOSITACCOUNT','UPDATE',1),(201,'portfolio','DELETE_DEPOSITACCOUNT','DEPOSITACCOUNT','DELETE',1),(202,'transaction_deposit','APPROVE_DEPOSITACCOUNT','DEPOSITACCOUNT','APPROVE',1),(203,'transaction_deposit','REJECT_DEPOSITACCOUNT','DEPOSITACCOUNT','REJECT',1),(204,'transaction_deposit','WITHDRAW_DEPOSITACCOUNT','DEPOSITACCOUNT','WITHDRAW',1),(205,'transaction_deposit','APPROVALUNDO_DEPOSITACCOUNT','DEPOSITACCOUNT','APPROVALUNDO',1),(206,'transaction_deposit','WITHDRAWAL_DEPOSITACCOUNT','DEPOSITACCOUNT','WITHDRAWAL',1),(207,'transaction_deposit','INTEREST_DEPOSITACCOUNT','DEPOSITACCOUNT','INTEREST',1),(208,'transaction_deposit','RENEW_DEPOSITACCOUNT','DEPOSITACCOUNT','RENEW',1),(209,'portfolio','CREATE_SAVINGSACCOUNT','SAVINGSACCOUNT','CREATE',1),(210,'portfolio','READ_SAVINGSACCOUNT','SAVINGSACCOUNT','READ',0),(211,'portfolio','UPDATE_SAVINGSACCOUNT','SAVINGSACCOUNT','UPDATE',1),(212,'portfolio','DELETE_SAVINGSACCOUNT','SAVINGSACCOUNT','DELETE',1), +(213,'authorisation','PERMISSIONS_ROLE','ROLE','PERMISSIONS',1); INSERT INTO `m_role` (`id`, `name`, `description`, `createdby_id`, `created_date`, `lastmodified_date`, `lastmodifiedby_id`) VALUES @@ -188,27 +185,10 @@ select 1, id from m_permission where code = 'ALL_FUNCTIONS'; -/* add a read permission for each defined report */ -insert into m_permission(grouping, `code`, default_description, default_name, entity_name, action_name) -select 'report', concat('READ_', sr.report_name), concat('READ_', sr.report_name), concat('READ_', sr.report_name), sr.report_name, 'READ' -from stretchy_report sr; - -/* add a create, read, update and delete permission for each registered datatable */ -insert into m_permission(grouping, `code`, default_description, default_name, entity_name, action_name) -select 'datatable', concat('CREATE_', r.registered_table_name), concat('CREATE_', r.registered_table_name), concat('CREATE_', r.registered_table_name), r.registered_table_name, 'CREATE' -from x_registered_table r; - -insert into m_permission(grouping, `code`, default_description, default_name, entity_name, action_name) -select 'datatable', concat('READ_', r.registered_table_name), concat('READ_', r.registered_table_name), concat('READ_', r.registered_table_name), r.registered_table_name, 'READ' -from x_registered_table r; - -insert into m_permission(grouping, `code`, default_description, default_name, entity_name, action_name) -select 'datatable', concat('UPDATE_', r.registered_table_name), concat('UPDATE_', r.registered_table_name), concat('UPDATE_', r.registered_table_name), r.registered_table_name, 'UPDATE' -from x_registered_table r; - -insert into m_permission(grouping, `code`, default_description, default_name, entity_name, action_name) -select 'datatable', concat('DELETE_', r.registered_table_name), concat('DELETE_', r.registered_table_name), concat('DELETE_', r.registered_table_name), r.registered_table_name, 'DELETE' -from x_registered_table r; +update m_permission +set is_maker_checker = true +where grouping not in ('special', 'report') +and action_name != 'READ'; INSERT INTO `m_appuser` (`id`, `office_id`, `username`, `firstname`, `lastname`, `password`, `email`, `firsttime_login_remaining`, `nonexpired`, `nonlocked`, `nonexpired_credentials`, `enabled`, @@ -220,26 +200,53 @@ VALUES INSERT INTO `m_appuser_role` (`appuser_id`, `role_id`) VALUES (1,1); INSERT INTO `stretchy_parameter` VALUES -(3,'FullReportList',NULL,'n/a','n/a','n/a','n/a','Y',NULL,NULL,'select r.report_id, r.report_name, r.report_type, -r.report_subtype, r.report_category,\r\nrp.parameter_id, rp.report_parameter_name, p.parameter_name\r\nfrom stretchy_report r\r\nleft join stretchy_report_parameter rp -on rp.report_id = r.report_id\r\nleft join stretchy_parameter p on p.parameter_id = rp.parameter_id\r\nwhere r.use_report is true\r\nand exists\r\n(select \'f\' \r -\nfrom m_appuser_role ur \r\njoin m_role r on r.id = ur.role_id\r\nleft join m_role_permission rp on rp.role_id = r.id\r\nleft join m_permission p on p.id = -rp.permission_id\r\nwhere ur.appuser_id = ${currentUserId}\r\nand (r.name = \'Super User\' or r.name = \'Read Only\') or p.code = concat(\"CAN_RUN_\", -r.report_name))\r\norder by r.report_name, rp.parameter_id'), -(4,'FullParameterList',NULL,'n/a','n/a','n/a','n/a','Y',NULL,NULL,'select parameter_name, -parameter_variable, parameter_label, parameter_displayType, parameter_FormatType, parameter_default, selectOne, selectAll\r\nfrom stretchy_parameter p\r\nwhere -special is null\r\norder by parameter_id'), -(5,'selectOfficeId','officeId','Office','select','number','0',NULL,'Y',NULL,'select id, \r\nconcat(substring -(\"........................................\", 1, \r\n ((LENGTH(`hierarchy`) - LENGTH(REPLACE(`hierarchy`, \'.\', \'\')) - 1) * 4)), \r\n `name`) as tc\r\nfrom -m_office\r\nwhere hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\r\norder by hierarchy'), -(6,'currencyIdSelectAll','currencyId','Currency','select','number','0',NULL,'Y','Y','select `code`, `name`\r\nfrom m_organisation_currency\r\norder by `code`'), -(7,'currencyIdSelectOne','currencyId','Currency','select','number','0',NULL,'Y',NULL,'select `code`, `name`\r\nfrom m_organisation_currency\r\norder by `code`'), -(10,'fundIdSelectAll','fundId','Fund','select','number','0',NULL,'Y','Y','(select id, `name`\r\nfrom m_fund\r\norder by `name`)\r\nunion all\r\n(select -10, \'-\')'), -(80,'selectStartDate','startDate','startDate','date','date','today',NULL,NULL,NULL,NULL), -(81,'selectEndDate','endDate','endDate','date','date','today',NULL,NULL,NULL,NULL), -(82,'reportCategoryList',NULL,'n/a','n/a','n/a','n/a','Y',NULL,NULL,'select -r.report_id, r.report_name, r.report_type, r.report_subtype, r.report_category,\r\nrp.parameter_id, rp.report_parameter_name, p.parameter_name\r\nfrom stretchy_report -r\r\nleft join stretchy_report_parameter rp on rp.report_id = r.report_id\r\nleft join stretchy_parameter p on p.parameter_id = rp.parameter_id\r\nwhere -r.report_category = \'${reportCategory}\'\r\nand r.use_report is true\r\nand exists\r\n(select \'f\' \r\nfrom m_appuser_role ur \r\njoin m_role r on r.id = ur.role_id -\r\nleft join m_role_permission rp on rp.role_id = r.id\r\nleft join m_permission p on p.id = rp.permission_id\r\nwhere ur.appuser_id = ${currentUserId}\r\nand (r.name -= \'Super User\' or r.name = \'Read Only\') or p.code = concat(\"CAN_RUN_\", r.report_name))\r\norder by r.report_name, rp.parameter_id'); \ No newline at end of file +(3,'FullReportList',NULL,'n/a','n/a','n/a','n/a','Y',NULL,NULL,'select r.report_id, r.report_name, r.report_type, r.report_subtype, r.report_category,\r rp.parameter_id, rp.report_parameter_name, p.parameter_name\r from stretchy_report r\r left join stretchy_report_parameter rp on rp.report_id = r.report_id\r left join stretchy_parameter p on p.parameter_id = rp.parameter_id\r where r.use_report is true\r and exists\r (\r select \'f\'\r from m_appuser_role ur \r join m_role r on r.id = ur.role_id\r join m_role_permission rp on rp.role_id = r.id\r join m_permission p on p.id = rp.permission_id\r where ur.appuser_id = ${currentUserId}\r and (p.code in (\'ALL_FUNCTIONS_READ\', \'ALL_FUNCTIONS\') or p.code = concat(\"READ_\", r.report_name))\r )\r order by r.report_name, rp.parameter_id'),(4,'FullParameterList',NULL,'n/a','n/a','n/a','n/a','Y',NULL,NULL,'select parameter_name, parameter_variable, parameter_label, parameter_displayType, parameter_FormatType, parameter_default, selectOne, selectAll\r\nfrom stretchy_parameter p\r\nwhere special is null\r\norder by parameter_id'),(5,'selectOfficeId','officeId','Office','select','number','0',NULL,'Y',NULL,'select id, \r\nconcat(substring(\"........................................\", 1, \r\n ((LENGTH(`hierarchy`) - LENGTH(REPLACE(`hierarchy`, \'.\', \'\')) - 1) * 4)), \r\n `name`) as tc\r\nfrom m_office\r\nwhere hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\r\norder by hierarchy'),(6,'currencyIdSelectAll','currencyId','Currency','select','number','0',NULL,'Y','Y','select `code`, `name`\r\nfrom m_organisation_currency\r\norder by `code`'),(7,'currencyIdSelectOne','currencyId','Currency','select','number','0',NULL,'Y',NULL,'select `code`, `name`\r\nfrom m_organisation_currency\r\norder by `code`'),(10,'fundIdSelectAll','fundId','Fund','select','number','0',NULL,'Y','Y','(select id, `name`\r\nfrom m_fund\r\norder by `name`)\r\nunion all\r\n(select -10, \'-\')'),(80,'selectStartDate','startDate','startDate','date','date','today',NULL,NULL,NULL,NULL),(81,'selectEndDate','endDate','endDate','date','date','today',NULL,NULL,NULL,NULL), +(82,'reportCategoryList',NULL,'n/a','n/a','n/a','n/a','Y',NULL,NULL,'select r.report_id, r.report_name, r.report_type, r.report_subtype, r.report_category,\r rp.parameter_id, rp.report_parameter_name, p.parameter_name\r from stretchy_report r\r left join stretchy_report_parameter rp on rp.report_id = r.report_id\r left join stretchy_parameter p on p.parameter_id = rp.parameter_id\r where r.report_category = \'${reportCategory}\'\r and r.use_report is true\r and exists\r (\r select \'f\'\r from m_appuser_role ur \r join m_role r on r.id = ur.role_id\r join m_role_permission rp on rp.role_id = r.id\r join m_permission p on p.id = rp.permission_id\r where ur.appuser_id = ${currentUserId}\r and (p.code in (\'ALL_FUNCTIONS_READ\', \'ALL_FUNCTIONS\') or p.code = concat(\"READ_\", r.report_name))\r )\r order by r.report_name, rp.parameter_id'); + +-- Add datatables for guarantor stuff in here for now rather than DDL as we expect it may change +DROP TABLE IF EXISTS `m_guarantor_external`; +CREATE TABLE `m_guarantor_external` ( + `loan_id` bigint(20) NOT NULL, + `firstname` varchar(50) NOT NULL, + `lastname` varchar(50) NOT NULL, + `dob` date DEFAULT NULL, + `address_line_1` varchar(500) DEFAULT NULL, + `address_line_2` varchar(500) DEFAULT NULL, + `city` varchar(50) DEFAULT NULL, + `state` varchar(50) DEFAULT NULL, + `country` varchar(50) DEFAULT NULL, + `zip` varchar(20) DEFAULT NULL, + `house_phone_number` varchar(20) DEFAULT NULL, + `mobile_number` varchar(20) DEFAULT NULL, + `comment` varchar(20) DEFAULT NULL, + PRIMARY KEY (`loan_id`), + CONSTRAINT `FK_m_guarantor_m_loan` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO `mifostenant-default`.`x_registered_table` (`registered_table_name`, `application_table_name`) +VALUES ('m_guarantor_external','m_loan'); + +-- Add in permissions for any special datatables or reports added in base reference data +-- This needs to always happen at end of the script +/* add a read permission for each defined report */ +insert into m_permission(grouping, `code`, entity_name, action_name) +select 'report', concat('READ_', sr.report_name), +sr.report_name, 'READ' +from stretchy_report sr; + +/* add a create, read, update and delete permission for each registered datatable */ +insert into m_permission(grouping, `code`, entity_name, action_name) +select 'datatable', concat('CREATE_', r.registered_table_name), r.registered_table_name, 'CREATE' +from x_registered_table r; + +insert into m_permission(grouping, `code`, entity_name, action_name) +select 'datatable', concat('READ_', r.registered_table_name), r.registered_table_name, 'READ' +from x_registered_table r; + +insert into m_permission(grouping, `code`, entity_name, action_name) +select 'datatable', concat('UPDATE_', r.registered_table_name), r.registered_table_name, 'UPDATE' +from x_registered_table r; + +insert into m_permission(grouping, `code`, entity_name, action_name) +select 'datatable', concat('DELETE_', r.registered_table_name), r.registered_table_name, 'DELETE' +from x_registered_table r; \ No newline at end of file diff --git a/mifosng-db/patchesPutOnDemoServer20120820/patch-0001-deposit-account-table.sql b/mifosng-db/patchesPutOnDemoServer20120820/patch-0001-deposit-account-table.sql deleted file mode 100644 index 9fab5e717..000000000 --- a/mifosng-db/patchesPutOnDemoServer20120820/patch-0001-deposit-account-table.sql +++ /dev/null @@ -1,39 +0,0 @@ -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; \ No newline at end of file diff --git a/mifosng-db/patchesPutOnDemoServer20120820/patch-0002-update-south-african-rand-currency-display-symbol.sql b/mifosng-db/patchesPutOnDemoServer20120820/patch-0002-update-south-african-rand-currency-display-symbol.sql deleted file mode 100644 index 9c6d22e01..000000000 --- a/mifosng-db/patchesPutOnDemoServer20120820/patch-0002-update-south-african-rand-currency-display-symbol.sql +++ /dev/null @@ -1,10 +0,0 @@ -UPDATE `ref_currency` -SET -`display_symbol` = 'R' -WHERE id=161; - - -UPDATE `org_organisation_currency` -SET -`display_symbol` = 'R' -WHERE code like 'ZAR'; \ No newline at end of file diff --git a/mifosng-db/patchesPutOnDemoServer20120820/patch-0003-drop-create-deposit-account-and-product-tables.sql b/mifosng-db/patchesPutOnDemoServer20120820/patch-0003-drop-create-deposit-account-and-product-tables.sql deleted file mode 100644 index 38fb05e8c..000000000 --- a/mifosng-db/patchesPutOnDemoServer20120820/patch-0003-drop-create-deposit-account-and-product-tables.sql +++ /dev/null @@ -1,74 +0,0 @@ -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; diff --git a/mifosng-db/patchesPutOnDemoServer20120820/patch-0004-o_charge-table.sql b/mifosng-db/patchesPutOnDemoServer20120820/patch-0004-o_charge-table.sql deleted file mode 100644 index 065ea0166..000000000 --- a/mifosng-db/patchesPutOnDemoServer20120820/patch-0004-o_charge-table.sql +++ /dev/null @@ -1,13 +0,0 @@ -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; - diff --git a/mifosng-db/patchesPutOnDemoServer20120820/patch-0005-r_code-and-enum-tables.sql b/mifosng-db/patchesPutOnDemoServer20120820/patch-0005-r_code-and-enum-tables.sql deleted file mode 100644 index 006445326..000000000 --- a/mifosng-db/patchesPutOnDemoServer20120820/patch-0005-r_code-and-enum-tables.sql +++ /dev/null @@ -1,28 +0,0 @@ -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; \ No newline at end of file diff --git a/mifosng-db/patchesPutOnDemoServer20120820/patch-0006-drop-loan-status-table-in-favour-of-enum.sql b/mifosng-db/patchesPutOnDemoServer20120820/patch-0006-drop-loan-status-table-in-favour-of-enum.sql deleted file mode 100644 index 438840dfb..000000000 --- a/mifosng-db/patchesPutOnDemoServer20120820/patch-0006-drop-loan-status-table-in-favour-of-enum.sql +++ /dev/null @@ -1,6 +0,0 @@ -ALTER TABLE `portfolio_loan` DROP FOREIGN KEY `FK7C885878B1147D1`; - -ALTER TABLE `portfolio_loan` DROP INDEX `FK7C885878B1147D1`; - -drop table `ref_loan_status`; - diff --git a/mifosng-db/patchesPutOnDemoServer20120820/patch-0007-rename-core-tables-with-prefix-m-for-mifos.sql b/mifosng-db/patchesPutOnDemoServer20120820/patch-0007-rename-core-tables-with-prefix-m-for-mifos.sql deleted file mode 100644 index 976bc7592..000000000 --- a/mifosng-db/patchesPutOnDemoServer20120820/patch-0007-rename-core-tables-with-prefix-m-for-mifos.sql +++ /dev/null @@ -1,24 +0,0 @@ -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; diff --git a/mifosng-db/patchesPutOnDemoServer20120820/patch-0008-rename-additional-data-tables-for-default-tenant.sql b/mifosng-db/patchesPutOnDemoServer20120820/patch-0008-rename-additional-data-tables-for-default-tenant.sql deleted file mode 100644 index 314f91e2c..000000000 --- a/mifosng-db/patchesPutOnDemoServer20120820/patch-0008-rename-additional-data-tables-for-default-tenant.sql +++ /dev/null @@ -1,6 +0,0 @@ - -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`; - - diff --git a/mifosng-db/patchesPutOnDemoServer20120820/patch-0009-charge-changes.sql b/mifosng-db/patchesPutOnDemoServer20120820/patch-0009-charge-changes.sql deleted file mode 100644 index 666bd18f6..000000000 --- a/mifosng-db/patchesPutOnDemoServer20120820/patch-0009-charge-changes.sql +++ /dev/null @@ -1,16 +0,0 @@ -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; \ No newline at end of file diff --git a/mifosng-db/patchesPutOnDemoServer20120902/patch-0001-basic_m_staff_table.sql b/mifosng-db/patchesPutOnDemoServer20120902/patch-0001-basic_m_staff_table.sql deleted file mode 100644 index 1fedfe91b..000000000 --- a/mifosng-db/patchesPutOnDemoServer20120902/patch-0001-basic_m_staff_table.sql +++ /dev/null @@ -1,8 +0,0 @@ -CREATE TABLE `m_staff` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `firstname` varchar(50) DEFAULT NULL, - `lastname` varchar(50) DEFAULT NULL, - `display_name` varchar(100) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `display_name` (`display_name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; \ No newline at end of file diff --git a/mifosng-db/patchesPutOnDemoServer20120902/patch-0002-deposit-account-status-and-transactions-table.sql b/mifosng-db/patchesPutOnDemoServer20120902/patch-0002-deposit-account-status-and-transactions-table.sql deleted file mode 100644 index 133adebc7..000000000 --- a/mifosng-db/patchesPutOnDemoServer20120902/patch-0002-deposit-account-status-and-transactions-table.sql +++ /dev/null @@ -1,16 +0,0 @@ -ALTER TABLE `m_deposit_account` ADD COLUMN `status_enum` smallint(5) NOT NULL DEFAULT 0 AFTER `is_deleted`; - -DROP TABLE IF EXISTS `m_deposit_account_transaction`; -CREATE TABLE `m_deposit_account_transaction` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `deposit_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, - PRIMARY KEY (`id`), - KEY `FKKW00000000000005` (`deposit_account_id`), - KEY `FKKW00000000000006` (`contra_id`), - CONSTRAINT `FKKW00000000000005` FOREIGN KEY (`deposit_account_id`) REFERENCES `m_deposit_account` (`id`), - CONSTRAINT `FKKW00000000000006` FOREIGN KEY (`contra_id`) REFERENCES `m_deposit_account_transaction` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; \ No newline at end of file diff --git a/mifosng-db/patchesPutOnDemoServer20120902/patch-0003-deposit_account-fields_added_for_approval.sql b/mifosng-db/patchesPutOnDemoServer20120902/patch-0003-deposit_account-fields_added_for_approval.sql deleted file mode 100644 index 9069d4e17..000000000 --- a/mifosng-db/patchesPutOnDemoServer20120902/patch-0003-deposit_account-fields_added_for_approval.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE `m_deposit_account` -ADD COLUMN `withdrawnon_date` datetime DEFAULT NULL AFTER `pre_closure_interest_rate`, -ADD COLUMN `rejectedon_date` datetime DEFAULT NULL AFTER `withdrawnon_date`, -ADD COLUMN `closedon_date` datetime DEFAULT NULL AFTER `rejectedon_date`; \ No newline at end of file diff --git a/mifosng-db/patchesPutOnDemoServer20120902/patch-0004-support-soft-delete-of-users.sql b/mifosng-db/patchesPutOnDemoServer20120902/patch-0004-support-soft-delete-of-users.sql deleted file mode 100644 index afb3f096a..000000000 --- a/mifosng-db/patchesPutOnDemoServer20120902/patch-0004-support-soft-delete-of-users.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `m_appuser` -ADD COLUMN `is_deleted` TINYINT(1) DEFAULT 0 NOT NULL AFTER `id`; \ No newline at end of file diff --git a/mifosng-db/patchesPutOnDemoServer20120902/patch-0005-m_loan_charge-table.sql b/mifosng-db/patchesPutOnDemoServer20120902/patch-0005-m_loan_charge-table.sql deleted file mode 100644 index 0b586deac..000000000 --- a/mifosng-db/patchesPutOnDemoServer20120902/patch-0005-m_loan_charge-table.sql +++ /dev/null @@ -1,12 +0,0 @@ - -CREATE TABLE `m_loan_charge` ( - `loan_id` bigint(20) NOT NULL, - `charge_id` bigint(20) NOT NULL, - `charge_time_enum` smallint(5) NOT NULL, - `charge_calculation_enum` smallint(5) NOT NULL, - `amount` decimal(19,6) NOT NULL, - PRIMARY KEY (`loan_id`,`charge_id`), - KEY `charge_id` (`charge_id`), - CONSTRAINT `m_loan_charge_ibfk_1` FOREIGN KEY (`charge_id`) REFERENCES `m_charge` (`id`), - CONSTRAINT `m_loan_charge_ibfk_2` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/mifosng-db/patchesPutOnDemoServer20120902/patch-0006-populate-code-values.sql b/mifosng-db/patchesPutOnDemoServer20120902/patch-0006-populate-code-values.sql deleted file mode 100644 index 473c4f538..000000000 --- a/mifosng-db/patchesPutOnDemoServer20120902/patch-0006-populate-code-values.sql +++ /dev/null @@ -1,35 +0,0 @@ - -insert into m_code (code_name) -select name from stretchydata_allowed_list; - -insert into m_code_value (code_id, code_value, order_position) -select c.id, sv.name, sv.id -from stretchydata_allowed_value sv -join stretchydata_allowed_list sl on sv.allowed_list_id = sl.id -join m_code c on c.code_name = sl.name; - - -SET foreign_key_checks = 0; - -ALTER TABLE `stretchydata_dataset_fields` DROP FOREIGN KEY `stretchydata_dataset_fields_fk2` ; - -ALTER TABLE `stretchydata_dataset_fields` -CHANGE COLUMN `allowed_list_id` `code_id` INT(11) NULL DEFAULT NULL , - ADD CONSTRAINT `stretchydata_dataset_fields_fk2` - FOREIGN KEY (`code_id` ) - REFERENCES `m_code` (`id` ) - ON DELETE NO ACTION - ON UPDATE NO ACTION; - -SET foreign_key_checks = 1; - - -update stretchydata_dataset_fields f -join stretchydata_allowed_list l on l.id = f.code_id -join m_code c on c.code_name = l.name -set code_id = c.id -where f.code_id is not null; - - -DROP TABLE `stretchydata_allowed_value`; -DROP TABLE `stretchydata_allowed_list`; \ No newline at end of file diff --git a/mifosng-db/patchesPutOnDemoServer20120902/patch-0007-reporting-and-additional-fields-permissions.sql b/mifosng-db/patchesPutOnDemoServer20120902/patch-0007-reporting-and-additional-fields-permissions.sql deleted file mode 100644 index d454ab15f..000000000 --- a/mifosng-db/patchesPutOnDemoServer20120902/patch-0007-reporting-and-additional-fields-permissions.sql +++ /dev/null @@ -1,23 +0,0 @@ - -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`)); diff --git a/mifosng-db/patchesPutOnDemoServer20120911/patch-0001-insert-special-permissions.sql b/mifosng-db/patchesPutOnDemoServer20120911/patch-0001-insert-special-permissions.sql deleted file mode 100644 index ed4844f3e..000000000 --- a/mifosng-db/patchesPutOnDemoServer20120911/patch-0001-insert-special-permissions.sql +++ /dev/null @@ -1,14 +0,0 @@ - -insert into m_permission (group_enum, code, default_description, default_name) -values (0, "ALL_FUNCTIONS", "An application user will have permission to execute all tasks.", "ALL"); - - -insert into m_permission (group_enum, code, default_description, default_name) -values (0, "ALL_FUNCTIONS_READ", "An application user will have permission to execute all read tasks.", "ALL READ"); - - -/* give default super user role the all_functions permissions as well as current ones for now */ -insert into m_role_permission (permission_id, role_id) -select p.id, 1 -from m_permission p -where p.code = "ALL_FUNCTIONS"; \ No newline at end of file diff --git a/mifosng-db/patchesPutOnDemoServer20120911/patch-0002-m_staff-patch.sql b/mifosng-db/patchesPutOnDemoServer20120911/patch-0002-m_staff-patch.sql deleted file mode 100644 index 24cfc8e16..000000000 --- a/mifosng-db/patchesPutOnDemoServer20120911/patch-0002-m_staff-patch.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE `m_staff` -ADD COLUMN `createdby_id` BIGINT(20) NULL DEFAULT NULL, -ADD COLUMN`created_date` DATETIME NULL DEFAULT NULL, -ADD COLUMN`lastmodifiedby_id` BIGINT(20) NULL DEFAULT NULL, -ADD COLUMN`lastmodified_date` DATETIME NULL DEFAULT NULL; diff --git a/mifosng-db/patchesPutOnDemoServer20120911/patch-0003-m_client-patch.sql b/mifosng-db/patchesPutOnDemoServer20120911/patch-0003-m_client-patch.sql deleted file mode 100644 index b410d9b9f..000000000 --- a/mifosng-db/patchesPutOnDemoServer20120911/patch-0003-m_client-patch.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE `m_client` - ADD COLUMN `display_name` VARCHAR(100) NOT NULL AFTER `lastname`; - -update m_client set display_name = concat_ws(' ',firstname,lastname); \ No newline at end of file diff --git a/mifosng-db/patchesPutOnDemoServer20120911/patch-0004-add-column-matured_on-for-m_deposit_account.sql b/mifosng-db/patchesPutOnDemoServer20120911/patch-0004-add-column-matured_on-for-m_deposit_account.sql deleted file mode 100644 index 30674006e..000000000 --- a/mifosng-db/patchesPutOnDemoServer20120911/patch-0004-add-column-matured_on-for-m_deposit_account.sql +++ /dev/null @@ -1,3 +0,0 @@ -alter table m_deposit_account drop column actual_maturity_date; -alter table m_deposit_account drop column projected_maturity_date; -alter table `m_deposit_account` add column `matured_on` datetime NULL DEFAULT NULL after actual_commencement_date; \ No newline at end of file diff --git a/mifosng-db/patchesPutOnDemoServer20120911/patch-0005-rename-matures-on-column-for-deposit-account.sql b/mifosng-db/patchesPutOnDemoServer20120911/patch-0005-rename-matures-on-column-for-deposit-account.sql deleted file mode 100644 index c82c7f169..000000000 --- a/mifosng-db/patchesPutOnDemoServer20120911/patch-0005-rename-matures-on-column-for-deposit-account.sql +++ /dev/null @@ -1,2 +0,0 @@ -alter table m_deposit_account drop column `matured_on`; -alter table `m_deposit_account` add column `matures_on_date` datetime NULL DEFAULT NULL after actual_commencement_date; \ No newline at end of file diff --git a/mifosng-db/patchesPutOnDemoServer20120911/patch-0006-add-x_registered_table.sql b/mifosng-db/patchesPutOnDemoServer20120911/patch-0006-add-x_registered_table.sql deleted file mode 100644 index d36efa55a..000000000 --- a/mifosng-db/patchesPutOnDemoServer20120911/patch-0006-add-x_registered_table.sql +++ /dev/null @@ -1,12 +0,0 @@ - -/* used to link MySql tables to Mifos X application tables for additional data needs */ - -DROP TABLE IF EXISTS `x_registered_table`; - -CREATE TABLE `x_registered_table` ( - `registered_table_name` varchar(50) NOT NULL, - `registered_table_label` varchar(80) NOT NULL, - `application_table_name` varchar(50) NOT NULL, - PRIMARY KEY (`registered_table_name`), - UNIQUE KEY `registered_table_label` (`registered_table_label`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; \ No newline at end of file diff --git a/mifosng-db/patchesPutOnDemoServer20120911/patch-0006-m_loan-patch.sql b/mifosng-db/patchesPutOnDemoServer20120911/patch-0006-m_loan-patch.sql deleted file mode 100644 index c37090683..000000000 --- a/mifosng-db/patchesPutOnDemoServer20120911/patch-0006-m_loan-patch.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE `m_loan` - ADD COLUMN `loan_officer_id` BIGINT(20) NULL AFTER `fund_id`, - ADD CONSTRAINT `FK_m_loan_m_staff` FOREIGN KEY (`loan_officer_id`) REFERENCES `m_staff` (`id`); \ No newline at end of file diff --git a/mifosng-db/patchesPutOnDemoServer20120911/patch-0007-m_staff-patch.sql b/mifosng-db/patchesPutOnDemoServer20120911/patch-0007-m_staff-patch.sql deleted file mode 100644 index 4c233a6b1..000000000 --- a/mifosng-db/patchesPutOnDemoServer20120911/patch-0007-m_staff-patch.sql +++ /dev/null @@ -1,9 +0,0 @@ -ALTER TABLE `m_staff` - ADD COLUMN `office_id` BIGINT(20) NULL AFTER `id`, - ADD CONSTRAINT `FK_m_staff_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`); - -ALTER TABLE `m_staff` - ADD COLUMN `is_loan_officer` TINYINT(1) NOT NULL DEFAULT 0 AFTER `id`; - -update m_staff set office_id=1; - diff --git a/mifosng-db/patchesPutOnDemoServer20121001/patch-0001-add-deposit_account_id-for-m_note.sql b/mifosng-db/patchesPutOnDemoServer20121001/patch-0001-add-deposit_account_id-for-m_note.sql deleted file mode 100644 index 9dea4bf63..000000000 --- a/mifosng-db/patchesPutOnDemoServer20121001/patch-0001-add-deposit_account_id-for-m_note.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE `m_note` -ADD COLUMN `deposit_account_id` bigint(20) DEFAULT NULL AFTER `loan_transaction_id`, -ADD KEY `FK_m_note_m_deposit_account` (`deposit_account_id`), -ADD CONSTRAINT `FK_m_note_m_deposit_account` FOREIGN KEY (`deposit_account_id`) REFERENCES `m_deposit_account` (`id`); diff --git a/mifosng-db/patchesPutOnDemoServer20121001/patch-0002-heavensfamily-data-patch.sql b/mifosng-db/patchesPutOnDemoServer20121001/patch-0002-heavensfamily-data-patch.sql deleted file mode 100644 index 60a1c7cb7..000000000 --- a/mifosng-db/patchesPutOnDemoServer20121001/patch-0002-heavensfamily-data-patch.sql +++ /dev/null @@ -1,9 +0,0 @@ -UPDATE `mifostenant-heavensfamily`.`m_loan` -SET -`loan_transaction_strategy_id` = 2 -WHERE id > 0; - -UPDATE `mifostenant-heavensfamily`.`m_loan` -SET -`term_frequency` = `repay_every` * `number_of_repayments` -WHERE `term_frequency` = 0; diff --git a/mifosng-db/patchesPutOnDemoServer20121001/patch-0003-add-total-charges-due-at-disbursement-derived-column.sql b/mifosng-db/patchesPutOnDemoServer20121001/patch-0003-add-total-charges-due-at-disbursement-derived-column.sql deleted file mode 100644 index c0c03a1a6..000000000 --- a/mifosng-db/patchesPutOnDemoServer20121001/patch-0003-add-total-charges-due-at-disbursement-derived-column.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `m_loan` -ADD COLUMN `total_charges_due_at_disbursement_derived` bigint(20) DEFAULT NULL AFTER `interest_rebate_amount`; diff --git a/mifosng-db/patchesPutOnDemoServer20121001/patch-0004-add-auto-primary_key_to_m_loan_charge.sql b/mifosng-db/patchesPutOnDemoServer20121001/patch-0004-add-auto-primary_key_to_m_loan_charge.sql deleted file mode 100644 index 8d5a485f0..000000000 --- a/mifosng-db/patchesPutOnDemoServer20121001/patch-0004-add-auto-primary_key_to_m_loan_charge.sql +++ /dev/null @@ -1,13 +0,0 @@ -DROP TABLE `m_loan_charge`; -CREATE TABLE `m_loan_charge` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `loan_id` bigint(20) NOT NULL, - `charge_id` bigint(20) NOT NULL, - `charge_time_enum` smallint(5) NOT NULL, - `charge_calculation_enum` smallint(5) NOT NULL, - `amount` decimal(19,6) NOT NULL, - PRIMARY KEY (`id`), - KEY `charge_id` (`charge_id`), - CONSTRAINT `m_loan_charge_ibfk_1` FOREIGN KEY (`charge_id`) REFERENCES `m_charge` (`id`), - CONSTRAINT `m_loan_charge_ibfk_2` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 diff --git a/mifosng-db/patchesPutOnDemoServer20121001/patch-0005- Mifosx-43-interest payout usecase added columns.sql b/mifosng-db/patchesPutOnDemoServer20121001/patch-0005- Mifosx-43-interest payout usecase added columns.sql deleted file mode 100644 index 307ff9117..000000000 --- a/mifosng-db/patchesPutOnDemoServer20121001/patch-0005- Mifosx-43-interest payout usecase added columns.sql +++ /dev/null @@ -1,13 +0,0 @@ -ALTER TABLE `m_deposit_account_transaction` - ADD COLUMN `interest` decimal(19,6) NOT NULL AFTER `amount`, - ADD COLUMN `total` decimal(19,6) NOT NULL AFTER `interest`; - -ALTER TABLE `m_deposit_account` - ADD COLUMN `interest_paid` decimal(19,6) NOT NULL DEFAULT 0 AFTER `actual_total_amount`, - ADD COLUMN `is_interest_withdrawable` tinyint(1) NOT NULL DEFAULT '0' AFTER `interest_paid`; - -ALTER TABLE `m_product_deposit` - ADD COLUMN `is_compounding_interest_allowed` tinyint(1) NOT NULL DEFAULT '0' AFTER `maturity_max_interest_rate`; - -ALTER TABLE `m_deposit_account` - ADD COLUMN `is_compounding_interest_allowed` tinyint(1) NOT NULL DEFAULT '0' AFTER `actual_total_amount`; \ No newline at end of file diff --git a/mifosng-db/patchesPutOnDemoServer20121001/patch-0005-add-total-charges-due-at-disbursement-derived-column-as-big-decimal.sql b/mifosng-db/patchesPutOnDemoServer20121001/patch-0005-add-total-charges-due-at-disbursement-derived-column-as-big-decimal.sql deleted file mode 100644 index df8533b86..000000000 --- a/mifosng-db/patchesPutOnDemoServer20121001/patch-0005-add-total-charges-due-at-disbursement-derived-column-as-big-decimal.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE `m_loan` -DROP COLUMN `total_charges_due_at_disbursement_derived`, -ADD COLUMN `total_charges_due_at_disbursement_derived` decimal(19,6) DEFAULT NULL AFTER `interest_rebate_amount`; diff --git a/mifosng-db/patchesPutOnDemoServer20121001/patch-0006-recreate-x_registered_table.sql b/mifosng-db/patchesPutOnDemoServer20121001/patch-0006-recreate-x_registered_table.sql deleted file mode 100644 index 5c31fe883..000000000 --- a/mifosng-db/patchesPutOnDemoServer20121001/patch-0006-recreate-x_registered_table.sql +++ /dev/null @@ -1,7 +0,0 @@ -DROP TABLE IF EXISTS `x_registered_table`; -/* used to link MySql tables to Mifos X application tables for additional data needs */ -CREATE TABLE `x_registered_table` ( - `registered_table_name` varchar(50) NOT NULL, - `application_table_name` varchar(50) NOT NULL, - PRIMARY KEY (`registered_table_name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/mifosng-db/patchesPutOnDemoServer20121001/patch-0007-add_charges_component_to_loan_transaction.sql b/mifosng-db/patchesPutOnDemoServer20121001/patch-0007-add_charges_component_to_loan_transaction.sql deleted file mode 100644 index c876dcf22..000000000 --- a/mifosng-db/patchesPutOnDemoServer20121001/patch-0007-add_charges_component_to_loan_transaction.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `m_loan_transaction` -ADD COLUMN `charges_portion_derived` decimal(19,6) DEFAULT NULL AFTER `interest_waived_derived`; diff --git a/mifosng-db/patchesPutOnDemoServer20121001/patch-0008-add_office_to_group.sql b/mifosng-db/patchesPutOnDemoServer20121001/patch-0008-add_office_to_group.sql deleted file mode 100644 index 9899e2d2f..000000000 --- a/mifosng-db/patchesPutOnDemoServer20121001/patch-0008-add_office_to_group.sql +++ /dev/null @@ -1,3 +0,0 @@ -alter table m_group add column office_id bigint(20) NOT NULL AFTER id; -update m_group set office_id = 1 WHERE office_id = 0; -alter table m_group add constraint foreign key (`office_id`) references `m_office` (`id`); diff --git a/mifosng-db/patchesPutOnDemoServer20121001/patch-0009-add_extra_columns_to_loan_charges_to_facilitate_percentage_charge.sql b/mifosng-db/patchesPutOnDemoServer20121001/patch-0009-add_extra_columns_to_loan_charges_to_facilitate_percentage_charge.sql deleted file mode 100644 index 6f752130f..000000000 --- a/mifosng-db/patchesPutOnDemoServer20121001/patch-0009-add_extra_columns_to_loan_charges_to_facilitate_percentage_charge.sql +++ /dev/null @@ -1,10 +0,0 @@ -ALTER TABLE `m_loan_charge` -ADD COLUMN `calculation_percentage` decimal(19,6) DEFAULT NULL AFTER `charge_calculation_enum`; -ALTER TABLE `m_loan_charge` -ADD COLUMN `calculation_on_amount` decimal(19,6) DEFAULT NULL AFTER `calculation_percentage`; -ALTER TABLE `m_loan_charge` -ADD COLUMN `amount_paid_derived` decimal(19,6) DEFAULT NULL AFTER `amount`; -ALTER TABLE `m_loan_charge` -ADD COLUMN `amount_outstanding_derived` decimal(19,6) NOT NULL default 0 AFTER `amount_paid_derived`; -ALTER TABLE `m_loan_charge` -ADD COLUMN `is_paid_derived` tinyint(1) NOT NULL default 0 AFTER `amount_outstanding_derived`; \ No newline at end of file diff --git a/mifosng-db/patches/00003-drop-recreate-client-indentifier-table.sql b/mifosng-db/patchesPutOnDemoServer20121125/00003-drop-recreate-client-indentifier-table.sql similarity index 100% rename from mifosng-db/patches/00003-drop-recreate-client-indentifier-table.sql rename to mifosng-db/patchesPutOnDemoServer20121125/00003-drop-recreate-client-indentifier-table.sql diff --git a/mifosng-db/patches/00004_gkonly_risk_analysis.sql b/mifosng-db/patchesPutOnDemoServer20121125/00004_gkonly_risk_analysis.sql similarity index 100% rename from mifosng-db/patches/00004_gkonly_risk_analysis.sql rename to mifosng-db/patchesPutOnDemoServer20121125/00004_gkonly_risk_analysis.sql diff --git a/mifosng-db/patches/00005_client_image_location.sql b/mifosng-db/patchesPutOnDemoServer20121125/00005_client_image_location.sql similarity index 100% rename from mifosng-db/patches/00005_client_image_location.sql rename to mifosng-db/patchesPutOnDemoServer20121125/00005_client_image_location.sql diff --git a/mifosng-db/patches/patch-0005-charge-due-on-specified-date.sql b/mifosng-db/patchesPutOnDemoServer20121125/patch-0005-charge-due-on-specified-date.sql similarity index 100% rename from mifosng-db/patches/patch-0005-charge-due-on-specified-date.sql rename to mifosng-db/patchesPutOnDemoServer20121125/patch-0005-charge-due-on-specified-date.sql diff --git a/mifosng-db/patches/patch-0006-repayment-schedule-changes.sql b/mifosng-db/patchesPutOnDemoServer20121125/patch-0006-repayment-schedule-changes.sql similarity index 100% rename from mifosng-db/patches/patch-0006-repayment-schedule-changes.sql rename to mifosng-db/patchesPutOnDemoServer20121125/patch-0006-repayment-schedule-changes.sql diff --git a/mifosng-db/patches/patch-0007-loan-transaction-changes.sql b/mifosng-db/patchesPutOnDemoServer20121125/patch-0007-loan-transaction-changes.sql similarity index 100% rename from mifosng-db/patches/patch-0007-loan-transaction-changes.sql rename to mifosng-db/patchesPutOnDemoServer20121125/patch-0007-loan-transaction-changes.sql diff --git a/mifosng-db/patches/patch-0008-saving_product_creation.sql b/mifosng-db/patchesPutOnDemoServer20121125/patch-0008-saving_product_creation.sql similarity index 100% rename from mifosng-db/patches/patch-0008-saving_product_creation.sql rename to mifosng-db/patchesPutOnDemoServer20121125/patch-0008-saving_product_creation.sql diff --git a/mifosng-db/patches/patch-0009-saving_account_creation.sql b/mifosng-db/patchesPutOnDemoServer20121125/patch-0009-saving_account_creation.sql similarity index 100% rename from mifosng-db/patches/patch-0009-saving_account_creation.sql rename to mifosng-db/patchesPutOnDemoServer20121125/patch-0009-saving_account_creation.sql diff --git a/mifosng-db/patches/patch-0010-accounting-chart-of-accounts.sql b/mifosng-db/patchesPutOnDemoServer20121125/patch-0010-accounting-chart-of-accounts.sql similarity index 100% rename from mifosng-db/patches/patch-0010-accounting-chart-of-accounts.sql rename to mifosng-db/patchesPutOnDemoServer20121125/patch-0010-accounting-chart-of-accounts.sql diff --git a/mifosng-db/patches/patch-0011-loancharges-waive-and-writeoff-support.sql b/mifosng-db/patchesPutOnDemoServer20121125/patch-0011-loancharges-waive-and-writeoff-support.sql similarity index 100% rename from mifosng-db/patches/patch-0011-loancharges-waive-and-writeoff-support.sql rename to mifosng-db/patchesPutOnDemoServer20121125/patch-0011-loancharges-waive-and-writeoff-support.sql diff --git a/mifosng-db/patches/patch-0012-loan_officer_reassignment_history.sql b/mifosng-db/patchesPutOnDemoServer20121125/patch-0012-loan_officer_reassignment_history.sql similarity index 100% rename from mifosng-db/patches/patch-0012-loan_officer_reassignment_history.sql rename to mifosng-db/patchesPutOnDemoServer20121125/patch-0012-loan_officer_reassignment_history.sql diff --git a/mifosng-db/patches/patch-0013-MIFOSX-109-Guarantors.sql b/mifosng-db/patchesPutOnDemoServer20121125/patch-0013-MIFOSX-109-Guarantors.sql similarity index 100% rename from mifosng-db/patches/patch-0013-MIFOSX-109-Guarantors.sql rename to mifosng-db/patchesPutOnDemoServer20121125/patch-0013-MIFOSX-109-Guarantors.sql diff --git a/mifosng-db/patches/patch-0013-maker-checker.sql b/mifosng-db/patchesPutOnDemoServer20121125/patch-0013-maker-checker.sql similarity index 100% rename from mifosng-db/patches/patch-0013-maker-checker.sql rename to mifosng-db/patchesPutOnDemoServer20121125/patch-0013-maker-checker.sql diff --git a/mifosng-db/patches/patch-0014-command-event-source-table.sql b/mifosng-db/patchesPutOnDemoServer20121125/patch-0014-command-event-source-table.sql similarity index 100% rename from mifosng-db/patches/patch-0014-command-event-source-table.sql rename to mifosng-db/patchesPutOnDemoServer20121125/patch-0014-command-event-source-table.sql diff --git a/mifosng-db/patches/patch-0015-MIFOSX-126a-Rename_any_Report_and_Datatable_permissions.sql b/mifosng-db/patchesPutOnDemoServer20121125/patch-0015-MIFOSX-126a-Rename_any_Report_and_Datatable_permissions.sql similarity index 100% rename from mifosng-db/patches/patch-0015-MIFOSX-126a-Rename_any_Report_and_Datatable_permissions.sql rename to mifosng-db/patchesPutOnDemoServer20121125/patch-0015-MIFOSX-126a-Rename_any_Report_and_Datatable_permissions.sql diff --git a/mifosng-db/patches/patch-0015-MIFOSX-126b-UpdateReportListingParameters.sql b/mifosng-db/patchesPutOnDemoServer20121125/patch-0015-MIFOSX-126b-UpdateReportListingParameters.sql similarity index 100% rename from mifosng-db/patches/patch-0015-MIFOSX-126b-UpdateReportListingParameters.sql rename to mifosng-db/patchesPutOnDemoServer20121125/patch-0015-MIFOSX-126b-UpdateReportListingParameters.sql diff --git a/mifosng-db/patches/patch-0015-MIFOSX-126c-Update_m_permission_ddl.sql b/mifosng-db/patchesPutOnDemoServer20121125/patch-0015-MIFOSX-126c-Update_m_permission_ddl.sql similarity index 100% rename from mifosng-db/patches/patch-0015-MIFOSX-126c-Update_m_permission_ddl.sql rename to mifosng-db/patchesPutOnDemoServer20121125/patch-0015-MIFOSX-126c-Update_m_permission_ddl.sql diff --git a/mifosng-db/patches/patch-0016-Mifosx-126-PermissionsOverhaulDDL.sql b/mifosng-db/patchesPutOnDemoServer20121125/patch-0016-Mifosx-126-PermissionsOverhaulDDL.sql similarity index 100% rename from mifosng-db/patches/patch-0016-Mifosx-126-PermissionsOverhaulDDL.sql rename to mifosng-db/patchesPutOnDemoServer20121125/patch-0016-Mifosx-126-PermissionsOverhaulDDL.sql diff --git a/mifosng-db/patches/patch-0017-add-system-defined-flag-to-code-table.sql b/mifosng-db/patchesPutOnDemoServer20121125/patch-0017-add-system-defined-flag-to-code-table.sql similarity index 100% rename from mifosng-db/patches/patch-0017-add-system-defined-flag-to-code-table.sql rename to mifosng-db/patchesPutOnDemoServer20121125/patch-0017-add-system-defined-flag-to-code-table.sql diff --git a/mifosng-db/patches/patch-0018-alter-json-column.sql b/mifosng-db/patchesPutOnDemoServer20121125/patch-0018-alter-json-column.sql similarity index 100% rename from mifosng-db/patches/patch-0018-alter-json-column.sql rename to mifosng-db/patchesPutOnDemoServer20121125/patch-0018-alter-json-column.sql diff --git a/mifosng-db/patches/patch-0019-add-maker-checker-flag-to-permissions.sql b/mifosng-db/patchesPutOnDemoServer20121125/patch-0019-add-maker-checker-flag-to-permissions.sql similarity index 100% rename from mifosng-db/patches/patch-0019-add-maker-checker-flag-to-permissions.sql rename to mifosng-db/patchesPutOnDemoServer20121125/patch-0019-add-maker-checker-flag-to-permissions.sql