generated from shillerben/adonis-fullstack-app
23 lines
473 B
JavaScript
23 lines
473 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('username', 80).notNullable().unique()
|
|
table.string('email', 254).notNullable().unique()
|
|
table.string('password', 60).notNullable()
|
|
table.timestamps()
|
|
})
|
|
}
|
|
|
|
down () {
|
|
this.drop('users')
|
|
}
|
|
}
|
|
|
|
module.exports = UserSchema
|