|
1
|
import { Migration } from "@medusajs/framework/mikro-orm/migrations" |
|
2
|
|
|
3
|
export class Migration20240801085921 extends Migration { |
|
4
|
async up(): Promise<void> { |
|
5
|
this.addSql(` |
|
6
|
ALTER TABLE "return" |
|
7
|
ADD COLUMN IF NOT exists "requested_at" timestamptz NULL; |
|
8
|
|
|
9
|
|
|
10
|
ALTER TABLE "return" ALTER COLUMN "status" DROP DEFAULT; |
|
11
|
ALTER TABLE "return" ALTER COLUMN "status" TYPE text USING "status"::text; |
|
12
|
DROP TYPE return_status_enum; |
|
13
|
|
|
14
|
CREATE TYPE return_status_enum AS ENUM ( |
|
15
|
'open', |
|
16
|
'requested', |
|
17
|
'received', |
|
18
|
'partially_received', |
|
19
|
'canceled' |
|
20
|
); |
|
21
|
|
|
22
|
ALTER TABLE "return" ALTER COLUMN "status" TYPE return_status_enum USING "status"::text::return_status_enum; |
|
23
|
ALTER TABLE "return" ALTER COLUMN "status" SET DEFAULT 'open'; |
|
24
|
`) |
|
25
|
} |
|
26
|
} |