Created
August 24, 2020 11:36
-
-
Save simonjcarr/2781022f58d26af5278edb92adb50aab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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