summaryrefslogtreecommitdiffstats
path: root/backend/migrations/20200201153559_tokens.js
diff options
context:
space:
mode:
authorJan Tuomi <jan.tuomi@eficode.com>2020-02-01 16:33:56 +0200
committerJan Tuomi <jan.tuomi@eficode.com>2020-02-01 16:33:56 +0200
commita5ae2653d8ccdaf00270c0c8c8a30b88d7955114 (patch)
treebd265901dbda512fb1f6d717beb545234468d7ec /backend/migrations/20200201153559_tokens.js
parentfbf108595a00a7c9db5984158e4b02cc345b68d1 (diff)
Do stuff
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');
+};