change repo_visibility to text

This commit is contained in:
Brad Rydzewski 2017-05-22 23:16:42 +02:00
parent c64a244c27
commit 9ed9f8f1c9
6 changed files with 8 additions and 8 deletions

View file

@ -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 = `

View file

@ -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

View file

@ -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)
`

View file

@ -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)

View file

@ -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 = `

View file

@ -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