-
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy path20190611171759_initial.ts
More file actions
26 lines (21 loc) · 845 Bytes
/
20190611171759_initial.ts
File metadata and controls
26 lines (21 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { type Kysely, sql } from "kysely"
export async function up(db: Kysely<unknown>): Promise<void> {
await sql`PRAGMA journal_mode=WAL`.execute(db)
await db.schema
.createTable("relations")
.ifNotExists()
// Original columns
.addColumn("anilist", "integer", (col) => col.unique())
.addColumn("anidb", "integer", (col) => col.unique())
.addColumn("myanimelist", "integer", (col) => col.unique())
.addColumn("kitsu", "integer", (col) => col.unique())
// v2 columns
.addColumn("anime-planet", "text", (col) => col.unique())
.addColumn("anisearch", "integer", (col) => col.unique())
.addColumn("imdb", "text")
.addColumn("livechart", "integer", (col) => col.unique())
.addColumn("notify-moe", "text", (col) => col.unique())
.addColumn("themoviedb", "integer")
.addColumn("thetvdb", "integer")
.execute()
}