diff --git a/mifosng-db/multi-tenant-demo-backups/0001-mifos-platform-shared-tenants.sql b/mifosng-db/multi-tenant-demo-backups/0001-mifos-platform-shared-tenants.sql index e4d2afdb0..922e3f343 100644 --- a/mifosng-db/multi-tenant-demo-backups/0001-mifos-platform-shared-tenants.sql +++ b/mifosng-db/multi-tenant-demo-backups/0001-mifos-platform-shared-tenants.sql @@ -38,7 +38,7 @@ CREATE TABLE `tenants` ( `schema_password` varchar(100) NOT NULL DEFAULT 'mysql', `auto_update` tinyint(1) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -47,8 +47,7 @@ CREATE TABLE `tenants` ( LOCK TABLES `tenants` WRITE; /*!40000 ALTER TABLE `tenants` DISABLE KEYS */; -INSERT INTO `tenants` VALUES -(1,'default','Default Demo Tenant','mifostenant-default','Asia/Kolkata',NULL,NULL,NULL,NULL,'localhost','3306','root','mysql'); +INSERT INTO `tenants` VALUES (1,'default','Default Demo Tenant','mifostenant-default','Asia/Kolkata',NULL,NULL,NULL,NULL,'localhost','3306','root','mysql',1); /*!40000 ALTER TABLE `tenants` ENABLE KEYS */; UNLOCK TABLES; @@ -87,4 +86,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2013-03-04 16:05:03 +-- Dump completed on 2013-04-03 18:11:34 diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/service/ITenantUpgradeService.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/service/ITenantUpgradeService.java deleted file mode 100755 index 6b186e3bf..000000000 --- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/service/ITenantUpgradeService.java +++ /dev/null @@ -1,13 +0,0 @@ -/** - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - */ -package org.mifosplatform.infrastructure.core.service; - - -public interface ITenantUpgradeService { - - void upgradeAllTenants(); - -} diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/service/TenantUpgradeService.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/service/TenantDatabaseUpgradeService.java old mode 100755 new mode 100644 similarity index 82% rename from mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/service/TenantUpgradeService.java rename to mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/service/TenantDatabaseUpgradeService.java index 4ee3ab336..6730b8f1e --- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/service/TenantUpgradeService.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/core/service/TenantDatabaseUpgradeService.java @@ -17,20 +17,19 @@ import org.springframework.stereotype.Service; import com.googlecode.flyway.core.Flyway; /** - * A JDBC implementation of {@link TenantDetailsService} for loading a tenants - * details by a tenantIdentifier. + * A service that picks up on tenants that are configured to auto-update their + * specific schema on application startup. */ @Service -public class TenantUpgradeService implements ITenantUpgradeService { +public class TenantDatabaseUpgradeService { private final TenantDetailsService tenantDetailsService; @Autowired - public TenantUpgradeService(TenantDetailsService detailsService) { + public TenantDatabaseUpgradeService(final TenantDetailsService detailsService) { this.tenantDetailsService = detailsService; } - @Override @PostConstruct public void upgradeAllTenants() { List tenants = tenantDetailsService.findAllTenants();