Skip to content

Commit

Permalink
Add migration for dropping table migrations_tenants (#209)
Browse files Browse the repository at this point in the history
* Add migration for dropping table migrations_tenants

* migration down create table
  • Loading branch information
jhoncool authored Nov 18, 2024
1 parent 236fe58 commit 62ba9dd
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/db/migrations/20241115145845_drop_table_migrations_tenants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import {Knex} from 'knex';

export async function up(knex: Knex): Promise<void> {
return knex.raw(`
DROP TABLE migrations_tenants;
`);
}

export async function down(knex: Knex): Promise<void> {
return knex.raw(`
CREATE TABLE migrations_tenants (
from_id TEXT NOT NULL,
to_id TEXT NOT NULL,
migrating BOOLEAN NOT NULL DEFAULT TRUE,
migration_meta JSONB NOT NULL DEFAULT '{}'::jsonb,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
PRIMARY KEY (from_id, to_id)
);
`);
}

0 comments on commit 62ba9dd

Please sign in to comment.