Skip to content

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

feat: add phone to principal table (#6456)

p0ny3317bfb19e4f
diff --git a/backend/migrator/migration/dev/LATEST.sql b/backend/migrator/migration/dev/LATEST.sql
index 9ffa21cdbf..eee490bae1 100644
--- a/backend/migrator/migration/dev/LATEST.sql
+++ b/backend/migrator/migration/dev/LATEST.sql
@@ -46,6 +46,7 @@ CREATE TABLE principal (
name TEXT NOT NULL,
email TEXT NOT NULL,
password_hash TEXT NOT NULL,
+ phone TEXT NOT NULL DEFAULT '',
mfa_config JSONB NOT NULL DEFAULT '{}'
);
diff --git a/backend/migrator/migration/prod/2.3/0000##add_phone_to_principal.sql b/backend/migrator/migration/prod/2.3/0000##add_phone_to_principal.sql
new file mode 100644
index 0000000000..4efca28c1a
--- /dev/null
+++ b/backend/migrator/migration/prod/2.3/0000##add_phone_to_principal.sql
@@ -0,0 +1 @@
+ALTER TABLE principal ADD COLUMN phone TEXT NOT NULL DEFAULT '';
diff --git a/backend/migrator/migration/prod/LATEST.sql b/backend/migrator/migration/prod/LATEST.sql
index 8a7fb5182f..7ed6ae3eab 100644
--- a/backend/migrator/migration/prod/LATEST.sql
+++ b/backend/migrator/migration/prod/LATEST.sql
@@ -46,6 +46,7 @@ CREATE TABLE principal (
name TEXT NOT NULL,
email TEXT NOT NULL,
password_hash TEXT NOT NULL,
+ phone TEXT NOT NULL DEFAULT '',
mfa_config JSONB NOT NULL DEFAULT '{}'
);
diff --git a/backend/migrator/migrator_test.go b/backend/migrator/migrator_test.go
index 11789d9073..32afd78e5e 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.2.4"), releaseVersion)
+ require.Equal(t, semver.MustParse("2.3.0"), releaseVersion)
}