seepur/database/migrations/1503248427885_user.js
2020-04-12 10:25:42 -04:00

26 lines
659 B
JavaScript

'use strict'
/** @type {import('@adonisjs/lucid/src/Schema')} */
const Schema = use('Schema')
class UserSchema extends Schema {
up() {
this.create('users', (table) => {
table.increments();
table.string('email', 254).notNullable().unique();
table.string('name').notNullable();
table.string('password', 60).notNullable();
table.string('avatar');
table.string('profile_cover');
table.boolean('is_admin').defaultTo(false).notNullable();
table.datetime('last_logged_in').defaultTo(null).nullable();
table.timestamps();
});
}
down() {
this.drop('users');
}
}
module.exports = UserSchema