mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 03:19:46 +00:00
feat: add migration for 'zaps_amount' column
This commit is contained in:
parent
6024586b19
commit
1f4de9aed0
1 changed files with 12 additions and 0 deletions
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();
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue