Skip to content

Commit 50e816d

Browse files
committed
migration to add locked row to user table
1 parent 33129b9 commit 50e816d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { Knex } from 'knex';
2+
3+
export async function up(knex: Knex): Promise<void> {
4+
await knex.schema.alterTable('users', (table) => {
5+
table.boolean('locked').defaultTo(false).notNullable();
6+
});
7+
await knex('users').update({ locked: false });
8+
}
9+
10+
export async function down(knex: Knex): Promise<void> {
11+
await knex.schema.alterTable('users', (table) => {
12+
table.dropColumn('locked');
13+
});
14+
}

0 commit comments

Comments
 (0)