2017-08-20 17:09:25 +00:00
|
|
|
'use strict'
|
|
|
|
|
|
|
|
const Schema = use('Schema')
|
|
|
|
|
|
|
|
class UserSchema extends Schema {
|
|
|
|
up () {
|
2018-05-21 21:37:14 +00:00
|
|
|
this.create('users', (table) => {
|
2017-08-20 17:09:25 +00:00
|
|
|
table.increments()
|
|
|
|
table.string('username', 80).notNullable().unique()
|
|
|
|
table.string('email', 254).notNullable().unique()
|
|
|
|
table.string('password', 60).notNullable()
|
|
|
|
table.timestamps()
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
down () {
|
|
|
|
this.drop('users')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = UserSchema
|