seepur/database/migrations/1586821478599_book_schema.js

25 lines
525 B
JavaScript
Raw Normal View History

2020-04-14 00:56:04 +00:00
'use strict'
/** @type {import('@adonisjs/lucid/src/Schema')} */
const Schema = use('Schema')
class BookSchema extends Schema {
up() {
this.create('books', (table) => {
table.increments()
table.bigInteger('user_id');
table.string('title', 80).notNullable();
2020-04-14 00:56:04 +00:00
table.integer('pages').notNullable();
table.string('book_folder').notNullable();
table.boolean('ltr').default(true);
2020-04-14 00:56:04 +00:00
table.timestamps()
})
}
down() {
this.drop('books')
}
}
module.exports = BookSchema