Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: add user_group table (#12059)
ecmadaoad6e9c8ff317
diff --git a/backend/migrator/migration/prod/2.18/0002##user_group.sql b/backend/migrator/migration/prod/2.18/0002##user_group.sqlnew file mode 100644index 0000000000..f052e55892--- /dev/null+++ b/backend/migrator/migration/prod/2.18/0002##user_group.sql@@ -0,0 +1,10 @@+CREATE TABLE user_group (+ email TEXT PRIMARY KEY,+ creator_id INTEGER NOT NULL REFERENCES principal (id),+ created_ts BIGINT NOT NULL DEFAULT extract(epoch from now()),+ updater_id INTEGER NOT NULL REFERENCES principal (id),+ updated_ts BIGINT NOT NULL DEFAULT extract(epoch from now()),+ name TEXT NOT NULL,+ description TEXT NOT NULL DEFAULT '',+ payload JSONB NOT NULL DEFAULT '{}'+);diff --git a/backend/migrator/migration/prod/LATEST.sql b/backend/migrator/migration/prod/LATEST.sqlindex 50842da4d8..44eec5b1f1 100644--- a/backend/migrator/migration/prod/LATEST.sql+++ b/backend/migrator/migration/prod/LATEST.sql@@ -991,4 +991,15 @@ CREATE TABLE sql_lint_config (updater_id INTEGER NOT NULL REFERENCES principal (id),updated_ts BIGINT NOT NULL DEFAULT extract(epoch from now()),config JSONB NOT NULL DEFAULT '{}'+);++CREATE TABLE user_group (+ email TEXT PRIMARY KEY,+ creator_id INTEGER NOT NULL REFERENCES principal (id),+ created_ts BIGINT NOT NULL DEFAULT extract(epoch from now()),+ updater_id INTEGER NOT NULL REFERENCES principal (id),+ updated_ts BIGINT NOT NULL DEFAULT extract(epoch from now()),+ name TEXT NOT NULL,+ description TEXT NOT NULL DEFAULT '',+ payload JSONB NOT NULL DEFAULT '{}');\ No newline at end of filediff --git a/backend/migrator/migrator_test.go b/backend/migrator/migrator_test.goindex c6b7af3f4e..0df740e02e 100644--- a/backend/migrator/migrator_test.go+++ b/backend/migrator/migrator_test.go@@ -230,5 +230,5 @@ func TestMigrationCompatibility(t *testing.T) {func TestGetCutoffVersion(t *testing.T) {releaseVersion, err := getProdCutoffVersion()require.NoError(t, err)- require.Equal(t, semver.MustParse("2.18.1"), releaseVersion)+ require.Equal(t, semver.MustParse("2.18.2"), releaseVersion)}diff --git a/backend/sql-server/advise.go b/backend/sql-server/advise.goindex a066e6f8f8..b59236f052 100644--- a/backend/sql-server/advise.go+++ b/backend/sql-server/advise.go@@ -101,7 +101,7 @@ func (s *Server) sqlCheckController(c echo.Context) error {ruleList, err := advisor.MergeSQLReviewRules(ruleOverride)if err != nil {- return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Cannot merge the config for template: %s", ruleOverride.Template)).SetInternal(err)+ return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Cannot merge the config for template: %s, error: %v", ruleOverride.Template, err)).SetInternal(err)}adviceList, err := sqlCheck(@@ -113,7 +113,7 @@ func (s *Server) sqlCheckController(c echo.Context) error {newCatalogService(engineType),)if err != nil {- return echo.NewHTTPError(http.StatusInternalServerError, "Failed to run sql check").SetInternal(err)+ return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("Failed to run sql check with error: %v", err)).SetInternal(err)}s.metricReporter.Report(&metric.Metric{