bigint and not timestamp for sails

pull/42/head
unknown 2019-02-26 20:01:56 -05:00
parent b66e5d2c03
commit 4bcb64ed56
2 changed files with 10 additions and 5 deletions

View File

@ -3,7 +3,8 @@ exports.up = function (knex, Promise) {
knex.schema.createTable('user', t => { knex.schema.createTable('user', t => {
t.increments('id').primary() t.increments('id').primary()
t.string('email').notNullable() t.string('email').notNullable()
t.timestamps(true, true) t.bigInteger('created_at')
t.bigInteger('updated_at')
}), }),
knex.schema.createTable('passport', t => { knex.schema.createTable('passport', t => {
t.increments('id').primary() t.increments('id').primary()
@ -14,13 +15,15 @@ exports.up = function (knex, Promise) {
t.string('identifier') t.string('identifier')
t.json('tokens') t.json('tokens')
t.integer('user').notNullable().references('user.id').onDelete('CASCADE').onUpdate('CASCADE') t.integer('user').notNullable().references('user.id').onDelete('CASCADE').onUpdate('CASCADE')
t.timestamps(true, true) t.bigInteger('created_at')
t.bigInteger('updated_at')
}), }),
knex.schema.createTable('targeturl', t => { knex.schema.createTable('targeturl', t => {
t.increments('id').primary() t.increments('id').primary()
t.integer('user').notNullable().references('user.id').onDelete('CASCADE').onUpdate('CASCADE') t.integer('user').notNullable().references('user.id').onDelete('CASCADE').onUpdate('CASCADE')
t.string('url') t.string('url')
t.timestamps(true, true) t.bigInteger('created_at')
t.bigInteger('updated_at')
}), }),
knex.schema.createTable('book', t => { knex.schema.createTable('book', t => {
t.increments('id').primary() t.increments('id').primary()
@ -30,7 +33,8 @@ exports.up = function (knex, Promise) {
t.string('author') t.string('author')
t.string('version') t.string('version')
t.string('isbn') t.string('isbn')
t.timestamps(true, true) t.bigInteger('created_at')
t.bigInteger('updated_at')
}) })
]) ])
} }

View File

@ -13,7 +13,8 @@ exports.up = function (knex, Promise) {
t.string('verification_key') t.string('verification_key')
t.boolean('whitelisted').defaultTo(false) t.boolean('whitelisted').defaultTo(false)
t.boolean('verified').defaultTo(false) t.boolean('verified').defaultTo(false)
t.timestamps(true, true) t.bigInteger('created_at')
t.bigInteger('updated_at')
}) })
]) ])
} }