Added settings API

This commit is contained in:
Sockenklaus
2021-11-12 01:15:40 +01:00
parent 654a829c16
commit ed7120ad2e
10 changed files with 251 additions and 40 deletions

View File

@@ -0,0 +1,29 @@
import BaseSchema from '@ioc:Adonis/Lucid/Schema'
export default class Settings extends BaseSchema {
protected tableName = 'settings'
public async up () {
this.schema.createTable(this.tableName, (table) => {
table.increments('id')
/**
* Uses timestamptz for PostgreSQL and DATETIME2 for MSSQL
*/
table.timestamp('created_at', { useTz: true })
table.timestamp('updated_at', { useTz: true })
table.integer('employee_id')
.unsigned()
.references('employees.id')
.onDelete('CASCADE')
table.string('key')
table.string('value')
})
}
public async down () {
this.schema.dropTable(this.tableName)
}
}