Skip to content

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

migrate: add service_name to db (#6879)

rebelicea3ec4b3c19f2
diff --git a/backend/migrator/migration/dev/LATEST.sql b/backend/migrator/migration/dev/LATEST.sql
index 6fabbe9542..02ace1b335 100644
--- a/backend/migrator/migration/dev/LATEST.sql
+++ b/backend/migrator/migration/dev/LATEST.sql
@@ -386,7 +386,9 @@ CREATE TABLE db (
schema_version TEXT NOT NULL,
name TEXT NOT NULL,
secrets JSONB NOT NULL DEFAULT '{}',
- datashare BOOLEAN NOT NULL DEFAULT FALSE
+ datashare BOOLEAN NOT NULL DEFAULT FALSE,
+ -- service_name is the Oracle specific field.
+ service_name TEXT NOT NULL DEFAULT ''
);
CREATE INDEX idx_db_instance_id ON db(instance_id);
diff --git a/backend/migrator/migration/prod/2.4/0001##add_service_name_to_db.sql b/backend/migrator/migration/prod/2.4/0001##add_service_name_to_db.sql
new file mode 100644
index 0000000000..0bf3ad517b
--- /dev/null
+++ b/backend/migrator/migration/prod/2.4/0001##add_service_name_to_db.sql
@@ -0,0 +1 @@
+ALTER TABLE db ADD COLUMN service_name TEXT NOT NULL DEFAULT '';
\ No newline at end of file
diff --git a/backend/migrator/migration/prod/LATEST.sql b/backend/migrator/migration/prod/LATEST.sql
index e3386ce9d7..d44ca6fd09 100644
--- a/backend/migrator/migration/prod/LATEST.sql
+++ b/backend/migrator/migration/prod/LATEST.sql
@@ -385,7 +385,9 @@ CREATE TABLE db (
schema_version TEXT NOT NULL,
name TEXT NOT NULL,
secrets JSONB NOT NULL DEFAULT '{}',
- datashare BOOLEAN NOT NULL DEFAULT FALSE
+ datashare BOOLEAN NOT NULL DEFAULT FALSE,
+ -- service_name is the Oracle specific field.
+ service_name TEXT NOT NULL DEFAULT ''
);
CREATE INDEX idx_db_instance_id ON db(instance_id);
diff --git a/backend/migrator/migrator_test.go b/backend/migrator/migrator_test.go
index 18e83e3e21..aa598b7d58 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("2.4.0"), releaseVersion)
+ require.Equal(t, semver.MustParse("2.4.1"), releaseVersion)
}