From 9ed9f8f1c9da142a74259d171066b9f518aae1ae Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Mon, 22 May 2017 23:16:42 +0200 Subject: [PATCH] change repo_visibility to text --- store/datastore/ddl/mysql/ddl_gen.go | 2 +- .../ddl/mysql/files/013_add_column_repo_visibility.sql | 2 +- store/datastore/ddl/postgres/ddl_gen.go | 4 ++-- .../ddl/postgres/files/013_add_column_repo_visibility.sql | 4 ++-- store/datastore/ddl/sqlite/ddl_gen.go | 2 +- .../ddl/sqlite/files/013_add_column_repo_visibility.sql | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) 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