Skip to content

Instantly share code, notes, and snippets.

@simonjcarr
Created August 24, 2020 11:36
Show Gist options
  • Save simonjcarr/2781022f58d26af5278edb92adb50aab to your computer and use it in GitHub Desktop.
Save simonjcarr/2781022f58d26af5278edb92adb50aab to your computer and use it in GitHub Desktop.
'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('first_name', 50)
table.string('last_name', 50)
table.string('password', 60).notNullable()
table.timestamps()
})
}
down () {
this.drop('users')
}
}
module.exports = UserSchema
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment