FINERACT-807
change mifosplatform-tenants and mifostenant-default to fineract_tenants and fineract_default respectively closes https://issues.apache.org/jira/projects/FINERACT/issues/FINERACT-807?filter=allopenissues
This commit is contained in:
committed by
Michael Vorburger ⛑️
parent
51f23613ad
commit
a7ebef4781
+1
-1
@@ -47,7 +47,7 @@ public class DataSourceProperties extends PoolProperties {
|
||||
@Value("${" + HOST + ":localhost}")
|
||||
private volatile @NotNull String hostname;
|
||||
|
||||
@Value("${" + DB + ":mifosplatform-tenants}")
|
||||
@Value("${" + DB + ":fineract_tenants}")
|
||||
private volatile @NotNull String dbName;
|
||||
|
||||
@Value("${" + UID + ":root}")
|
||||
|
||||
+2
-2
@@ -38,13 +38,13 @@ public class MariaDB4jSetupService {
|
||||
@PostConstruct
|
||||
protected void setUpDBs() throws ManagedProcessException {
|
||||
db.createDB(getTenantDBName());
|
||||
db.createDB("mifostenant-default");
|
||||
db.createDB("fineract_default");
|
||||
// Note that we don't need to initialize the DBs, because
|
||||
// the TenantDatabaseUpgradeService will do this in just a moment.
|
||||
}
|
||||
|
||||
public String getTenantDBName() {
|
||||
return "mifosplatform-tenants";
|
||||
return "fineract_tenants";
|
||||
}
|
||||
|
||||
@PreDestroy
|
||||
|
||||
+5
-5
@@ -29,13 +29,13 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* Service which "fixes up" the schemaServerPort in the tenants table of the
|
||||
* mifosplatform-tenants schema. It sets it to the actual current port of
|
||||
* fineract_tenants schema. It sets it to the actual current port of
|
||||
* MariaDB4j, instead of the default 3306 which is hard-coded in the initial
|
||||
* set-up SQL script (V1__mifos-platform-shared-tenants.sql).
|
||||
*
|
||||
* This service is called by the TenantDatabaseUpgradeService
|
||||
* "just at the right time" during start-up, that is AFTER the initialization of
|
||||
* the mifosplatform-tenants but BEFORE Flyway runs on all tenant schemas.
|
||||
* the fineract_tenants but BEFORE Flyway runs on all tenant schemas.
|
||||
*
|
||||
* It's difficult to achieve the same goal elsewhere, because we cannot do this
|
||||
* e.g. in MariaDB4jSetupService, as that's too early
|
||||
@@ -72,12 +72,12 @@ public class TenantDataSourcePortFixService {
|
||||
|
||||
public void fixUpTenantsSchemaServerPort() {
|
||||
if (!enabled) {
|
||||
logger.info("No schema_server_port UPDATE made to tenant_server_connections table of the mifosplatform-tenants schema, because " + ENABLED + " = false");
|
||||
logger.info("No schema_server_port UPDATE made to tenant_server_connections table of the fineract_tenants schema, because " + ENABLED + " = false");
|
||||
return;
|
||||
}
|
||||
if (dsp == null) {
|
||||
// we don't have any generic mechanism to know the DB port, given just a tenant DataSource
|
||||
logger.debug("No schema_server_port UPDATE made to tenant_server_connections table of the mifosplatform-tenants schema (because neither MariaDB4j nor our own Spring Boot DataSourceConfiguration is used in a traditional WAR)");
|
||||
logger.debug("No schema_server_port UPDATE made to tenant_server_connections table of the fineract_tenants schema (because neither MariaDB4j nor our own Spring Boot DataSourceConfiguration is used in a traditional WAR)");
|
||||
return;
|
||||
}
|
||||
int r = jdbcTemplate
|
||||
@@ -88,7 +88,7 @@ public class TenantDataSourcePortFixService {
|
||||
else
|
||||
logger.info("Upated "
|
||||
+ r
|
||||
+ " rows in the tenant_server_connections table of the mifosplatform-tenants schema to the real current host: "
|
||||
+ " rows in the tenant_server_connections table of the fineract_tenants schema to the real current host: "
|
||||
+ dsp.getHost() + ", port: " + dsp.getPort());
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,6 @@
|
||||
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd">
|
||||
|
||||
<!-- name here must match TestDataSourceConfiguration -->
|
||||
<jee:jndi-lookup jndi-name="java:comp/env/jdbc/mifosplatform-tenants"
|
||||
<jee:jndi-lookup jndi-name="java:comp/env/jdbc/fineract_tenants"
|
||||
id="tenantDataSourceJndi" />
|
||||
</beans>
|
||||
|
||||
+2
-2
@@ -19,7 +19,7 @@
|
||||
|
||||
-- MySQL dump 10.13 Distrib 5.1.60, for Win32 (ia32)
|
||||
--
|
||||
-- Host: localhost Database: mifosplatform-tenants
|
||||
-- Host: localhost Database: fineract_tenants
|
||||
-- ------------------------------------------------------
|
||||
-- Server version 5.1.60-community
|
||||
|
||||
@@ -66,7 +66,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,'${fineract_default_tenantdb_hostname}','${fineract_default_tenantdb_port}','${fineract_default_tenantdb_uid}','${fineract_default_tenantdb_pwd}',1);
|
||||
INSERT INTO `tenants` VALUES (1,'default','Default Demo Tenant','fineract_default','Asia/Kolkata',NULL,NULL,NULL,NULL,'${fineract_default_tenantdb_hostname}','${fineract_default_tenantdb_port}','${fineract_default_tenantdb_uid}','${fineract_default_tenantdb_pwd}',1);
|
||||
-- Add tenants to support interoperation multi-tenancy
|
||||
-- INSERT INTO `tenants` VALUES (2,'tn01','Buffalo','tn01','Africa/Bujumbura',NULL,NULL,NULL,NULL,'localhost','3306','root','mysql',1);
|
||||
-- INSERT INTO `tenants` VALUES (3,'tn02','Lion','tn02','Africa/Bujumbura',NULL,NULL,NULL,NULL,'localhost','3306','root','mysql',1);
|
||||
|
||||
+372
-372
File diff suppressed because it is too large
Load Diff
@@ -22,6 +22,6 @@
|
||||
|
||||
|
||||
<Context>
|
||||
<ResourceLink name="jdbc/mifosplatform-tenants" global="jdbc/mifosplatform-tenants"
|
||||
<ResourceLink name="jdbc/fineract_tenants" global="jdbc/fineract_tenants"
|
||||
type="javax.sql.DataSource" />
|
||||
</Context>
|
||||
@@ -22,8 +22,8 @@
|
||||
|
||||
|
||||
<Context>
|
||||
<Resource type="javax.sql.DataSource" name="jdbc/mifosplatform-tenants"
|
||||
driverClassName="org.drizzle.jdbc.DrizzleDriver" url="jdbc:mysql:thin://localhost:3306/mifosplatform-tenants"
|
||||
<Resource type="javax.sql.DataSource" name="jdbc/fineract_tenants"
|
||||
driverClassName="org.drizzle.jdbc.DrizzleDriver" url="jdbc:mysql:thin://localhost:3306/fineract_tenants"
|
||||
username="root" password="mysql" validationQuery="select 1" maxActive="10"
|
||||
maxIdle="4" />
|
||||
</Context>
|
||||
Reference in New Issue
Block a user