mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-18 14:07:55 +01:00
23 lines
574 B
TypeScript
23 lines
574 B
TypeScript
import BaseSchema from '@ioc:Adonis/Lucid/Schema'
|
|
|
|
export default class Maintenances extends BaseSchema {
|
|
protected tableName = 'maintenances'
|
|
|
|
public async up() {
|
|
this.schema.createTable(this.tableName, (table) => {
|
|
table.increments('id').primary()
|
|
table.boolean('active').defaultTo(false).notNullable()
|
|
table
|
|
.integer('reason_id')
|
|
.unsigned()
|
|
.references('translations.id')
|
|
.onDelete('CASCADE')
|
|
table.timestamps(true, true)
|
|
})
|
|
}
|
|
|
|
public async down() {
|
|
this.schema.dropTable(this.tableName)
|
|
}
|
|
}
|