diff --git a/mifosng-db/migrations/core_db/V12__add_external_id_to_couple_of_tables.sql b/mifosng-db/migrations/core_db/V12__add_external_id_to_couple_of_tables.sql new file mode 100644 index 000000000..964070d58 --- /dev/null +++ b/mifosng-db/migrations/core_db/V12__add_external_id_to_couple_of_tables.sql @@ -0,0 +1,28 @@ + +ALTER TABLE m_group + ADD UNIQUE INDEX `external_id_UNIQUE` (`external_id` ASC) ; + +ALTER TABLE m_product_loan + ADD COLUMN `external_id` VARCHAR(100) NULL AFTER `loan_transaction_strategy_id` , + ADD UNIQUE INDEX `external_id_UNIQUE` (`external_id` ASC) ; + +ALTER TABLE m_staff + ADD COLUMN `external_id` VARCHAR(100) NULL AFTER `display_name` , + ADD UNIQUE INDEX `external_id_UNIQUE` (`external_id` ASC) ; + + +/* status_id values for client and group +0 - Invalid +100 - Pending +300 - Active +600 - Closed( or Exited) +*/ + +ALTER TABLE m_client + ADD COLUMN `status_id` INT(5) NOT NULL DEFAULT 300 AFTER `is_deleted` ; + + +ALTER TABLE m_group + ADD COLUMN `status_id` INT(5) NOT NULL DEFAULT 300 AFTER `is_deleted` ; + + diff --git a/mifosng-db/migrations/core_db/V13__add_group_and_client_pending_configuration.sql b/mifosng-db/migrations/core_db/V13__add_group_and_client_pending_configuration.sql new file mode 100644 index 000000000..e093e89ea --- /dev/null +++ b/mifosng-db/migrations/core_db/V13__add_group_and_client_pending_configuration.sql @@ -0,0 +1,19 @@ + + +/* +default client and group status is active 300. If you want to be able to have pending as the initial client stat +*/ +INSERT INTO c_configuration (`name`, `enabled`) VALUES ('allow-pending-client-status', '0'); +INSERT INTO c_configuration (`name`, `enabled`) VALUES ('allow-pending-group-status', '0'); + + +INSERT INTO .`r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`) + VALUES ('status_id', '0', 'Invalid', 'Invalid'); +INSERT INTO .`r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`) + VALUES ('status_id', '100', 'Pending', 'Pending'); +INSERT INTO .`r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`) + VALUES ('status_id', '300', 'Active', 'Active'); +INSERT INTO .`r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`) + VALUES ('status_id', '600', 'Closed', 'Closed'); +INSERT INTO .`r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`) + VALUES ('loan_status_id', '0', 'Invalid', 'Invalid'); \ No newline at end of file