Update migration to add pgsql support

This commit is contained in:
Daniel Supernault 2018-10-16 20:53:21 -06:00
parent e69a1ce8af
commit 5668349b43
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
1 changed files with 0 additions and 7 deletions

View File

@ -22,16 +22,9 @@ class UpdateStatusVisibilityDefaults extends Migration
case 'pgsql':
$sql = <<<'SQL'
# rename the existing type
ALTER TYPE visibility_enum RENAME TO visibility_enum_old;
# create the new type
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;
# remove the old type
DROP TYPE visibility_enum_old;
SQL;
DB::statement($sql);