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
+2
-2
@@ -37,6 +37,6 @@ tasks:
|
||||
# NB MySQL on GitPod.io is currently quite slow.
|
||||
# similar to .travis.yml, but using authentication_string= instead of password= due to mysql major version difference
|
||||
mysql -e "USE mysql;\nUPDATE user SET authentication_string=PASSWORD('mysql') WHERE user='root';\nFLUSH PRIVILEGES;\n"
|
||||
./gradlew createDB -PdbName=mifosplatform-tenants
|
||||
./gradlew createDB -PdbName=mifostenant-default
|
||||
./gradlew createDB -PdbName=fineract_tenants
|
||||
./gradlew createDB -PdbName=fineract_default
|
||||
./gradlew build -x test
|
||||
|
||||
+2
-2
@@ -36,8 +36,8 @@ addons:
|
||||
|
||||
before_install:
|
||||
- echo "USE mysql;\nUPDATE user SET password=PASSWORD('mysql') WHERE user='root';\nFLUSH PRIVILEGES;\n" | mysql -u root
|
||||
- mysql -u root -pmysql -e 'CREATE DATABASE IF NOT EXISTS `mifosplatform-tenants`;'
|
||||
- mysql -u root -pmysql -e 'CREATE DATABASE IF NOT EXISTS `mifostenant-default`;'
|
||||
- mysql -u root -pmysql -e 'CREATE DATABASE IF NOT EXISTS `fineract_tenants`;'
|
||||
- mysql -u root -pmysql -e 'CREATE DATABASE IF NOT EXISTS `fineract_default`;'
|
||||
# Hardcoding the time zone is a temporary fix for https://issues.apache.org/jira/browse/FINERACT-723
|
||||
- export TZ=Asia/Kolkata
|
||||
|
||||
|
||||
+1
-1
@@ -51,6 +51,6 @@ COPY ./docker/server.xml /opt/bitnami/tomcat/conf
|
||||
RUN chmod 664 /opt/bitnami/tomcat/conf/server.xml
|
||||
|
||||
WORKDIR /opt/bitnami/tomcat/lib
|
||||
# org.drizzle.jdbc.DrizzleDriver is used in docker/server.xml for jdbc/mifosplatform-tenants DataSource
|
||||
# org.drizzle.jdbc.DrizzleDriver is used in docker/server.xml for jdbc/fineract_tenants DataSource
|
||||
# (But note that connections to individual tenant DBs may use another driver...)
|
||||
RUN wget https://repo1.maven.org/maven2/org/drizzle/jdbc/drizzle-jdbc/1.4/drizzle-jdbc-1.4.jar
|
||||
|
||||
@@ -36,8 +36,8 @@ Instructions how to run for local development
|
||||
============
|
||||
|
||||
Run the following commands:
|
||||
1. `./gradlew createDB -PdbName=mifosplatform-tenants`
|
||||
1. `./gradlew createDB -PdbName=mifostenant-default`
|
||||
1. `./gradlew createDB -PdbName=fineract_tenants`
|
||||
1. `./gradlew createDB -PdbName=fineract_default`
|
||||
1. `./gradlew tomcatRunWAR`
|
||||
|
||||
|
||||
@@ -71,8 +71,8 @@ Instructions to execute Integration tests
|
||||
> Note that if this is the first time to access MySQL DB, then you may need to reset your password.
|
||||
|
||||
Run the following commands, very similarly to how [.travis.yml](.travis.yml) does:
|
||||
1. `./gradlew createDB -PdbName=mifosplatform-tenants`
|
||||
1. `./gradlew createDB -PdbName=mifostenant-default`
|
||||
1. `./gradlew createDB -PdbName=fineract_tenants`
|
||||
1. `./gradlew createDB -PdbName=fineract_default`
|
||||
1. `./gradlew clean integrationTest`
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ services:
|
||||
depends_on:
|
||||
- fineractmysql
|
||||
environment:
|
||||
- JAVA_OPTS=-Dfineract_tenants_url=jdbc:mysql:thin://fineractmysql:3306/mifosplatform-tenants -Dfineract_tenants_driver=org.drizzle.jdbc.DrizzleDriver -Dfineract_tenants_uid=root -Dfineract_tenants_pwd=skdcnwauicn2ucnaecasdsajdnizucawencascdca -Djava.awt.headless=true -XX:+UseG1GC -Dfile.encoding=UTF-8
|
||||
- JAVA_OPTS=-Dfineract_tenants_url=jdbc:mysql:thin://fineractmysql:3306/fineract_tenants -Dfineract_tenants_driver=org.drizzle.jdbc.DrizzleDriver -Dfineract_tenants_uid=root -Dfineract_tenants_pwd=skdcnwauicn2ucnaecasdsajdnizucawencascdca -Djava.awt.headless=true -XX:+UseG1GC -Dfile.encoding=UTF-8
|
||||
- FINERACT_DEFAULT_TENANTDB_HOSTNAME=fineractmysql
|
||||
- FINERACT_DEFAULT_TENANTDB_PORT=3306
|
||||
- FINERACT_DEFAULT_TENANTDB_UID=root
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@
|
||||
UserDatabaseRealm to authenticate users
|
||||
-->
|
||||
<Resource type="javax.sql.DataSource"
|
||||
name="jdbc/mifosplatform-tenants"
|
||||
name="jdbc/fineract_tenants"
|
||||
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
|
||||
driverClassName="${fineract_tenants_driver}"
|
||||
url="${fineract_tenants_url}"
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
--
|
||||
|
||||
# create databases
|
||||
CREATE DATABASE IF NOT EXISTS `mifosplatform-tenants`;
|
||||
CREATE DATABASE IF NOT EXISTS `mifostenant-default`;
|
||||
CREATE DATABASE IF NOT EXISTS `fineract_tenants`;
|
||||
CREATE DATABASE IF NOT EXISTS `fineract_default`;
|
||||
|
||||
# create root user and grant rights
|
||||
GRANT ALL ON *.* TO 'root'@'%';
|
||||
@@ -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
|
||||
|
||||
@@ -117,7 +117,7 @@ CREATE TABLE `tenants` (
|
||||
LOCK TABLES `tenants` WRITE;
|
||||
/*!40000 ALTER TABLE `tenants` DISABLE KEYS */;
|
||||
INSERT INTO `tenants` VALUES
|
||||
(1,'default','default','mifostenant-default','Asia/Kolkata',NULL,NULL,NULL,NULL,'localhost','3306','root','mysql',1,5,30000,1,60,1,50,1,40,20,10,60,34000,60000);
|
||||
(1,'default','default','fineract_default','Asia/Kolkata',NULL,NULL,NULL,NULL,'localhost','3306','root','mysql',1,5,30000,1,60,1,50,1,40,20,10,60,34000,60000);
|
||||
/*!40000 ALTER TABLE `tenants` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
|
||||
@@ -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,'localhost','3306','root','mysql',1);
|
||||
INSERT INTO `tenants` VALUES (1,'default','Default Demo Tenant','fineract_default','Asia/Kolkata',NULL,NULL,NULL,NULL,'localhost','3306','root','mysql',1);
|
||||
/*!40000 ALTER TABLE `tenants` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
-- MySQL dump 10.13 Distrib 5.1.60, for Win32 (ia32)
|
||||
--
|
||||
-- Host: localhost Database: mifostenant-default
|
||||
-- Host: localhost Database: fineract_default
|
||||
-- ------------------------------------------------------
|
||||
-- Server version 5.1.60-community
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
-- MySQL dump 10.13 Distrib 5.1.60, for Win32 (ia32)
|
||||
--
|
||||
-- Host: localhost Database: mifostenant-default
|
||||
-- Host: localhost Database: fineract_default
|
||||
-- ------------------------------------------------------
|
||||
-- Server version 5.1.60-community
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
-- MySQL dump 10.13 Distrib 5.1.60, for Win32 (ia32)
|
||||
--
|
||||
-- Host: localhost Database: mifostenant-default
|
||||
-- Host: localhost Database: fineract_default
|
||||
-- ------------------------------------------------------
|
||||
-- Server version 5.1.60-community
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
-- MySQL dump 10.13 Distrib 5.1.60, for Win32 (ia32)
|
||||
--
|
||||
-- Host: localhost Database: mifostenant-default
|
||||
-- Host: localhost Database: fineract_default
|
||||
-- ------------------------------------------------------
|
||||
-- Server version 5.1.60-community
|
||||
|
||||
|
||||
@@ -495,8 +495,8 @@ task dropDB {
|
||||
task setBlankPassword {
|
||||
doLast {
|
||||
def sql = Sql.newInstance( 'jdbc:mysql:thin://localhost:3306/', mysqlUser, mysqlPassword, 'org.drizzle.jdbc.DrizzleDriver' )
|
||||
sql.execute('USE `mifosplatform-tenants`')
|
||||
sql.execute('UPDATE mifosplatform-tenants.tenants SET schema_server = \'localhost\', schema_server_port = \'3306\', schema_username = \'mifos\', schema_password = \'mysql\' WHERE id=1;')
|
||||
sql.execute('USE `fineract_tenants`')
|
||||
sql.execute('UPDATE fineract_tenants.tenants SET schema_server = \'localhost\', schema_server_port = \'3306\', schema_username = \'mifos\', schema_password = \'mysql\' WHERE id=1;')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+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