From 7486f542911aedcdb0ed4f1dcc4dcf3bf757deb9 Mon Sep 17 00:00:00 2001 From: Avgustin Marinov Date: Thu, 17 Apr 2025 10:00:18 +0300 Subject: [PATCH] Add DS type to distrubution set unique key (#2364) Signed-off-by: Avgustin Marinov --- .../db/migration/H2/V1_12_31__add_type_to_ds_index___H2.sql | 2 ++ .../migration/MYSQL/V1_12_31__add_type_to_ds_index___MYSQL.sql | 2 ++ .../POSTGRESQL/V1_12_32__add_type_to_ds_index___POSTGRESQL.sql | 2 ++ 3 files changed, 6 insertions(+) create mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_31__add_type_to_ds_index___H2.sql create mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_31__add_type_to_ds_index___MYSQL.sql create mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_32__add_type_to_ds_index___POSTGRESQL.sql diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_31__add_type_to_ds_index___H2.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_31__add_type_to_ds_index___H2.sql new file mode 100644 index 000000000..0e602804e --- /dev/null +++ b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_31__add_type_to_ds_index___H2.sql @@ -0,0 +1,2 @@ +alter table sp_distribution_set drop constraint uk_distrib_set; +alter table sp_distribution_set add constraint uk_distrib_set unique (tenant, name, version, ds_id); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_31__add_type_to_ds_index___MYSQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_31__add_type_to_ds_index___MYSQL.sql new file mode 100644 index 000000000..0e602804e --- /dev/null +++ b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_31__add_type_to_ds_index___MYSQL.sql @@ -0,0 +1,2 @@ +alter table sp_distribution_set drop constraint uk_distrib_set; +alter table sp_distribution_set add constraint uk_distrib_set unique (tenant, name, version, ds_id); \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_32__add_type_to_ds_index___POSTGRESQL.sql b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_32__add_type_to_ds_index___POSTGRESQL.sql new file mode 100644 index 000000000..e329b14a5 --- /dev/null +++ b/hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_32__add_type_to_ds_index___POSTGRESQL.sql @@ -0,0 +1,2 @@ +alter table sp_distribution_set drop constraint uk_distrib_set_sp_distribution_set; +alter table sp_distribution_set add constraint uk_distrib_set_sp_distribution_set unique (tenant, name, version, ds_id); \ No newline at end of file