Skip to content

Instantly share code, notes, and snippets.

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