Drop deleted_at column

This commit is contained in:
Alex Gleason 2024-05-15 08:08:30 -05:00
parent 137bd0dae0
commit 171350a34d
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
2 changed files with 10 additions and 1 deletions

View File

@ -30,7 +30,6 @@ interface EventRow {
created_at: number;
tags: string;
sig: string;
deleted_at: number | null;
}
interface EventFTSRow {

View File

@ -0,0 +1,10 @@
import { Kysely } from 'kysely';
export async function up(db: Kysely<any>): Promise<void> {
await db.deleteFrom('nostr_events').where('deleted_at', 'is not', 'null').execute();
await db.schema.alterTable('nostr_events').dropColumn('deleted_at').execute();
}
export async function down(db: Kysely<any>): Promise<void> {
await db.schema.alterTable('nostr_events').addColumn('deleted_at', 'integer').execute();
}