From cb8bc87bf7833cd8da6136e432f8e80a0f8c1af8 Mon Sep 17 00:00:00 2001 From: Keith Woodlock Date: Sun, 10 Feb 2013 20:29:01 +0000 Subject: [PATCH] update patch on tenants --- mifosng-db/patches/05a-modify_tenant_timezoneid.sql | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mifosng-db/patches/05a-modify_tenant_timezoneid.sql b/mifosng-db/patches/05a-modify_tenant_timezoneid.sql index 9bcac6e8f..e04b4945e 100644 --- a/mifosng-db/patches/05a-modify_tenant_timezoneid.sql +++ b/mifosng-db/patches/05a-modify_tenant_timezoneid.sql @@ -1,2 +1,7 @@ -ALTER TABLE tenants MODIFY timezone_id VARCHAR(100) not null; -- timezone are refferd witn names rather than numerics -UPDATE `tenants` SET `timezone_id`='Asia/Kolkata' WHERE `id`=1 LIMIT 1; -- setting Indian time zone \ No newline at end of file +-- 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; \ No newline at end of file