]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-9136 rename to DefaultOrganizationUuidProvider 1932/head
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Thu, 27 Apr 2017 07:19:39 +0000 (09:19 +0200)
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Thu, 27 Apr 2017 12:42:50 +0000 (14:42 +0200)
30 files changed:
server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v63/DbVersion63.java
server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v63/DefaultOrganizationUuid.java [deleted file]
server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v63/DefaultOrganizationUuidImpl.java [deleted file]
server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v63/DefaultOrganizationUuidProvider.java [new file with mode: 0644]
server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v63/DefaultOrganizationUuidProviderImpl.java [new file with mode: 0644]
server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v63/MakeDefaultOrganizationGuarded.java
server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v63/PopulateDefaultPermTemplateColumnsOfOrganizations.java
server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v63/PopulateOrganizationUuidToProjects.java
server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v64/PopulateOrganizationMembersTable.java
server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v64/PopulateRulesMetadata.java
server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v64/RestoreSonarUsersGroups.java
server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v64/SetQualityProfileOrganizationUuidToDefault.java
server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v64/SupportPrivateProjectInDefaultPermissionTemplate.java
server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v64/UpgradeQualityTemplateLoadedTemplates.java
server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v63/DbVersion63Test.java
server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v63/DefaultOrganizationUuidImplTest.java [deleted file]
server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v63/DefaultOrganizationUuidProviderImplTest.java [new file with mode: 0644]
server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v63/MakeDefaultOrganizationGuardedTest.java
server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v63/PopulateDefaultPermTemplateColumnsOfOrganizationsTest.java
server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v63/PopulateOrganizationUuidToProjectsTest.java
server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v63/TestDefaultOrganizationUuid.java [deleted file]
server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v63/TestDefaultOrganizationUuidProvider.java [new file with mode: 0644]
server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v64/PopulateOrganizationMembersTableTest.java
server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v64/PopulateRulesMetadataTest.java
server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v64/RestoreSonarUsersGroupsTest.java
server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v64/SetQualityProfileOrganizationUuidToDefaultTest.java
server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v64/SupportPrivateProjectInDefaultPermissionTemplateTest.java
server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v64/UpgradeQualityTemplateLoadedTemplatesTest.java
server/sonar-db-migration/src/test/resources/org/sonar/server/platform/db/migration/version/v63/DefaultOrganizationUuidImplTest/internal_properties.sql [deleted file]
server/sonar-db-migration/src/test/resources/org/sonar/server/platform/db/migration/version/v63/DefaultOrganizationUuidProviderImplTest/internal_properties.sql [new file with mode: 0644]

index 0e4d36500cc40b92d0a817f97178fee9b91b53ee..4968227be695b593fd47220c27378926a3c9620d 100644 (file)
@@ -26,7 +26,7 @@ import org.sonar.server.platform.db.migration.version.DbVersion;
 public class DbVersion63 implements DbVersion {
   @Override
   public Stream<Object> getSupportComponents() {
-    return Stream.of(DefaultOrganizationUuidImpl.class);
+    return Stream.of(DefaultOrganizationUuidProviderImpl.class);
   }
 
   @Override
diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v63/DefaultOrganizationUuid.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v63/DefaultOrganizationUuid.java
deleted file mode 100644 (file)
index 2836b65..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.server.platform.db.migration.version.v63;
-
-import java.sql.SQLException;
-import org.sonar.server.platform.db.migration.step.DataChange;
-
-public interface DefaultOrganizationUuid {
-  /**
-   * Retrieves the uuid of the default organization from table INTERNAL_PROPERTIES.
-   *
-   * @throws IllegalStateException if uuid of the default organization can't be retrieved
-   */
-  String get(DataChange.Context context) throws SQLException;
-
-  /**
-   * Retrieves the uuid of the default organization from table INTERNAL_PROPERTIES and ensure the specified organization
-   * exists in table ORGANIZATIONS.
-   *
-   * @throws IllegalStateException if uuid of the default organization can't be retrieved
-   * @throws IllegalStateException if the default organization does not exist
-   */
-  String getAndCheck(DataChange.Context context) throws SQLException;
-}
diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v63/DefaultOrganizationUuidImpl.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v63/DefaultOrganizationUuidImpl.java
deleted file mode 100644 (file)
index 218b32c..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.server.platform.db.migration.version.v63;
-
-import java.sql.SQLException;
-import org.sonar.server.platform.db.migration.step.DataChange;
-import org.sonar.server.platform.db.migration.step.Select;
-
-import static com.google.common.base.Preconditions.checkState;
-
-/**
- * Component which can be injected in steps which provides access to the UUID of the default organization, it reads
- * directly from the BD.
- */
-public class DefaultOrganizationUuidImpl implements DefaultOrganizationUuid {
-
-  private static final String INTERNAL_PROPERTY_DEFAULT_ORGANIZATION = "organization.default";
-
-  @Override
-  public String get(DataChange.Context context) throws SQLException {
-    Select select = context.prepareSelect("select text_value from internal_properties where kee=?");
-    select.setString(1, INTERNAL_PROPERTY_DEFAULT_ORGANIZATION);
-    String uuid = select.get(row -> row.getString(1));
-    checkState(uuid != null, "Default organization uuid is missing");
-    return uuid;
-  }
-
-  @Override
-  public String getAndCheck(DataChange.Context context) throws SQLException {
-    String organizationUuid = get(context);
-    Select select = context.prepareSelect("select uuid from organizations where uuid=?")
-      .setString(1, organizationUuid);
-    checkState(select.get(row -> row.getString(1)) != null,
-      "Default organization with uuid '%s' does not exist in table ORGANIZATIONS",
-      organizationUuid);
-    return organizationUuid;
-  }
-}
diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v63/DefaultOrganizationUuidProvider.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v63/DefaultOrganizationUuidProvider.java
new file mode 100644 (file)
index 0000000..991f1d6
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+package org.sonar.server.platform.db.migration.version.v63;
+
+import java.sql.SQLException;
+import org.sonar.server.platform.db.migration.step.DataChange;
+
+public interface DefaultOrganizationUuidProvider {
+  /**
+   * Retrieves the uuid of the default organization from table INTERNAL_PROPERTIES.
+   *
+   * @throws IllegalStateException if uuid of the default organization can't be retrieved
+   */
+  String get(DataChange.Context context) throws SQLException;
+
+  /**
+   * Retrieves the uuid of the default organization from table INTERNAL_PROPERTIES and ensure the specified organization
+   * exists in table ORGANIZATIONS.
+   *
+   * @throws IllegalStateException if uuid of the default organization can't be retrieved
+   * @throws IllegalStateException if the default organization does not exist
+   */
+  String getAndCheck(DataChange.Context context) throws SQLException;
+}
diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v63/DefaultOrganizationUuidProviderImpl.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v63/DefaultOrganizationUuidProviderImpl.java
new file mode 100644 (file)
index 0000000..ae8f4b1
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+package org.sonar.server.platform.db.migration.version.v63;
+
+import java.sql.SQLException;
+import org.sonar.server.platform.db.migration.step.DataChange;
+import org.sonar.server.platform.db.migration.step.Select;
+
+import static com.google.common.base.Preconditions.checkState;
+
+/**
+ * Component which can be injected in steps which provides access to the UUID of the default organization, it reads
+ * directly from the BD.
+ */
+public class DefaultOrganizationUuidProviderImpl implements DefaultOrganizationUuidProvider {
+
+  private static final String INTERNAL_PROPERTY_DEFAULT_ORGANIZATION = "organization.default";
+
+  @Override
+  public String get(DataChange.Context context) throws SQLException {
+    Select select = context.prepareSelect("select text_value from internal_properties where kee=?");
+    select.setString(1, INTERNAL_PROPERTY_DEFAULT_ORGANIZATION);
+    String uuid = select.get(row -> row.getString(1));
+    checkState(uuid != null, "Default organization uuid is missing");
+    return uuid;
+  }
+
+  @Override
+  public String getAndCheck(DataChange.Context context) throws SQLException {
+    String organizationUuid = get(context);
+    Select select = context.prepareSelect("select uuid from organizations where uuid=?")
+      .setString(1, organizationUuid);
+    checkState(select.get(row -> row.getString(1)) != null,
+      "Default organization with uuid '%s' does not exist in table ORGANIZATIONS",
+      organizationUuid);
+    return organizationUuid;
+  }
+}
index 08f8e121e4d513824bb82948ff320942486c2fc3..c5972e7234e3b101b5f821384e21314a797c8b3a 100644 (file)
@@ -24,9 +24,9 @@ import org.sonar.db.Database;
 import org.sonar.server.platform.db.migration.step.DataChange;
 
 public class MakeDefaultOrganizationGuarded extends DataChange {
-  private final DefaultOrganizationUuid defaultOrganizationUuid;
+  private final DefaultOrganizationUuidProvider defaultOrganizationUuid;
 
-  public MakeDefaultOrganizationGuarded(Database db, DefaultOrganizationUuid defaultOrganizationUuid) {
+  public MakeDefaultOrganizationGuarded(Database db, DefaultOrganizationUuidProvider defaultOrganizationUuid) {
     super(db);
     this.defaultOrganizationUuid = defaultOrganizationUuid;
   }
index f91572b6f36de38347f60375748ea1bcb191128b..f39e51601ff38cc98db00179a113a6b030716fae 100644 (file)
@@ -48,9 +48,9 @@ public class PopulateDefaultPermTemplateColumnsOfOrganizations extends DataChang
   private static final String DEFAULT_VIEW_TEMPLATE_PROPERTY = "sonar.permission.template.VW.default";
   private static final String DEFAULT_DEV_TEMPLATE_PROPERTY = "sonar.permission.template.DEV.default";
 
-  private final DefaultOrganizationUuid defaultOrganizationUuid;
+  private final DefaultOrganizationUuidProvider defaultOrganizationUuid;
 
-  public PopulateDefaultPermTemplateColumnsOfOrganizations(Database db, DefaultOrganizationUuid defaultOrganizationUuid) {
+  public PopulateDefaultPermTemplateColumnsOfOrganizations(Database db, DefaultOrganizationUuidProvider defaultOrganizationUuid) {
     super(db);
     this.defaultOrganizationUuid = defaultOrganizationUuid;
   }
index aeb102e86833759b3af884acd403ee7694d69f13..947b65c9decaccec670883a077a86491b3800677 100644 (file)
@@ -25,9 +25,9 @@ import org.sonar.server.platform.db.migration.step.DataChange;
 import org.sonar.server.platform.db.migration.step.MassUpdate;
 
 public class PopulateOrganizationUuidToProjects extends DataChange {
-  private final DefaultOrganizationUuid defaultOrganizationUuid;
+  private final DefaultOrganizationUuidProvider defaultOrganizationUuid;
 
-  public PopulateOrganizationUuidToProjects(Database db, DefaultOrganizationUuid defaultOrganizationUuid) {
+  public PopulateOrganizationUuidToProjects(Database db, DefaultOrganizationUuidProvider defaultOrganizationUuid) {
     super(db);
     this.defaultOrganizationUuid = defaultOrganizationUuid;
   }
index 46df4f3d8a7f30f780f0822a5bfbfe1379326e63..ef88a7b540da2c9ad63ba24b99373498cf88a882 100644 (file)
@@ -24,15 +24,15 @@ import java.sql.SQLException;
 import org.sonar.db.Database;
 import org.sonar.server.platform.db.migration.step.DataChange;
 import org.sonar.server.platform.db.migration.step.MassUpdate;
-import org.sonar.server.platform.db.migration.version.v63.DefaultOrganizationUuid;
+import org.sonar.server.platform.db.migration.version.v63.DefaultOrganizationUuidProvider;
 
 public class PopulateOrganizationMembersTable extends DataChange {
 
   private static final String INSERT_ORGANIZATION_MEMBERS_SQL = "INSERT INTO organization_members (user_id, organization_uuid) VALUES (?, ?)";
 
-  private final DefaultOrganizationUuid defaultOrganizationUuid;
+  private final DefaultOrganizationUuidProvider defaultOrganizationUuid;
 
-  public PopulateOrganizationMembersTable(Database db, DefaultOrganizationUuid defaultOrganizationUuid) {
+  public PopulateOrganizationMembersTable(Database db, DefaultOrganizationUuidProvider defaultOrganizationUuid) {
     super(db);
     this.defaultOrganizationUuid = defaultOrganizationUuid;
   }
index e5b979cecf99bd5507f3bab0a5b6f67138539063..2e8813a2371aeb71340bebf8a039a40dd09eb1d4 100644 (file)
@@ -27,15 +27,15 @@ import org.sonar.server.platform.db.migration.step.DataChange;
 import org.sonar.server.platform.db.migration.step.MassUpdate;
 import org.sonar.server.platform.db.migration.step.Select;
 import org.sonar.server.platform.db.migration.step.SqlStatement;
-import org.sonar.server.platform.db.migration.version.v63.DefaultOrganizationUuid;
+import org.sonar.server.platform.db.migration.version.v63.DefaultOrganizationUuidProvider;
 
 import static java.util.Optional.ofNullable;
 
 public class PopulateRulesMetadata extends DataChange {
-  private final DefaultOrganizationUuid defaultOrganizationUuid;
+  private final DefaultOrganizationUuidProvider defaultOrganizationUuid;
   private final System2 system2;
 
-  public PopulateRulesMetadata(Database db, DefaultOrganizationUuid defaultOrganizationUuid, System2 system2) {
+  public PopulateRulesMetadata(Database db, DefaultOrganizationUuidProvider defaultOrganizationUuid, System2 system2) {
     super(db);
     this.defaultOrganizationUuid = defaultOrganizationUuid;
     this.system2 = system2;
index 9ac20c19274dec574edaa238900fadabb1aa5b98..81bd665b6c5861b316f251d84a4de378c40ce540 100644 (file)
@@ -29,7 +29,7 @@ import org.sonar.db.Database;
 import org.sonar.server.platform.db.migration.step.DataChange;
 import org.sonar.server.platform.db.migration.step.MassUpdate;
 import org.sonar.server.platform.db.migration.step.Select;
-import org.sonar.server.platform.db.migration.version.v63.DefaultOrganizationUuid;
+import org.sonar.server.platform.db.migration.version.v63.DefaultOrganizationUuidProvider;
 
 import static com.google.common.base.Preconditions.checkState;
 import static java.lang.String.format;
@@ -49,9 +49,9 @@ public class RestoreSonarUsersGroups extends DataChange {
   private static final String DEFAULT_GROUP_SETTING = "sonar.defaultGroup";
 
   private final System2 system2;
-  private final DefaultOrganizationUuid defaultOrganizationUuid;
+  private final DefaultOrganizationUuidProvider defaultOrganizationUuid;
 
-  public RestoreSonarUsersGroups(Database db, System2 system2, DefaultOrganizationUuid defaultOrganizationUuid) {
+  public RestoreSonarUsersGroups(Database db, System2 system2, DefaultOrganizationUuidProvider defaultOrganizationUuid) {
     super(db);
     this.system2 = system2;
     this.defaultOrganizationUuid = defaultOrganizationUuid;
index 2ab126ccb0d436375ee0428cd80ae65928a6db09..7ad93199876ff2d45c62d1a49a10b0412822979c 100644 (file)
@@ -22,13 +22,13 @@ package org.sonar.server.platform.db.migration.version.v64;
 import java.sql.SQLException;
 import org.sonar.db.Database;
 import org.sonar.server.platform.db.migration.step.DataChange;
-import org.sonar.server.platform.db.migration.version.v63.DefaultOrganizationUuid;
+import org.sonar.server.platform.db.migration.version.v63.DefaultOrganizationUuidProvider;
 
 public class SetQualityProfileOrganizationUuidToDefault extends DataChange {
 
-  private final DefaultOrganizationUuid defaultOrganizationUuid;
+  private final DefaultOrganizationUuidProvider defaultOrganizationUuid;
 
-  public SetQualityProfileOrganizationUuidToDefault(Database db, DefaultOrganizationUuid defaultOrganizationUuid) {
+  public SetQualityProfileOrganizationUuidToDefault(Database db, DefaultOrganizationUuidProvider defaultOrganizationUuid) {
     super(db);
     this.defaultOrganizationUuid = defaultOrganizationUuid;
   }
index 6ddf5b4ec4dd75d21f6fd67a79203d68983e2a48..dc230e686e30a29868ed191c0bacdf9a8362a4f3 100644 (file)
@@ -28,7 +28,7 @@ import javax.annotation.Nullable;
 import org.sonar.db.Database;
 import org.sonar.server.platform.db.migration.step.DataChange;
 import org.sonar.server.platform.db.migration.step.Select;
-import org.sonar.server.platform.db.migration.version.v63.DefaultOrganizationUuid;
+import org.sonar.server.platform.db.migration.version.v63.DefaultOrganizationUuidProvider;
 
 import static com.google.common.base.Preconditions.checkState;
 
@@ -36,16 +36,16 @@ public class SupportPrivateProjectInDefaultPermissionTemplate extends DataChange
   private static final String PERMISSION_USER = "user";
   private static final String PERMISSION_CODEVIEWER = "codeviewer";
 
-  private DefaultOrganizationUuid defaultOrganizationUuid;
+  private DefaultOrganizationUuidProvider defaultOrganizationUuidProvider;
 
-  public SupportPrivateProjectInDefaultPermissionTemplate(Database db, DefaultOrganizationUuid defaultOrganizationUuid) {
+  public SupportPrivateProjectInDefaultPermissionTemplate(Database db, DefaultOrganizationUuidProvider defaultOrganizationUuidProvider) {
     super(db);
-    this.defaultOrganizationUuid = defaultOrganizationUuid;
+    this.defaultOrganizationUuidProvider = defaultOrganizationUuidProvider;
   }
 
   @Override
   protected void execute(Context context) throws SQLException {
-    String defaultOrganizationUuid = this.defaultOrganizationUuid.get(context);
+    String defaultOrganizationUuid = this.defaultOrganizationUuidProvider.get(context);
 
     ResolvedOrganizationProperties organizationProperties = readOrganizationProperties(context, defaultOrganizationUuid);
 
index 712b97ba93529b695752cc67d935651fb53be55f..2de28b68f80c1b049b941a3e8806c5af4d36c78a 100644 (file)
@@ -25,7 +25,7 @@ import org.apache.commons.codec.digest.DigestUtils;
 import org.sonar.db.Database;
 import org.sonar.server.platform.db.migration.step.DataChange;
 import org.sonar.server.platform.db.migration.step.MassUpdate;
-import org.sonar.server.platform.db.migration.version.v63.DefaultOrganizationUuid;
+import org.sonar.server.platform.db.migration.version.v63.DefaultOrganizationUuidProvider;
 
 import static java.lang.String.format;
 import static java.nio.charset.StandardCharsets.UTF_8;
@@ -34,9 +34,9 @@ import static org.apache.commons.codec.binary.Hex.encodeHexString;
 public class UpgradeQualityTemplateLoadedTemplates extends DataChange {
   private static final String QUALITY_PROFILE_TYPE = "QUALITY_PROFILE";
 
-  private final DefaultOrganizationUuid defaultOrganizationUuid;
+  private final DefaultOrganizationUuidProvider defaultOrganizationUuid;
 
-  public UpgradeQualityTemplateLoadedTemplates(Database db, DefaultOrganizationUuid defaultOrganizationUuid) {
+  public UpgradeQualityTemplateLoadedTemplates(Database db, DefaultOrganizationUuidProvider defaultOrganizationUuid) {
     super(db);
     this.defaultOrganizationUuid = defaultOrganizationUuid;
   }
index dca9beeebdb1f091e4fec42f95ab5a4fa7b8d046..2cf4e2d1455ecb0654c2c3a95012acb3fe69d03c 100644 (file)
@@ -31,7 +31,7 @@ public class DbVersion63Test {
   @Test
   public void verify_support_components() {
     assertThat(underTest.getSupportComponents())
-      .containsOnly(DefaultOrganizationUuidImpl.class);
+      .containsOnly(DefaultOrganizationUuidProviderImpl.class);
   }
 
   @Test
diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v63/DefaultOrganizationUuidImplTest.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v63/DefaultOrganizationUuidImplTest.java
deleted file mode 100644 (file)
index 6c4b101..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.server.platform.db.migration.version.v63;
-
-import java.sql.Connection;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-import org.sonar.api.utils.System2;
-import org.sonar.db.CoreDbTester;
-import org.sonar.server.platform.db.migration.step.DataChange;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class DefaultOrganizationUuidImplTest {
-  private static final String AN_ORG_UUID = "org1";
-
-  @Rule
-  public CoreDbTester dbTester = CoreDbTester.createForSchema(DefaultOrganizationUuidImplTest.class, "internal_properties.sql");
-  @Rule
-  public ExpectedException expectedException = ExpectedException.none();
-
-  private DefaultOrganizationUuid underTest = new DefaultOrganizationUuidImpl();
-
-  @Test
-  public void get_fails_with_ISE_if_default_organization_internal_property_is_not_set() throws Exception {
-    expectedException.expect(IllegalStateException.class);
-    expectedException.expectMessage("Default organization uuid is missing");
-
-    callGet(underTest);
-  }
-
-  @Test
-  public void get_returns_uuid_from_table_INTERNAL_PROPERTIES() throws Exception {
-    dbTester.executeInsert("internal_properties", "kee", "organization.default", "is_empty", false, "text_value", AN_ORG_UUID);
-
-    assertThat(callGet(underTest)).isEqualTo(AN_ORG_UUID);
-  }
-
-  private String callGet(DefaultOrganizationUuid defaultOrganizationUuid) throws Exception {
-    try (Connection connection = dbTester.openConnection()) {
-      DataChange.Context context = new DataChange.Context(dbTester.database(), connection, connection);
-      return defaultOrganizationUuid.get(context);
-    }
-  }
-
-}
diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v63/DefaultOrganizationUuidProviderImplTest.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v63/DefaultOrganizationUuidProviderImplTest.java
new file mode 100644 (file)
index 0000000..0339404
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+package org.sonar.server.platform.db.migration.version.v63;
+
+import java.sql.Connection;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.sonar.db.CoreDbTester;
+import org.sonar.server.platform.db.migration.step.DataChange;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class DefaultOrganizationUuidProviderImplTest {
+  private static final String AN_ORG_UUID = "org1";
+
+  @Rule
+  public CoreDbTester dbTester = CoreDbTester.createForSchema(DefaultOrganizationUuidProviderImplTest.class, "internal_properties.sql");
+  @Rule
+  public ExpectedException expectedException = ExpectedException.none();
+
+  private DefaultOrganizationUuidProvider underTest = new DefaultOrganizationUuidProviderImpl();
+
+  @Test
+  public void get_fails_with_ISE_if_default_organization_internal_property_is_not_set() throws Exception {
+    expectedException.expect(IllegalStateException.class);
+    expectedException.expectMessage("Default organization uuid is missing");
+
+    callGet(underTest);
+  }
+
+  @Test
+  public void get_returns_uuid_from_table_INTERNAL_PROPERTIES() throws Exception {
+    dbTester.executeInsert("internal_properties", "kee", "organization.default", "is_empty", false, "text_value", AN_ORG_UUID);
+
+    assertThat(callGet(underTest)).isEqualTo(AN_ORG_UUID);
+  }
+
+  private String callGet(DefaultOrganizationUuidProvider defaultOrganizationUuid) throws Exception {
+    try (Connection connection = dbTester.openConnection()) {
+      DataChange.Context context = new DataChange.Context(dbTester.database(), connection, connection);
+      return defaultOrganizationUuid.get(context);
+    }
+  }
+
+}
index 1bb0a0e7261c0a597d5ef658c1c86e3a17826fdc..3b6a78c5b0b9b82f0e03c9c9a3033e0a8fde028c 100644 (file)
@@ -40,7 +40,7 @@ public class MakeDefaultOrganizationGuardedTest {
   @Rule
   public ExpectedException expectedException = ExpectedException.none();
 
-  private MakeDefaultOrganizationGuarded underTest = new MakeDefaultOrganizationGuarded(db.database(), new DefaultOrganizationUuidImpl());
+  private MakeDefaultOrganizationGuarded underTest = new MakeDefaultOrganizationGuarded(db.database(), new DefaultOrganizationUuidProviderImpl());
 
   @Test
   public void fails_with_ISE_when_no_default_organization_is_set() throws SQLException {
index 8abdae375044e5922ba09310186fb17ec384f0d0..9b37b2ebf36500f6bbf70df902c8c17f2473c22b 100644 (file)
@@ -25,7 +25,6 @@ import javax.annotation.Nullable;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
-import org.sonar.api.utils.System2;
 import org.sonar.db.CoreDbTester;
 
 import static org.assertj.core.api.Assertions.assertThat;
@@ -43,7 +42,7 @@ public class PopulateDefaultPermTemplateColumnsOfOrganizationsTest {
   public ExpectedException expectedException = ExpectedException.none();
 
   private PopulateDefaultPermTemplateColumnsOfOrganizations underTest = new PopulateDefaultPermTemplateColumnsOfOrganizations(dbTester.database(),
-    new DefaultOrganizationUuidImpl());
+    new DefaultOrganizationUuidProviderImpl());
 
   @Test
   public void fails_with_ISE_when_no_default_organization_is_set() throws SQLException {
index 605f418db93bca80de64a4ec270ca0fe9da76d70..a018c995056039303436ac05806c01fdeabb5599 100644 (file)
@@ -22,7 +22,6 @@ package org.sonar.server.platform.db.migration.version.v63;
 import java.sql.SQLException;
 import org.junit.Rule;
 import org.junit.Test;
-import org.sonar.api.utils.System2;
 import org.sonar.db.CoreDbTester;
 
 import static java.lang.String.valueOf;
@@ -35,7 +34,7 @@ public class PopulateOrganizationUuidToProjectsTest {
   @Rule
   public CoreDbTester dbTester = CoreDbTester.createForSchema(PopulateOrganizationUuidToProjectsTest.class, "projects_with_nullable_organization.sql");
 
-  private PopulateOrganizationUuidToProjects underTest = new PopulateOrganizationUuidToProjects(dbTester.database(), new TestDefaultOrganizationUuid(ORGANIZATION_UUID));
+  private PopulateOrganizationUuidToProjects underTest = new PopulateOrganizationUuidToProjects(dbTester.database(), new TestDefaultOrganizationUuidProvider(ORGANIZATION_UUID));
 
   @Test
   public void execute_has_no_effect_when_table_is_empty() throws SQLException {
diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v63/TestDefaultOrganizationUuid.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v63/TestDefaultOrganizationUuid.java
deleted file mode 100644 (file)
index 668d7d4..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-package org.sonar.server.platform.db.migration.version.v63;
-
-import java.sql.SQLException;
-import org.sonar.server.platform.db.migration.step.DataChange;
-
-import static java.util.Objects.requireNonNull;
-
-/**
- * Implementation of {@link DefaultOrganizationUuid} which never fails and returns the specified organization uuid.
- */
-public class TestDefaultOrganizationUuid implements DefaultOrganizationUuid {
-  private final String organizationUuid;
-
-  public TestDefaultOrganizationUuid(String organizationUuid) {
-    this.organizationUuid = requireNonNull(organizationUuid, "organizationUuid can't be null");
-  }
-
-  @Override
-  public String get(DataChange.Context context) throws SQLException {
-    return organizationUuid;
-  }
-
-  @Override
-  public String getAndCheck(DataChange.Context context) throws SQLException {
-    return organizationUuid;
-  }
-}
diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v63/TestDefaultOrganizationUuidProvider.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v63/TestDefaultOrganizationUuidProvider.java
new file mode 100644 (file)
index 0000000..9c9c064
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+package org.sonar.server.platform.db.migration.version.v63;
+
+import java.sql.SQLException;
+import org.sonar.server.platform.db.migration.step.DataChange;
+
+import static java.util.Objects.requireNonNull;
+
+/**
+ * Implementation of {@link DefaultOrganizationUuidProvider} which never fails and returns the specified organization uuid.
+ */
+public class TestDefaultOrganizationUuidProvider implements DefaultOrganizationUuidProvider {
+  private final String organizationUuid;
+
+  public TestDefaultOrganizationUuidProvider(String organizationUuid) {
+    this.organizationUuid = requireNonNull(organizationUuid, "organizationUuid can't be null");
+  }
+
+  @Override
+  public String get(DataChange.Context context) throws SQLException {
+    return organizationUuid;
+  }
+
+  @Override
+  public String getAndCheck(DataChange.Context context) throws SQLException {
+    return organizationUuid;
+  }
+}
index 4b8df9f7af9270a6b4b4512b8940a22e88e5026c..7b1c5f1271e0bc048ebe8727d55f17aa6a66338a 100644 (file)
@@ -32,7 +32,7 @@ import org.junit.Test;
 import org.junit.rules.ExpectedException;
 import org.sonar.core.util.stream.MoreCollectors;
 import org.sonar.db.CoreDbTester;
-import org.sonar.server.platform.db.migration.version.v63.DefaultOrganizationUuidImpl;
+import org.sonar.server.platform.db.migration.version.v63.DefaultOrganizationUuidProviderImpl;
 
 import static java.lang.String.format;
 import static org.apache.commons.lang.math.RandomUtils.nextLong;
@@ -62,7 +62,7 @@ public class PopulateOrganizationMembersTableTest {
   @Rule
   public CoreDbTester db = CoreDbTester.createForSchema(PopulateOrganizationMembersTableTest.class, "initial.sql");
 
-  private PopulateOrganizationMembersTable underTest = new PopulateOrganizationMembersTable(db.database(), new DefaultOrganizationUuidImpl());
+  private PopulateOrganizationMembersTable underTest = new PopulateOrganizationMembersTable(db.database(), new DefaultOrganizationUuidProviderImpl());
 
   @Test
   public void fails_with_ISE_when_no_default_organization_is_set() throws SQLException {
index 414c1e5b2e714bbaa782890bcd568905fe4264aa..88f0b3e144587e844a6c7e400408e7ea39fb04f5 100644 (file)
@@ -28,7 +28,7 @@ import org.junit.Test;
 import org.junit.rules.ExpectedException;
 import org.sonar.api.utils.System2;
 import org.sonar.db.CoreDbTester;
-import org.sonar.server.platform.db.migration.version.v63.DefaultOrganizationUuidImpl;
+import org.sonar.server.platform.db.migration.version.v63.DefaultOrganizationUuidProviderImpl;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
@@ -44,7 +44,7 @@ public class PopulateRulesMetadataTest {
   public ExpectedException expectedException = ExpectedException.none();
 
   private System2 system2 = mock(System2.class);
-  private PopulateRulesMetadata underTest = new PopulateRulesMetadata(db.database(), new DefaultOrganizationUuidImpl(), system2);
+  private PopulateRulesMetadata underTest = new PopulateRulesMetadata(db.database(), new DefaultOrganizationUuidProviderImpl(), system2);
 
   @Test
   public void fails_with_ISE_when_no_default_organization_is_set() throws SQLException {
index 1c8e76a0663ee474c9578e9bfc21995d23f07204..5884f867e23409891312cddfc7d9947063889f20 100644 (file)
@@ -34,7 +34,7 @@ import org.junit.rules.ExpectedException;
 import org.sonar.api.utils.System2;
 import org.sonar.api.utils.log.LogTester;
 import org.sonar.db.CoreDbTester;
-import org.sonar.server.platform.db.migration.version.v63.DefaultOrganizationUuidImpl;
+import org.sonar.server.platform.db.migration.version.v63.DefaultOrganizationUuidProviderImpl;
 
 import static java.lang.String.format;
 import static org.apache.commons.lang.math.RandomUtils.nextLong;
@@ -64,7 +64,7 @@ public class RestoreSonarUsersGroupsTest {
 
   private System2 system2 = mock(System2.class);
 
-  private RestoreSonarUsersGroups underTest = new RestoreSonarUsersGroups(db.database(), system2, new DefaultOrganizationUuidImpl());
+  private RestoreSonarUsersGroups underTest = new RestoreSonarUsersGroups(db.database(), system2, new DefaultOrganizationUuidProviderImpl());
 
   @Before
   public void setUp() throws Exception {
index 51080d02f48b557635155a33a13c4a24b9ca856b..965ed02304f042b451c51f0c72209ccd35c88a9b 100644 (file)
@@ -24,8 +24,8 @@ import org.assertj.core.api.Assertions;
 import org.junit.Rule;
 import org.junit.Test;
 import org.sonar.db.CoreDbTester;
-import org.sonar.server.platform.db.migration.version.v63.DefaultOrganizationUuid;
-import org.sonar.server.platform.db.migration.version.v63.TestDefaultOrganizationUuid;
+import org.sonar.server.platform.db.migration.version.v63.DefaultOrganizationUuidProvider;
+import org.sonar.server.platform.db.migration.version.v63.TestDefaultOrganizationUuidProvider;
 
 public class SetQualityProfileOrganizationUuidToDefaultTest {
 
@@ -35,7 +35,7 @@ public class SetQualityProfileOrganizationUuidToDefaultTest {
   @Rule
   public CoreDbTester db = CoreDbTester.createForSchema(SetQualityProfileOrganizationUuidToDefaultTest.class, "initial.sql");
 
-  private DefaultOrganizationUuid defaultOrganization = new TestDefaultOrganizationUuid(DEFAULT_ORG);
+  private DefaultOrganizationUuidProvider defaultOrganization = new TestDefaultOrganizationUuidProvider(DEFAULT_ORG);
 
   public SetQualityProfileOrganizationUuidToDefault underTest = new SetQualityProfileOrganizationUuidToDefault(db.database(), defaultOrganization);
 
index 1dc8ae5d97cc5745b032e89fdce0da8729757e08..ed06f61eb91459c9c85d4bb1ae5fc787266893ed 100644 (file)
@@ -28,7 +28,7 @@ import org.junit.Test;
 import org.junit.rules.ExpectedException;
 import org.sonar.core.util.stream.MoreCollectors;
 import org.sonar.db.CoreDbTester;
-import org.sonar.server.platform.db.migration.version.v63.DefaultOrganizationUuidImpl;
+import org.sonar.server.platform.db.migration.version.v63.DefaultOrganizationUuidProviderImpl;
 
 import static java.lang.String.valueOf;
 import static org.apache.commons.lang.math.RandomUtils.nextLong;
@@ -46,7 +46,7 @@ public class SupportPrivateProjectInDefaultPermissionTemplateTest {
   @Rule
   public ExpectedException expectedException = ExpectedException.none();
 
-  private SupportPrivateProjectInDefaultPermissionTemplate underTest = new SupportPrivateProjectInDefaultPermissionTemplate(db.database(), new DefaultOrganizationUuidImpl());
+  private SupportPrivateProjectInDefaultPermissionTemplate underTest = new SupportPrivateProjectInDefaultPermissionTemplate(db.database(), new DefaultOrganizationUuidProviderImpl());
 
   @Test
   public void fails_with_ISE_when_no_default_organization_is_set() throws SQLException {
index 345747f57e222099c05b38371065e0cd81f8dccf..54014d589b2555bde3a8ef2c8ce54f9a53f50418 100644 (file)
@@ -24,7 +24,7 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
 import org.sonar.db.CoreDbTester;
-import org.sonar.server.platform.db.migration.version.v63.DefaultOrganizationUuidImpl;
+import org.sonar.server.platform.db.migration.version.v63.DefaultOrganizationUuidProviderImpl;
 
 import static java.nio.charset.StandardCharsets.UTF_8;
 import static org.apache.commons.codec.digest.DigestUtils.md5Hex;
@@ -42,7 +42,7 @@ public class UpgradeQualityTemplateLoadedTemplatesTest {
   @Rule
   public ExpectedException expectedException = ExpectedException.none();
 
-  private UpgradeQualityTemplateLoadedTemplates underTest = new UpgradeQualityTemplateLoadedTemplates(db.database(), new DefaultOrganizationUuidImpl());
+  private UpgradeQualityTemplateLoadedTemplates underTest = new UpgradeQualityTemplateLoadedTemplates(db.database(), new DefaultOrganizationUuidProviderImpl());
 
   @Test
   public void fails_with_ISE_when_no_default_organization_is_set() throws SQLException {
diff --git a/server/sonar-db-migration/src/test/resources/org/sonar/server/platform/db/migration/version/v63/DefaultOrganizationUuidImplTest/internal_properties.sql b/server/sonar-db-migration/src/test/resources/org/sonar/server/platform/db/migration/version/v63/DefaultOrganizationUuidImplTest/internal_properties.sql
deleted file mode 100644 (file)
index e540040..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-CREATE TABLE "INTERNAL_PROPERTIES" (
-  "KEE" VARCHAR(50) NOT NULL PRIMARY KEY,
-  "IS_EMPTY" BOOLEAN NOT NULL,
-  "TEXT_VALUE" VARCHAR(4000),
-  "CLOB_VALUE" CLOB,
-  "CREATED_AT" BIGINT
-);
-CREATE UNIQUE INDEX "UNIQ_INTERNAL_PROPERTIES" ON "INTERNAL_PROPERTIES" ("KEE");
diff --git a/server/sonar-db-migration/src/test/resources/org/sonar/server/platform/db/migration/version/v63/DefaultOrganizationUuidProviderImplTest/internal_properties.sql b/server/sonar-db-migration/src/test/resources/org/sonar/server/platform/db/migration/version/v63/DefaultOrganizationUuidProviderImplTest/internal_properties.sql
new file mode 100644 (file)
index 0000000..e540040
--- /dev/null
@@ -0,0 +1,8 @@
+CREATE TABLE "INTERNAL_PROPERTIES" (
+  "KEE" VARCHAR(50) NOT NULL PRIMARY KEY,
+  "IS_EMPTY" BOOLEAN NOT NULL,
+  "TEXT_VALUE" VARCHAR(4000),
+  "CLOB_VALUE" CLOB,
+  "CREATED_AT" BIGINT
+);
+CREATE UNIQUE INDEX "UNIQ_INTERNAL_PROPERTIES" ON "INTERNAL_PROPERTIES" ("KEE");