Fix for setting attributes in cloud sites on startup 64/97564/1
authorAndrewLamb <andrew.a.lamb@est.tech>
Wed, 23 Oct 2019 11:31:27 +0000 (12:31 +0100)
committerAndrew Lamb <andrew.a.lamb@est.tech>
Thu, 24 Oct 2019 16:39:14 +0000 (16:39 +0000)
Change-Id: Id766ffd28e75d9d8465a3c04b74b540d08a17b4f
Issue-ID: SO-2474
Signed-off-by: AndrewLamb <andrew.a.lamb@est.tech>
adapters/mso-catalog-db-adapter/src/main/java/db/migration/R__CloudConfigMigration.java

index 354c3d0..691ae60 100644 (file)
@@ -128,8 +128,8 @@ public class R__CloudConfigMigration implements JdbcMigration, MigrationInfoProv
     private void migrateCloudIdentity(Collection<CloudIdentity> entities, Connection connection) throws SQLException {
         logger.debug("Starting migration for CloudConfig-->IdentityService");
         String insert =
-                "INSERT INTO `identity_services` (`ID`, `IDENTITY_URL`, `MSO_ID`, `MSO_PASS`, `ADMIN_TENANT`, `MEMBER_ROLE`, `TENANT_METADATA`, `IDENTITY_SERVER_TYPE`, `IDENTITY_AUTHENTICATION_TYPE`, `LAST_UPDATED_BY`) "
-                        + "VALUES (?,?,?,?,?,?,?,?,?,?);";
+                "INSERT INTO `identity_services` (`ID`, `IDENTITY_URL`, `MSO_ID`, `MSO_PASS`, `ADMIN_TENANT`, `MEMBER_ROLE`, `TENANT_METADATA`, `IDENTITY_SERVER_TYPE`, `IDENTITY_AUTHENTICATION_TYPE`, `LAST_UPDATED_BY`, `PROJECT_DOMAIN_NAME`, `USER_DOMAIN_NAME`) "
+                        + "VALUES (?,?,?,?,?,?,?,?,?,?,?,?);";
 
         try (Statement stmt = connection.createStatement();
                 PreparedStatement ps = connection.prepareStatement(insert)) {
@@ -157,6 +157,8 @@ public class R__CloudConfigMigration implements JdbcMigration, MigrationInfoProv
                                         ? cloudIdentity.getIdentityAuthenticationType().name()
                                         : null);
                         ps.setString(10, FLYWAY);
+                        ps.setString(11, cloudIdentity.getProjectDomainName());
+                        ps.setString(12, cloudIdentity.getUserDomainName());
                         ps.executeUpdate();
                     }
                 }