mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
Drop deleted_at column
This commit is contained in:
parent
137bd0dae0
commit
171350a34d
2 changed files with 10 additions and 1 deletions
|
|
@ -30,7 +30,6 @@ interface EventRow {
|
||||||
created_at: number;
|
created_at: number;
|
||||||
tags: string;
|
tags: string;
|
||||||
sig: string;
|
sig: string;
|
||||||
deleted_at: number | null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface EventFTSRow {
|
interface EventFTSRow {
|
||||||
|
|
|
||||||
10
src/db/migrations/020_drop_deleted_at.ts
Normal file
10
src/db/migrations/020_drop_deleted_at.ts
Normal 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();
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue