mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-18 12:31:27 +00:00
Merge pull request #507 from pixelfed/frontend-ui-refactor
Update migration to add pgsql support
This commit is contained in:
commit
c10d3a1e14
1 changed files with 4 additions and 7 deletions
|
@ -21,13 +21,10 @@ class UpdateStatusVisibilityDefaults extends Migration
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'pgsql':
|
case 'pgsql':
|
||||||
$sql = <<<'SQL'
|
DB::statement("ALTER TYPE visibility_enum RENAME TO visibility_enum_old;");
|
||||||
ALTER TYPE visibility_enum RENAME TO visibility_enum_old;
|
DB::statement("CREATE TYPE visibility_enum AS ENUM('public','unlisted','private','direct', 'draft');");
|
||||||
CREATE TYPE visibility_enum AS ENUM('public','unlisted','private','direct', 'draft');
|
DB::statement("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;
|
DB::statement("DROP TYPE visibility_enum_old;");
|
||||||
DROP TYPE visibility_enum_old;
|
|
||||||
SQL;
|
|
||||||
DB::statement($sql);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue