mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 03:19:46 +00:00
Use char(64) for stats primary keys
This commit is contained in:
parent
e27c1519fb
commit
2b2cdca282
1 changed files with 11 additions and 0 deletions
11
src/db/migrations/036_stats64.ts
Normal file
11
src/db/migrations/036_stats64.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import { Kysely } from 'kysely';
|
||||
|
||||
export async function up(db: Kysely<any>): Promise<void> {
|
||||
await db.schema.alterTable('author_stats').alterColumn('pubkey', (col) => col.setDataType('char(64)')).execute();
|
||||
await db.schema.alterTable('event_stats').alterColumn('event_id', (col) => col.setDataType('char(64)')).execute();
|
||||
}
|
||||
|
||||
export async function down(db: Kysely<any>): Promise<void> {
|
||||
await db.schema.alterTable('author_stats').alterColumn('pubkey', (col) => col.setDataType('text')).execute();
|
||||
await db.schema.alterTable('event_stats').alterColumn('event_id', (col) => col.setDataType('text')).execute();
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue