bigint again

pull/42/head
unknown 2019-02-26 20:00:19 -05:00
parent 0cd614bb2a
commit b66e5d2c03
3 changed files with 17 additions and 10 deletions

View File

@ -3,8 +3,7 @@ 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.integer('created_at') t.timestamps(true, true)
t.integer('updated_at')
}), }),
knex.schema.createTable('passport', t => { knex.schema.createTable('passport', t => {
t.increments('id').primary() t.increments('id').primary()
@ -15,15 +14,13 @@ 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.integer('created_at') t.timestamps(true, true)
t.integer('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.integer('created_at') t.timestamps(true, true)
t.integer('updated_at')
}), }),
knex.schema.createTable('book', t => { knex.schema.createTable('book', t => {
t.increments('id').primary() t.increments('id').primary()
@ -33,8 +30,7 @@ exports.up = function (knex, Promise) {
t.string('author') t.string('author')
t.string('version') t.string('version')
t.string('isbn') t.string('isbn')
t.integer('created_at') t.timestamps(true, true)
t.integer('updated_at')
}) })
]) ])
} }

View File

@ -13,8 +13,7 @@ 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.integer('created_at') t.timestamps(true, true)
t.integer('updated_at')
}) })
]) ])
} }

View File

@ -0,0 +1,12 @@
exports.up = function (knex, Promise) {
return Promise.all([
knex.schema.alterTable('publishkey', t => {
t.bigInteger('created_at').alter()
t.bigInteger('updated_at').alter()
})
])
}
exports.down = function (knex, Promise) {
}