2020-01-14 01:57:43 +00:00
|
|
|
'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()
|
2020-01-18 20:46:06 +00:00
|
|
|
table.string('name').notNullable()
|
2020-01-14 01:57:43 +00:00
|
|
|
table.string('password', 60).notNullable()
|
2020-01-18 20:46:06 +00:00
|
|
|
table.string('avatar')
|
2020-01-14 01:57:43 +00:00
|
|
|
table.timestamps()
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
down () {
|
|
|
|
this.drop('users')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = UserSchema
|