Scratch space for learning atproto app development
1import type { Kysely, Migration, MigrationProvider } from 'kysely'
2
3const migrations: Record<string, Migration> = {}
4
5export const migrationProvider: MigrationProvider = {
6 async getMigrations() {
7 return migrations
8 },
9}
10
11migrations['001'] = {
12 async up(db: Kysely<unknown>) {
13 await db.schema
14 .createTable('post')
15 .addColumn('uri', 'varchar', (col) => col.primaryKey())
16 .addColumn('text', 'varchar', (col) => col.notNull())
17 .addColumn('indexedAt', 'varchar', (col) => col.notNull())
18 .execute()
19 },
20 async down(db: Kysely<unknown>) {
21 await db.schema.dropTable('post').execute()
22 },
23}