summaryrefslogtreecommitdiffstats
path: root/backend/migrations/20200201153559_tokens.js
diff options
context:
space:
mode:
Diffstat (limited to 'backend/migrations/20200201153559_tokens.js')
-rw-r--r--backend/migrations/20200201153559_tokens.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/backend/migrations/20200201153559_tokens.js b/backend/migrations/20200201153559_tokens.js
new file mode 100644
index 0000000..70593fc
--- /dev/null
+++ b/backend/migrations/20200201153559_tokens.js
@@ -0,0 +1,14 @@
+exports.up = function(knex) {
+ return knex.schema.createTable('tokens', function(table) {
+ table.increments();
+ table.integer('user_id').unsigned().notNullable();
+ table.foreign('user_id').references('users.id');
+ table.enu('type', [ 'session' ]).notNullable();
+ table.string('value').notNullable();
+ table.timestamps(true, true);
+ });
+};
+
+exports.down = function(knex) {
+ return knex.schema.dropTable('tokens');
+};