Add initial project files

This commit is contained in:
Igor Martyniuk
2026-09-01 13:03:41 +03:00
parent 22e111bb44
commit 74cb5b6176
1841 changed files with 242819 additions and 30 deletions
@@ -0,0 +1,29 @@
import { BaseSchema } from '@adonisjs/lucid/schema'
export default class extends BaseSchema {
protected tableName = 'admins'
async up() {
await this.schema.raw('DROP TYPE IF EXISTS admin_status_enum')
this.schema.createTable(this.tableName, (table) => {
table.increments('id').notNullable()
table.string('email').notNullable().unique()
table.string('password').notNullable()
table.string('first_name').nullable()
table.string('last_name').nullable()
table
.enu('status', ['active', 'inactive'], {
useNative: true,
enumName: 'admin_status_enum',
})
.notNullable()
.defaultTo('active')
table.timestamp('created_at').notNullable()
table.timestamp('updated_at').nullable()
})
}
async down() {
this.schema.dropTable(this.tableName)
}
}