Created
April 4, 2020 20:05
-
-
Save nemrosim/c50c6b696438f23d552ceb8174c33ecf to your computer and use it in GitHub Desktop.
First user schema
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
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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment