added login / logout functionality and authorization rules via bouncer
This commit is contained in:
23
database/migrations/1634474414234_users.ts
Normal file
23
database/migrations/1634474414234_users.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import Hash from '@ioc:Adonis/Core/Hash'
|
||||
import BaseSchema from '@ioc:Adonis/Lucid/Schema'
|
||||
import User from 'App/Models/User'
|
||||
|
||||
export default class Users extends BaseSchema {
|
||||
protected tableName = 'users'
|
||||
|
||||
public async up () {
|
||||
this.schema.alterTable(this.tableName, (table) => {
|
||||
table.boolean('is_active').defaultTo(false)
|
||||
table.string('role')
|
||||
.defaultTo('employee')
|
||||
.notNullable()
|
||||
})
|
||||
}
|
||||
|
||||
public async down () {
|
||||
this.schema.alterTable(this.tableName, (table) => {
|
||||
table.dropColumn('is_active')
|
||||
table.dropColumn('role')
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user