Skip to content

Commit

Permalink
[FEATURE] Créer la nouvelle table user-logins (PIX-6392)
Browse files Browse the repository at this point in the history
  • Loading branch information
pix-service-auto-merge authored Nov 24, 2022
2 parents d8f2c27 + 703ead3 commit d0e0ab5
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions api/db/migrations/20221124093117_create-user-logins-table.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const TABLE_NAME = 'user-logins';

exports.up = (knex) => {
return knex.schema.createTable(TABLE_NAME, (t) => {
t.bigIncrements().primary();
t.bigInteger('userId').references('users.id').notNullable().unique();
t.dateTime('createdAt').notNullable().defaultTo(knex.fn.now());
t.dateTime('updatedAt').notNullable().defaultTo(knex.fn.now());
t.dateTime('blockedAt').nullable();
t.dateTime('temporaryBlockedUntil').nullable();
t.integer('failureCount').notNullable().defaultTo(0);
});
};

exports.down = (knex) => {
return knex.schema.dropTable(TABLE_NAME);
};

0 comments on commit d0e0ab5

Please sign in to comment.