mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-01 04:34:24 +01:00
feat: add migration for 'zaps_amount' column
This commit is contained in:
12
src/db/migrations/025_event_stats_add_zap_count.ts
Normal file
12
src/db/migrations/025_event_stats_add_zap_count.ts
Normal 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();
|
||||
}
|
||||
Reference in New Issue
Block a user