File tree Expand file tree Collapse file tree 3 files changed +3
-6
lines changed Expand file tree Collapse file tree 3 files changed +3
-6
lines changed Original file line number Diff line number Diff line change 49
49
- name : Install dependencies
50
50
run : pnpm install
51
51
52
- - name : Execute SQL script
53
- run : |
54
- psql -U test -d earthworm_test -h localhost -p 5480 -f /packages/db/init.sql
55
-
56
52
- name : Run database initialization command
57
53
run : pnpm db:init:test:ci
58
54
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ import { sql } from "drizzle-orm" ;
1
2
import { migrate } from "drizzle-orm/postgres-js/migrator" ;
2
3
3
4
import { db } from "./db" ;
4
5
5
6
async function main ( ) {
6
7
console . log ( "Running your migrations..." ) ;
7
-
8
+ // 创建一个枚举类型
9
+ await db . execute ( sql `CREATE TYPE membership_type AS ENUM ('regular', 'premium');` ) ;
8
10
await migrate ( db , { migrationsFolder : "drizzle" } ) ;
9
11
console . log ( "Woohoo! Migrations completed!" ) ;
10
12
return ;
You can’t perform that action at this time.
0 commit comments