import * as Knex from 'knex' ; const signingWallet = 'signing_wallets' ; const enforceOneRow = 'enforce_one_row' ; export async function up ( knex ) { await knex . schema . alterTable ( signingWallet , table => table . integer ( enforceOneRow ) . unique ( enforceOneRow ) . notNullable ( ) . defaultTo ( 1 ) ) ; await knex . raw ( `\
    ALTER TABLE ${ signingWallet }
    ADD CONSTRAINT one_row_constraint
    CHECK (
      ${ enforceOneRow } = 1
    )
  ` ) ; } export async function down ( knex ) { await knex . schema . alterTable ( signingWallet , table => table . dropColumn ( enforceOneRow ) ) ; }