Skip to content

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

chore: move schema change of GitHub integration for release (#2108)

Joe Chen2cf9d0337aaa
diff --git a/store/migration/dev/20220407000000__github_com.sql b/store/migration/prod/1.3/0001__github_com.sql
similarity index 100%
rename from store/migration/dev/20220407000000__github_com.sql
rename to store/migration/prod/1.3/0001__github_com.sql
diff --git a/store/migration/prod/LATEST.sql b/store/migration/prod/LATEST.sql
index 44665a6fcd..84057f48ca 100644
--- a/store/migration/prod/LATEST.sql
+++ b/store/migration/prod/LATEST.sql
@@ -168,7 +168,7 @@ CREATE TABLE project (
-- db_name_template is only used when a project is in tenant mode.
-- Empty value means {{DB_NAME}}.
db_name_template TEXT NOT NULL,
- role_provider TEXT NOT NULL CHECK (role_provider IN ('BYTEBASE', 'GITLAB_SELF_HOST')) DEFAULT 'BYTEBASE'
+ role_provider TEXT NOT NULL CHECK (role_provider IN ('BYTEBASE', 'GITLAB_SELF_HOST', 'GITHUB_COM')) DEFAULT 'BYTEBASE'
);
CREATE UNIQUE INDEX idx_project_unique_key ON project(key);
@@ -217,7 +217,7 @@ CREATE TABLE project_member (
project_id INTEGER NOT NULL REFERENCES project (id),
role TEXT NOT NULL CHECK (role IN ('OWNER', 'DEVELOPER')),
principal_id INTEGER NOT NULL REFERENCES principal (id),
- role_provider TEXT NOT NULL CHECK (role_provider IN ('BYTEBASE', 'GITLAB_SELF_HOST')) DEFAULT 'BYTEBASE',
+ role_provider TEXT NOT NULL CHECK (role_provider IN ('BYTEBASE', 'GITLAB_SELF_HOST', 'GITHUB_COM')) DEFAULT 'BYTEBASE',
-- payload is determined by the type of role_provider
payload JSONB NOT NULL DEFAULT '{}'
);
@@ -872,7 +872,7 @@ CREATE TABLE vcs (
updater_id INTEGER NOT NULL REFERENCES principal (id),
updated_ts BIGINT NOT NULL DEFAULT extract(epoch from now()),
name TEXT NOT NULL,
- type TEXT NOT NULL CHECK (type IN ('GITLAB_SELF_HOST')),
+ type TEXT NOT NULL CHECK (type IN ('GITLAB_SELF_HOST', 'GITHUB_COM')),
instance_url TEXT NOT NULL CHECK ((instance_url LIKE 'http://%' OR instance_url LIKE 'https://%') AND instance_url = rtrim(instance_url, '/')),
api_url TEXT NOT NULL CHECK ((api_url LIKE 'http://%' OR api_url LIKE 'https://%') AND api_url = rtrim(api_url, '/')),
application_id TEXT NOT NULL,
diff --git a/store/pg_engine_test.go b/store/pg_engine_test.go
index 73f47c999e..f856edb514 100644
--- a/store/pg_engine_test.go
+++ b/store/pg_engine_test.go
@@ -215,5 +215,5 @@ func TestMigrationCompatibility(t *testing.T) {
func TestGetCutoffVersion(t *testing.T) {
releaseVersion, err := getProdCutoffVersion()
require.NoError(t, err)
- require.Equal(t, semver.MustParse("1.3.0"), releaseVersion)
+ require.Equal(t, semver.MustParse("1.3.1"), releaseVersion)
}