diff options
author | Jacek <jacek.poreda@sonarsource.com> | 2020-06-15 14:59:20 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2020-06-15 20:05:16 +0000 |
commit | 41f7eb48fac1b3199f5a75fe504ef309b441d34a (patch) | |
tree | beea25fe51380a76895bdebc6635ab5101220314 /server | |
parent | 9cf0e219a3783c5db8e3accab6b80e25b88f7049 (diff) | |
download | sonarqube-41f7eb48fac1b3199f5a75fe504ef309b441d34a.tar.gz sonarqube-41f7eb48fac1b3199f5a75fe504ef309b441d34a.zip |
SONAR-13221 Increase size of FK user_uuid column to 255
Diffstat (limited to 'server')
14 files changed, 21 insertions, 23 deletions
diff --git a/server/sonar-db-dao/src/schema/schema-sq.ddl b/server/sonar-db-dao/src/schema/schema-sq.ddl index fc2acf81abc..1bc82047b1e 100644 --- a/server/sonar-db-dao/src/schema/schema-sq.ddl +++ b/server/sonar-db-dao/src/schema/schema-sq.ddl @@ -334,7 +334,7 @@ ALTER TABLE "GROUPS" ADD CONSTRAINT "PK_GROUPS" PRIMARY KEY("UUID"); CREATE TABLE "GROUPS_USERS"( "GROUP_UUID" VARCHAR(40) NOT NULL, - "USER_UUID" VARCHAR(40) NOT NULL + "USER_UUID" VARCHAR(255) NOT NULL ); CREATE INDEX "INDEX_GROUPS_USERS_GROUP_UUID" ON "GROUPS_USERS"("GROUP_UUID"); CREATE INDEX "INDEX_GROUPS_USERS_USER_UUID" ON "GROUPS_USERS"("USER_UUID"); @@ -524,7 +524,7 @@ CREATE UNIQUE INDEX "ORG_ALM_BINDINGS_INSTALL" ON "ORGANIZATION_ALM_BINDINGS"("A CREATE TABLE "ORGANIZATION_MEMBERS"( "ORGANIZATION_UUID" VARCHAR(40) NOT NULL, - "USER_UUID" VARCHAR(40) NOT NULL + "USER_UUID" VARCHAR(255) NOT NULL ); ALTER TABLE "ORGANIZATION_MEMBERS" ADD CONSTRAINT "PK_ORGANIZATION_MEMBERS" PRIMARY KEY("USER_UUID", "ORGANIZATION_UUID"); CREATE INDEX "ORG_MEMBERS_USER_UUID" ON "ORGANIZATION_MEMBERS"("USER_UUID"); @@ -566,7 +566,7 @@ CREATE TABLE "PERM_TEMPLATES_USERS"( "UPDATED_AT" TIMESTAMP, "UUID" VARCHAR(40) NOT NULL, "TEMPLATE_UUID" VARCHAR(40) NOT NULL, - "USER_UUID" VARCHAR(40) NOT NULL + "USER_UUID" VARCHAR(255) NOT NULL ); ALTER TABLE "PERM_TEMPLATES_USERS" ADD CONSTRAINT "PK_PERM_TEMPLATES_USERS" PRIMARY KEY("UUID"); @@ -732,7 +732,7 @@ CREATE TABLE "PROPERTIES"( "CREATED_AT" BIGINT NOT NULL, "COMPONENT_UUID" VARCHAR(40), "UUID" VARCHAR(40) NOT NULL, - "USER_UUID" VARCHAR(40) + "USER_UUID" VARCHAR(255) ); ALTER TABLE "PROPERTIES" ADD CONSTRAINT "PK_PROPERTIES" PRIMARY KEY("UUID"); CREATE INDEX "PROPERTIES_KEY" ON "PROPERTIES"("PROP_KEY"); @@ -762,7 +762,7 @@ CREATE TABLE "QPROFILE_EDIT_USERS"( "UUID" VARCHAR(40) NOT NULL, "QPROFILE_UUID" VARCHAR(255) NOT NULL, "CREATED_AT" BIGINT NOT NULL, - "USER_UUID" VARCHAR(40) NOT NULL + "USER_UUID" VARCHAR(255) NOT NULL ); ALTER TABLE "QPROFILE_EDIT_USERS" ADD CONSTRAINT "PK_QPROFILE_EDIT_USERS" PRIMARY KEY("UUID"); CREATE INDEX "QPROFILE_EDIT_USERS_QPROFILE" ON "QPROFILE_EDIT_USERS"("QPROFILE_UUID"); @@ -928,7 +928,7 @@ CREATE TABLE "USER_ROLES"( "ROLE" VARCHAR(64) NOT NULL, "COMPONENT_UUID" VARCHAR(40), "UUID" VARCHAR(40) NOT NULL, - "USER_UUID" VARCHAR(40) + "USER_UUID" VARCHAR(255) ); ALTER TABLE "USER_ROLES" ADD CONSTRAINT "PK_USER_ROLES" PRIMARY KEY("UUID"); CREATE INDEX "USER_ROLES_COMPONENT_UUID" ON "USER_ROLES"("COMPONENT_UUID"); diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/users/fk/groupsusers/AddIndexOnUserUuidOfGroupsUsersTable.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/users/fk/groupsusers/AddIndexOnUserUuidOfGroupsUsersTable.java index dbbc4ece49a..3a47ef73200 100644 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/users/fk/groupsusers/AddIndexOnUserUuidOfGroupsUsersTable.java +++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/users/fk/groupsusers/AddIndexOnUserUuidOfGroupsUsersTable.java @@ -26,7 +26,7 @@ import org.sonar.db.DatabaseUtils; import org.sonar.server.platform.db.migration.sql.CreateIndexBuilder; import org.sonar.server.platform.db.migration.step.DdlChange; -import static org.sonar.server.platform.db.migration.def.VarcharColumnDef.UUID_SIZE; +import static org.sonar.server.platform.db.migration.def.VarcharColumnDef.USER_UUID_SIZE; import static org.sonar.server.platform.db.migration.def.VarcharColumnDef.newVarcharColumnDefBuilder; public class AddIndexOnUserUuidOfGroupsUsersTable extends DdlChange { @@ -46,7 +46,7 @@ public class AddIndexOnUserUuidOfGroupsUsersTable extends DdlChange { .setName(INDEX_NAME) .addColumn(newVarcharColumnDefBuilder() .setColumnName("user_uuid") - .setLimit(UUID_SIZE) + .setLimit(USER_UUID_SIZE) .build()) .build()); } diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/users/fk/groupsusers/MakeGroupsUsersUserUuidColumnNotNullable.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/users/fk/groupsusers/MakeGroupsUsersUserUuidColumnNotNullable.java index 2cf5d9a0692..4acf072e736 100644 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/users/fk/groupsusers/MakeGroupsUsersUserUuidColumnNotNullable.java +++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/users/fk/groupsusers/MakeGroupsUsersUserUuidColumnNotNullable.java @@ -25,6 +25,7 @@ import org.sonar.server.platform.db.migration.def.VarcharColumnDef; import org.sonar.server.platform.db.migration.sql.AlterColumnsBuilder; import org.sonar.server.platform.db.migration.step.DdlChange; +import static org.sonar.server.platform.db.migration.def.VarcharColumnDef.USER_UUID_SIZE; import static org.sonar.server.platform.db.migration.def.VarcharColumnDef.newVarcharColumnDefBuilder; public class MakeGroupsUsersUserUuidColumnNotNullable extends DdlChange { @@ -34,7 +35,7 @@ public class MakeGroupsUsersUserUuidColumnNotNullable extends DdlChange { .setColumnName("user_uuid") .setIsNullable(false) .setDefaultValue(null) - .setLimit(VarcharColumnDef.UUID_SIZE) + .setLimit(USER_UUID_SIZE) .build(); public MakeGroupsUsersUserUuidColumnNotNullable(Database db) { diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/users/fk/util/AddUserUuidColumnToTable.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/users/fk/util/AddUserUuidColumnToTable.java index bee2024acbc..923e4918bbc 100644 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/users/fk/util/AddUserUuidColumnToTable.java +++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/users/fk/util/AddUserUuidColumnToTable.java @@ -34,7 +34,7 @@ public class AddUserUuidColumnToTable extends DdlChange { .setColumnName("user_uuid") .setIsNullable(true) .setDefaultValue(null) - .setLimit(VarcharColumnDef.UUID_SIZE) + .setLimit(VarcharColumnDef.USER_UUID_SIZE) .build(); public AddUserUuidColumnToTable(Database db, String tableName) { diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/users/fk/util/MakeUserUuidColumnNotNullable.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/users/fk/util/MakeUserUuidColumnNotNullable.java index 1189e5e88b3..40a33e9dc1f 100644 --- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/users/fk/util/MakeUserUuidColumnNotNullable.java +++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/version/v84/users/fk/util/MakeUserUuidColumnNotNullable.java @@ -34,7 +34,7 @@ public class MakeUserUuidColumnNotNullable extends DdlChange { .setColumnName("user_uuid") .setIsNullable(false) .setDefaultValue(null) - .setLimit(VarcharColumnDef.UUID_SIZE) + .setLimit(VarcharColumnDef.USER_UUID_SIZE) .build(); public MakeUserUuidColumnNotNullable(Database db, String tableName) { diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/groupsusers/AddUserUuidColumnToGroupsUsersTest.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/groupsusers/AddUserUuidColumnToGroupsUsersTest.java index ff442d1dae8..6a5265681a7 100644 --- a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/groupsusers/AddUserUuidColumnToGroupsUsersTest.java +++ b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/groupsusers/AddUserUuidColumnToGroupsUsersTest.java @@ -48,7 +48,7 @@ public class AddUserUuidColumnToGroupsUsersTest { public void add_uuid_column() throws SQLException { underTest.execute(); - db.assertColumnDefinition("groups_users", "user_uuid", Types.VARCHAR, 40, true); + db.assertColumnDefinition("groups_users", "user_uuid", Types.VARCHAR, 255, true); assertThat(db.countSql("select count(*) from groups_users")) .isEqualTo(3); diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/organizationmembers/AddUserUuidColumnToOrganizationMembersTest.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/organizationmembers/AddUserUuidColumnToOrganizationMembersTest.java index f1cc49b8d12..7ddeda299e5 100644 --- a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/organizationmembers/AddUserUuidColumnToOrganizationMembersTest.java +++ b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/organizationmembers/AddUserUuidColumnToOrganizationMembersTest.java @@ -47,7 +47,7 @@ public class AddUserUuidColumnToOrganizationMembersTest { public void add_uuid_column() throws SQLException { underTest.execute(); - db.assertColumnDefinition("organization_members", "user_uuid", Types.VARCHAR, 40, true); + db.assertColumnDefinition("organization_members", "user_uuid", Types.VARCHAR, 255, true); assertThat(db.countSql("select count(*) from organization_members")) .isEqualTo(3); diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/organizationmembers/MakeOrganizationMembersUserUuidColumnNotNullableTest.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/organizationmembers/MakeOrganizationMembersUserUuidColumnNotNullableTest.java index 54713dbc172..1bdbb45614e 100644 --- a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/organizationmembers/MakeOrganizationMembersUserUuidColumnNotNullableTest.java +++ b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/organizationmembers/MakeOrganizationMembersUserUuidColumnNotNullableTest.java @@ -26,7 +26,6 @@ import org.sonar.db.CoreDbTester; import org.sonar.server.platform.db.migration.step.MigrationStep; import static java.sql.Types.VARCHAR; -import static org.sonar.server.platform.db.migration.def.VarcharColumnDef.UUID_SIZE; public class MakeOrganizationMembersUserUuidColumnNotNullableTest { @Rule @@ -38,6 +37,6 @@ public class MakeOrganizationMembersUserUuidColumnNotNullableTest { public void uuid_column_is_not_null() throws SQLException { underTest.execute(); - db.assertColumnDefinition("organization_members", "user_uuid", VARCHAR, UUID_SIZE, false); + db.assertColumnDefinition("organization_members", "user_uuid", VARCHAR, 255, false); } } diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/permtemplatesusers/AddUserUuidColumnToPermTemplatesUsersTest.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/permtemplatesusers/AddUserUuidColumnToPermTemplatesUsersTest.java index 563b5ec6111..4e71769372f 100644 --- a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/permtemplatesusers/AddUserUuidColumnToPermTemplatesUsersTest.java +++ b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/permtemplatesusers/AddUserUuidColumnToPermTemplatesUsersTest.java @@ -48,7 +48,7 @@ public class AddUserUuidColumnToPermTemplatesUsersTest { public void add_uuid_column() throws SQLException { underTest.execute(); - db.assertColumnDefinition("perm_templates_users", "user_uuid", Types.VARCHAR, 40, true); + db.assertColumnDefinition("perm_templates_users", "user_uuid", Types.VARCHAR, 255, true); assertThat(db.countSql("select count(*) from perm_templates_users")) .isEqualTo(3); diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/permtemplatesusers/MakePermTemplatesUsersUserUuidColumnNotNullableTest.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/permtemplatesusers/MakePermTemplatesUsersUserUuidColumnNotNullableTest.java index 8a7c5a9aab7..13829d25809 100644 --- a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/permtemplatesusers/MakePermTemplatesUsersUserUuidColumnNotNullableTest.java +++ b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/permtemplatesusers/MakePermTemplatesUsersUserUuidColumnNotNullableTest.java @@ -26,7 +26,6 @@ import org.sonar.db.CoreDbTester; import org.sonar.server.platform.db.migration.step.MigrationStep; import static java.sql.Types.VARCHAR; -import static org.sonar.server.platform.db.migration.def.VarcharColumnDef.UUID_SIZE; public class MakePermTemplatesUsersUserUuidColumnNotNullableTest { @Rule @@ -38,6 +37,6 @@ public class MakePermTemplatesUsersUserUuidColumnNotNullableTest { public void uuid_column_is_not_null() throws SQLException { underTest.execute(); - db.assertColumnDefinition("perm_templates_users", "user_uuid", VARCHAR, UUID_SIZE, false); + db.assertColumnDefinition("perm_templates_users", "user_uuid", VARCHAR, 255, false); } } diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/properties/AddUserUuidColumnToPropertiesUsersTest.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/properties/AddUserUuidColumnToPropertiesUsersTest.java index 196d410b90a..0609d756ecd 100644 --- a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/properties/AddUserUuidColumnToPropertiesUsersTest.java +++ b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/properties/AddUserUuidColumnToPropertiesUsersTest.java @@ -48,7 +48,7 @@ public class AddUserUuidColumnToPropertiesUsersTest { public void add_uuid_column() throws SQLException { underTest.execute(); - db.assertColumnDefinition("properties", "user_uuid", Types.VARCHAR, 40, true); + db.assertColumnDefinition("properties", "user_uuid", Types.VARCHAR, 255, true); assertThat(db.countSql("select count(*) from properties")) .isEqualTo(3); diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/qprofileeditusers/AddUserUuidColumnToQProfileEditUsersTest.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/qprofileeditusers/AddUserUuidColumnToQProfileEditUsersTest.java index 08d1ce42316..0d4db2d72ef 100644 --- a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/qprofileeditusers/AddUserUuidColumnToQProfileEditUsersTest.java +++ b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/qprofileeditusers/AddUserUuidColumnToQProfileEditUsersTest.java @@ -48,7 +48,7 @@ public class AddUserUuidColumnToQProfileEditUsersTest { public void add_uuid_column() throws SQLException { underTest.execute(); - db.assertColumnDefinition("qprofile_edit_users", "user_uuid", Types.VARCHAR, 40, true); + db.assertColumnDefinition("qprofile_edit_users", "user_uuid", Types.VARCHAR, 255, true); assertThat(db.countSql("select count(*) from qprofile_edit_users")) .isEqualTo(3); diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/qprofileeditusers/MakeQProfileEditUsersUserUuidColumnNotNullableTest.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/qprofileeditusers/MakeQProfileEditUsersUserUuidColumnNotNullableTest.java index ec3a82c731e..5ca4dd71b9a 100644 --- a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/qprofileeditusers/MakeQProfileEditUsersUserUuidColumnNotNullableTest.java +++ b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/qprofileeditusers/MakeQProfileEditUsersUserUuidColumnNotNullableTest.java @@ -26,7 +26,6 @@ import org.sonar.db.CoreDbTester; import org.sonar.server.platform.db.migration.step.MigrationStep; import static java.sql.Types.VARCHAR; -import static org.sonar.server.platform.db.migration.def.VarcharColumnDef.UUID_SIZE; public class MakeQProfileEditUsersUserUuidColumnNotNullableTest { @Rule @@ -38,6 +37,6 @@ public class MakeQProfileEditUsersUserUuidColumnNotNullableTest { public void uuid_column_is_not_null() throws SQLException { underTest.execute(); - db.assertColumnDefinition("qprofile_edit_users", "user_uuid", VARCHAR, UUID_SIZE, false); + db.assertColumnDefinition("qprofile_edit_users", "user_uuid", VARCHAR, 255, false); } } diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/userroles/AddUserUuidColumnToUserRolesTest.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/userroles/AddUserUuidColumnToUserRolesTest.java index 0ab2d150099..d742f13429c 100644 --- a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/userroles/AddUserUuidColumnToUserRolesTest.java +++ b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/version/v84/users/fk/userroles/AddUserUuidColumnToUserRolesTest.java @@ -48,7 +48,7 @@ public class AddUserUuidColumnToUserRolesTest { public void add_uuid_column() throws SQLException { underTest.execute(); - db.assertColumnDefinition("user_roles", "user_uuid", Types.VARCHAR, 40, true); + db.assertColumnDefinition("user_roles", "user_uuid", Types.VARCHAR, 255, true); assertThat(db.countSql("select count(*) from user_roles")) .isEqualTo(3); |