Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb64af42

Browse files
committed
Add down migration
Also bump migration number since new ones have merged since.
1 parentaba8129 commitb64af42

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

‎coderd/database/migrations/000338_workspace_app_status_idle.down.sql‎

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
-- It is not possible to delete a value from an enum, so we have to recreate it.
2+
CREATETYPEold_workspace_app_status_stateAS ENUM ('working','complete','failure');
3+
4+
-- Convert the new "idle" state into "complete". This means we lose some
5+
-- information when downgrading, but this is necessary to swap to the old enum.
6+
UPDATE workspace_app_statusesSET state='complete'WHERE state='idle';
7+
8+
-- Swap to the old enum.
9+
ALTERTABLE workspace_app_statuses
10+
ALTER COLUMN state TYPE old_workspace_app_status_state
11+
USING (state::text::old_workspace_app_status_state);
12+
13+
-- Drop the new enum and rename the old one to the final name.
14+
DROPTYPE workspace_app_status_state;
15+
ALTERTYPE old_workspace_app_status_state RENAME TO workspace_app_status_state;

coderd/database/migrations/000338_workspace_app_status_idle.up.sql renamed to coderd/database/migrations/000340_workspace_app_status_idle.up.sql

File renamed without changes.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp