aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/adhoc/CreateMeasuresTable.java2
-rw-r--r--server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/adhoc/CreateMeasuresTableTest.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/adhoc/CreateMeasuresTable.java b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/adhoc/CreateMeasuresTable.java
index bf5e4f19017..36e8d2ca755 100644
--- a/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/adhoc/CreateMeasuresTable.java
+++ b/server/sonar-db-migration/src/main/java/org/sonar/server/platform/db/migration/adhoc/CreateMeasuresTable.java
@@ -48,7 +48,7 @@ public class CreateMeasuresTable extends CreateTableChange {
@Override
public void execute(DdlChange.Context context, String tableName) throws SQLException {
context.execute(new CreateTableBuilder(getDialect(), tableName)
- .addColumn(newVarcharColumnDefBuilder().setColumnName(COLUMN_COMPONENT_UUID).setIsNullable(false).setLimit(UUID_SIZE).build())
+ .addPkColumn(newVarcharColumnDefBuilder().setColumnName(COLUMN_COMPONENT_UUID).setIsNullable(false).setLimit(UUID_SIZE).build())
.addColumn(newVarcharColumnDefBuilder().setColumnName(COLUMN_BRANCH_UUID).setIsNullable(false).setLimit(UUID_SIZE).build())
.addColumn(newClobColumnDefBuilder().setColumnName(COLUMN_JSON_VALUE).setIsNullable(false).build())
.addColumn(newBigIntegerColumnDefBuilder().setColumnName(COLUMN_JSON_VALUE_HASH).setIsNullable(false).build())
diff --git a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/adhoc/CreateMeasuresTableTest.java b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/adhoc/CreateMeasuresTableTest.java
index ede32bd4777..31658113804 100644
--- a/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/adhoc/CreateMeasuresTableTest.java
+++ b/server/sonar-db-migration/src/test/java/org/sonar/server/platform/db/migration/adhoc/CreateMeasuresTableTest.java
@@ -49,7 +49,7 @@ public class CreateMeasuresTableTest {
underTest.execute();
db.assertTableExists(MEASURES_TABLE_NAME);
- db.assertNoPrimaryKey(MEASURES_TABLE_NAME);
+ db.assertPrimaryKey(MEASURES_TABLE_NAME, "pk_measures", "component_uuid");
db.assertColumnDefinition(MEASURES_TABLE_NAME, COLUMN_COMPONENT_UUID, Types.VARCHAR, UUID_SIZE, false);
db.assertColumnDefinition(MEASURES_TABLE_NAME, COLUMN_BRANCH_UUID, Types.VARCHAR, UUID_SIZE, false);
db.assertColumnDefinition(MEASURES_TABLE_NAME, COLUMN_JSON_VALUE, Types.CLOB, null, false);