diff --git a/store/datastore/ddl/mysql/ddl_gen.go b/store/datastore/ddl/mysql/ddl_gen.go index 53ed2ae1..e7004826 100644 --- a/store/datastore/ddl/mysql/ddl_gen.go +++ b/store/datastore/ddl/mysql/ddl_gen.go @@ -456,7 +456,7 @@ CREATE INDEX sender_repo_ix ON senders (sender_repo_id); // var alterTableAddRepoVisibility = ` -ALTER TABLE repos ADD COLUMN repo_visibility INTEGER +ALTER TABLE repos ADD COLUMN repo_visibility VARCHAR(50) ` var updateTableSetRepoVisibility = ` diff --git a/store/datastore/ddl/mysql/files/013_add_column_repo_visibility.sql b/store/datastore/ddl/mysql/files/013_add_column_repo_visibility.sql index eb6e8ac5..937294b4 100644 --- a/store/datastore/ddl/mysql/files/013_add_column_repo_visibility.sql +++ b/store/datastore/ddl/mysql/files/013_add_column_repo_visibility.sql @@ -1,6 +1,6 @@ -- name: alter-table-add-repo-visibility -ALTER TABLE repos ADD COLUMN repo_visibility INTEGER +ALTER TABLE repos ADD COLUMN repo_visibility VARCHAR(50) -- name: update-table-set-repo-visibility diff --git a/store/datastore/ddl/postgres/ddl_gen.go b/store/datastore/ddl/postgres/ddl_gen.go index d2f49fdb..cd44d250 100644 --- a/store/datastore/ddl/postgres/ddl_gen.go +++ b/store/datastore/ddl/postgres/ddl_gen.go @@ -456,13 +456,13 @@ CREATE INDEX IF NOT EXISTS sender_repo_ix ON senders (sender_repo_id); // var alterTableAddRepoVisibility = ` -ALTER TABLE repos ADD COLUMN repo_visibility INTEGER +ALTER TABLE repos ADD COLUMN repo_visibility VARCHAR(50) ` var updateTableSetRepoVisibility = ` UPDATE repos SET repo_visibility = (CASE - WHEN repo_private = 0 THEN 'public' + WHEN repo_private = true THEN 'public' ELSE 'private' END) ` diff --git a/store/datastore/ddl/postgres/files/013_add_column_repo_visibility.sql b/store/datastore/ddl/postgres/files/013_add_column_repo_visibility.sql index 109d79df..48111778 100644 --- a/store/datastore/ddl/postgres/files/013_add_column_repo_visibility.sql +++ b/store/datastore/ddl/postgres/files/013_add_column_repo_visibility.sql @@ -1,11 +1,11 @@ -- name: alter-table-add-repo-visibility -ALTER TABLE repos ADD COLUMN repo_visibility INTEGER +ALTER TABLE repos ADD COLUMN repo_visibility VARCHAR(50) -- name: update-table-set-repo-visibility UPDATE repos SET repo_visibility = (CASE - WHEN repo_private = 0 THEN 'public' + WHEN repo_private = true THEN 'public' ELSE 'private' END) diff --git a/store/datastore/ddl/sqlite/ddl_gen.go b/store/datastore/ddl/sqlite/ddl_gen.go index ab3bd263..22cfb91d 100644 --- a/store/datastore/ddl/sqlite/ddl_gen.go +++ b/store/datastore/ddl/sqlite/ddl_gen.go @@ -457,7 +457,7 @@ CREATE INDEX IF NOT EXISTS sender_repo_ix ON senders (sender_repo_id); // var alterTableAddRepoVisibility = ` -ALTER TABLE repos ADD COLUMN repo_visibility INTEGER +ALTER TABLE repos ADD COLUMN repo_visibility TEXT ` var updateTableSetRepoVisibility = ` diff --git a/store/datastore/ddl/sqlite/files/013_add_column_repo_visibility.sql b/store/datastore/ddl/sqlite/files/013_add_column_repo_visibility.sql index eb6e8ac5..f8dcef8f 100644 --- a/store/datastore/ddl/sqlite/files/013_add_column_repo_visibility.sql +++ b/store/datastore/ddl/sqlite/files/013_add_column_repo_visibility.sql @@ -1,6 +1,6 @@ -- name: alter-table-add-repo-visibility -ALTER TABLE repos ADD COLUMN repo_visibility INTEGER +ALTER TABLE repos ADD COLUMN repo_visibility TEXT -- name: update-table-set-repo-visibility