mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
add migration for removing pubkey_domains table
This commit is contained in:
parent
e25372313b
commit
e037ccc7ed
1 changed files with 25 additions and 0 deletions
25
src/db/migrations/018_remove_pubkey_domains.ts
Normal file
25
src/db/migrations/018_remove_pubkey_domains.ts
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
import { Kysely } from 'kysely';
|
||||||
|
|
||||||
|
export async function up(db: Kysely<any>): Promise<void> {
|
||||||
|
await db.schema
|
||||||
|
.dropTable('pubkey_domains')
|
||||||
|
.ifExists()
|
||||||
|
.execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function down(db: Kysely<any>): Promise<void> {
|
||||||
|
await db.schema
|
||||||
|
.createTable('pubkey_domains')
|
||||||
|
.ifNotExists()
|
||||||
|
.addColumn('pubkey', 'text', (col) => col.primaryKey())
|
||||||
|
.addColumn('domain', 'text', (col) => col.notNull())
|
||||||
|
.addColumn('last_updated_at', 'integer', (col) => col.notNull().defaultTo(0))
|
||||||
|
.execute();
|
||||||
|
|
||||||
|
await db.schema
|
||||||
|
.createIndex('pubkey_domains_domain_index')
|
||||||
|
.on('pubkey_domains')
|
||||||
|
.column('domain')
|
||||||
|
.ifNotExists()
|
||||||
|
.execute();
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue