feat: add migration for 'zaps_amount' column

This commit is contained in:
P. Reis 2024-06-08 08:57:16 -03:00
parent 6024586b19
commit 1f4de9aed0
1 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,12 @@
import { Kysely } from 'kysely';
export async function up(db: Kysely<any>): Promise<void> {
await db.schema
.alterTable('event_stats')
.addColumn('zaps_amount', 'integer', (col) => col.notNull().defaultTo(0))
.execute();
}
export async function down(db: Kysely<any>): Promise<void> {
await db.schema.alterTable('event_stats').dropColumn('zaps_amount').execute();
}