mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
Recreate nip46_tokens in down migration
This commit is contained in:
parent
432857c2ff
commit
ff361a4106
1 changed files with 10 additions and 0 deletions
|
|
@ -49,4 +49,14 @@ export async function up(db: Kysely<DB>): Promise<void> {
|
||||||
|
|
||||||
export async function down(db: Kysely<DB>): Promise<void> {
|
export async function down(db: Kysely<DB>): Promise<void> {
|
||||||
await db.schema.dropTable('auth_tokens').execute();
|
await db.schema.dropTable('auth_tokens').execute();
|
||||||
|
|
||||||
|
await db.schema
|
||||||
|
.createTable('nip46_tokens')
|
||||||
|
.addColumn('api_token', 'text', (col) => col.primaryKey().unique().notNull())
|
||||||
|
.addColumn('user_pubkey', 'text', (col) => col.notNull())
|
||||||
|
.addColumn('server_seckey', 'bytea', (col) => col.notNull())
|
||||||
|
.addColumn('server_pubkey', 'text', (col) => col.notNull())
|
||||||
|
.addColumn('relays', 'text', (col) => col.defaultTo('[]'))
|
||||||
|
.addColumn('connected_at', 'timestamp', (col) => col.defaultTo(sql`CURRENT_TIMESTAMP`))
|
||||||
|
.execute();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue