Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

Revert "chore: update instance index (#5845)" (#5852)

p0ny7d874ee9296c
diff --git a/backend/migrator/migration/dev/LATEST.sql b/backend/migrator/migration/dev/LATEST.sql
index e3046cda0f..8c5ee3e9bb 100644
--- a/backend/migrator/migration/dev/LATEST.sql
+++ b/backend/migrator/migration/dev/LATEST.sql
@@ -332,7 +332,7 @@ CREATE TABLE instance (
resource_id TEXT NOT NULL
);
-CREATE UNIQUE INDEX idx_instance_unique_environment_id_resource_id ON instance(environment_id, resource_id);
+CREATE UNIQUE INDEX idx_instance_unique_resource_id ON instance(resource_id);
ALTER SEQUENCE instance_id_seq RESTART WITH 101;
diff --git a/backend/migrator/migration/prod/1.18/0002##update_instance_unique_index.sql b/backend/migrator/migration/prod/1.18/0002##update_instance_unique_index.sql
deleted file mode 100644
index 19a4155a0a..0000000000
--- a/backend/migrator/migration/prod/1.18/0002##update_instance_unique_index.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-DROP INDEX idx_instance_unique_resource_id;
-CREATE UNIQUE INDEX idx_instance_unique_environment_id_resource_id ON instance(environment_id, resource_id);
diff --git a/backend/migrator/migration/prod/LATEST.sql b/backend/migrator/migration/prod/LATEST.sql
index fcdf7f650f..7fbf6b3d1c 100644
--- a/backend/migrator/migration/prod/LATEST.sql
+++ b/backend/migrator/migration/prod/LATEST.sql
@@ -331,7 +331,7 @@ CREATE TABLE instance (
resource_id TEXT NOT NULL
);
-CREATE UNIQUE INDEX idx_instance_unique_environment_id_resource_id ON instance(environment_id, resource_id);
+CREATE UNIQUE INDEX idx_instance_unique_resource_id ON instance(resource_id);
ALTER SEQUENCE instance_id_seq RESTART WITH 101;
diff --git a/backend/migrator/migrator_test.go b/backend/migrator/migrator_test.go
index e01a551edb..f95f5c5bb1 100644
--- a/backend/migrator/migrator_test.go
+++ b/backend/migrator/migrator_test.go
@@ -241,5 +241,5 @@ func TestMigrationCompatibility(t *testing.T) {
func TestGetCutoffVersion(t *testing.T) {
releaseVersion, err := getProdCutoffVersion()
require.NoError(t, err)
- require.Equal(t, semver.MustParse("1.18.2"), releaseVersion)
+ require.Equal(t, semver.MustParse("1.18.1"), releaseVersion)
}