Skip to content

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

chore: add metadata proto to db table (#7419)

Danny Xu8988860f1c58
diff --git a/backend/migrator/migration/dev/20230627000001##set_activation_for_instance.sql b/backend/migrator/migration/dev/20230627000001##set_activation_for_instance.sql
deleted file mode 100644
index 2423cce2df..0000000000
--- a/backend/migrator/migration/dev/20230627000001##set_activation_for_instance.sql
+++ /dev/null
@@ -1,4 +0,0 @@
-UPDATE instance
-SET activation = TRUE
-FROM (SELECT value FROM setting WHERE name = 'bb.enterprise.license') AS license
-WHERE license.value != '';
\ No newline at end of file
diff --git a/backend/migrator/migration/dev/LATEST.sql b/backend/migrator/migration/dev/LATEST.sql
index 8370fb88f5..8d53d823d3 100644
--- a/backend/migrator/migration/dev/LATEST.sql
+++ b/backend/migrator/migration/dev/LATEST.sql
@@ -391,7 +391,8 @@ CREATE TABLE db (
secrets JSONB NOT NULL DEFAULT '{}',
datashare BOOLEAN NOT NULL DEFAULT FALSE,
-- service_name is the Oracle specific field.
- service_name TEXT NOT NULL DEFAULT ''
+ service_name TEXT NOT NULL DEFAULT '',
+ metadata JSONB NOT NULL DEFAULT '{}'
);
CREATE INDEX idx_db_instance_id ON db(instance_id);
diff --git a/backend/migrator/migration/prod/2.6/0002##db_metadata.sql b/backend/migrator/migration/prod/2.6/0002##db_metadata.sql
new file mode 100644
index 0000000000..e2849c820c
--- /dev/null
+++ b/backend/migrator/migration/prod/2.6/0002##db_metadata.sql
@@ -0,0 +1 @@
+ALTER TABLE db ADD COLUMN metadata JSONB NOT NULL DEFAULT '{}';
\ No newline at end of file
diff --git a/backend/migrator/migration/dev/20230627000000##drop_syntax_task_check.sql b/backend/migrator/migration/prod/2.6/0003##drop_syntax_task_check.sql
similarity index 100%
rename from backend/migrator/migration/dev/20230627000000##drop_syntax_task_check.sql
rename to backend/migrator/migration/prod/2.6/0003##drop_syntax_task_check.sql
diff --git a/backend/migrator/migration/prod/LATEST.sql b/backend/migrator/migration/prod/LATEST.sql
index 860b08ca2c..0fa6dd62e3 100644
--- a/backend/migrator/migration/prod/LATEST.sql
+++ b/backend/migrator/migration/prod/LATEST.sql
@@ -390,7 +390,8 @@ CREATE TABLE db (
secrets JSONB NOT NULL DEFAULT '{}',
datashare BOOLEAN NOT NULL DEFAULT FALSE,
-- service_name is the Oracle specific field.
- service_name TEXT NOT NULL DEFAULT ''
+ service_name TEXT NOT NULL DEFAULT '',
+ metadata JSONB 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 164b685813..50f60746e9 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.6.1"), releaseVersion)
+ require.Equal(t, semver.MustParse("2.6.3"), releaseVersion)
}