From 84ff2241ba81fc6a1a2201074d30f971dad8a0de Mon Sep 17 00:00:00 2001 From: Pitu Date: Wed, 18 Jan 2017 02:40:14 -0300 Subject: Shit ton of things on this update --- database/db.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'database') diff --git a/database/db.js b/database/db.js index 6c4889b..b22ce51 100644 --- a/database/db.js +++ b/database/db.js @@ -5,7 +5,7 @@ let init = function(db, config){ db.schema.createTableIfNotExists('albums', function (table) { table.increments() table.string('name') - table.timestamps() + table.integer('timestamp') }).then(() => {}) db.schema.createTableIfNotExists('files', function (table) { @@ -16,13 +16,13 @@ let init = function(db, config){ table.string('size') table.string('ip') table.integer('albumid') - table.timestamps() + table.integer('timestamp') }).then(() => {}) db.schema.createTableIfNotExists('tokens', function (table) { table.string('name') table.string('value') - table.timestamps() + table.integer('timestamp') }).then(() => { // == Generate a 1 time token == // @@ -32,16 +32,19 @@ let init = function(db, config){ // This is the first launch of the app let clientToken = require('randomstring').generate() let adminToken = require('randomstring').generate() + let now = Math.floor(Date.now() / 1000) db.table('tokens').insert( [ { name: 'client', - value: clientToken + value: clientToken, + timestamp: now }, { name: 'admin', - value: adminToken + value: adminToken, + timestamp: now } ] ).then(() => { -- cgit v1.2.3