|
|
@@ -0,0 +1,15 @@
|
|
|
+import BaseSchema from '@ioc:Adonis/Lucid/Schema'
|
|
|
+
|
|
|
+export default class extends BaseSchema {
|
|
|
+ protected tableName = 'users'
|
|
|
+
|
|
|
+ public async up () {
|
|
|
+ this.schema.alterTable(this.tableName, (table) => {
|
|
|
+ table.enum('role', ['admin', 'user', 'api']).defaultTo('user').nullable().alter()
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ public async down () {
|
|
|
+ this.schema.dropTable(this.tableName)
|
|
|
+ }
|
|
|
+}
|