mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
21 lines
584 B
TypeScript
21 lines
584 B
TypeScript
import type { Kysely } from 'kysely';
|
|
|
|
export async function up(db: Kysely<unknown>): Promise<void> {
|
|
await db.schema
|
|
.createTable('pubkey_domains')
|
|
.ifNotExists()
|
|
.addColumn('pubkey', 'text', (col) => col.primaryKey())
|
|
.addColumn('domain', 'text', (col) => col.notNull())
|
|
.execute();
|
|
|
|
await db.schema
|
|
.createIndex('pubkey_domains_domain_index')
|
|
.on('pubkey_domains')
|
|
.column('domain')
|
|
.ifNotExists()
|
|
.execute();
|
|
}
|
|
|
|
export async function down(db: Kysely<unknown>): Promise<void> {
|
|
await db.schema.dropTable('pubkey_domains').execute();
|
|
}
|