Skip to content

Commit 8ed444c

Browse files
committed
chore: Another way to create enumerations
1 parent b6cfd44 commit 8ed444c

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

.github/workflows/ci.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ jobs:
4949
- name: Install dependencies
5050
run: pnpm install
5151

52-
- name: Execute SQL script
53-
run: |
54-
psql -U test -d earthworm_test -h localhost -p 5480 -f /packages/db/init.sql
55-
5652
- name: Run database initialization command
5753
run: pnpm db:init:test:ci
5854

packages/db/init.sql

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/db/src/migrate.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
import { sql } from "drizzle-orm";
12
import { migrate } from "drizzle-orm/postgres-js/migrator";
23

34
import { db } from "./db";
45

56
async function main() {
67
console.log("Running your migrations...");
7-
8+
// 创建一个枚举类型
9+
await db.execute(sql`CREATE TYPE membership_type AS ENUM ('regular', 'premium');`);
810
await migrate(db, { migrationsFolder: "drizzle" });
911
console.log("Woohoo! Migrations completed!");
1012
return;

0 commit comments

Comments
 (0)