Fork of github.com/did-method-plc/did-method-plc
1import { Kysely } from 'kysely' 2 3export async function up(db: Kysely<unknown>): Promise<void> { 4 await db.schema 5 .createTable('operations') 6 .addColumn('did', 'varchar', (col) => col.notNull()) 7 .addColumn('operation', 'text', (col) => col.notNull()) 8 .addColumn('cid', 'varchar', (col) => col.notNull()) 9 .addColumn('nullified', 'int2', (col) => col.defaultTo(0)) 10 .addColumn('createdAt', 'varchar', (col) => col.notNull()) 11 .addPrimaryKeyConstraint('primary_key', ['did', 'cid']) 12 .execute() 13} 14 15export async function down(db: Kysely<unknown>): Promise<void> { 16 await db.schema.dropTable('operations').execute() 17}