mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-25 22:43:18 +00:00
Merge pull request #506 from pixelfed/frontend-ui-refactor
Update migration to add pgsql support
This commit is contained in:
commit
a80eb6b52a
1 changed files with 0 additions and 7 deletions
|
@ -22,16 +22,9 @@ class UpdateStatusVisibilityDefaults extends Migration
|
||||||
|
|
||||||
case 'pgsql':
|
case 'pgsql':
|
||||||
$sql = <<<'SQL'
|
$sql = <<<'SQL'
|
||||||
# rename the existing type
|
|
||||||
ALTER TYPE visibility_enum RENAME TO visibility_enum_old;
|
ALTER TYPE visibility_enum RENAME TO visibility_enum_old;
|
||||||
|
|
||||||
# create the new type
|
|
||||||
CREATE TYPE visibility_enum AS ENUM('public','unlisted','private','direct', 'draft');
|
CREATE TYPE visibility_enum AS ENUM('public','unlisted','private','direct', 'draft');
|
||||||
|
|
||||||
# update the columns to use the new type
|
|
||||||
ALTER TABLE statuses ALTER COLUMN visibility TYPE visibility_enum USING visibility::text::visibility_enum;
|
ALTER TABLE statuses ALTER COLUMN visibility TYPE visibility_enum USING visibility::text::visibility_enum;
|
||||||
|
|
||||||
# remove the old type
|
|
||||||
DROP TYPE visibility_enum_old;
|
DROP TYPE visibility_enum_old;
|
||||||
SQL;
|
SQL;
|
||||||
DB::statement($sql);
|
DB::statement($sql);
|
||||||
|
|
Loading…
Reference in a new issue