mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
Add unique index on push_subscriptions token_hash
This commit is contained in:
parent
4019099c57
commit
94d8d43d78
1 changed files with 7 additions and 0 deletions
|
|
@ -13,6 +13,13 @@ export async function up(db: Kysely<any>): Promise<void> {
|
||||||
.addColumn('created_at', 'timestamp', (c) => c.notNull().defaultTo(sql`CURRENT_TIMESTAMP`))
|
.addColumn('created_at', 'timestamp', (c) => c.notNull().defaultTo(sql`CURRENT_TIMESTAMP`))
|
||||||
.addColumn('updated_at', 'timestamp', (c) => c.notNull().defaultTo(sql`CURRENT_TIMESTAMP`))
|
.addColumn('updated_at', 'timestamp', (c) => c.notNull().defaultTo(sql`CURRENT_TIMESTAMP`))
|
||||||
.execute();
|
.execute();
|
||||||
|
|
||||||
|
await db.schema
|
||||||
|
.createIndex('push_subscriptions_token_hash_idx')
|
||||||
|
.on('push_subscriptions')
|
||||||
|
.column('token_hash')
|
||||||
|
.unique()
|
||||||
|
.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function down(db: Kysely<any>): Promise<void> {
|
export async function down(db: Kysely<any>): Promise<void> {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue