22 lines
676 B
TypeScript
22 lines
676 B
TypeScript
import { BaseSchema } from '@adonisjs/lucid/schema'
|
|
|
|
export default class extends BaseSchema {
|
|
protected tableName = 'web_settings'
|
|
|
|
async up() {
|
|
this.schema.createTable(this.tableName, (table) => {
|
|
table.increments('id')
|
|
table.string('locale', 16).notNullable().unique()
|
|
table.jsonb('header').notNullable().defaultTo('{}')
|
|
table.jsonb('footer').notNullable().defaultTo('{}')
|
|
table.jsonb('legal').notNullable().defaultTo('{}')
|
|
table.timestamp('created_at', { useTz: true }).notNullable()
|
|
table.timestamp('updated_at', { useTz: true }).notNullable()
|
|
})
|
|
}
|
|
|
|
async down() {
|
|
this.schema.dropTable(this.tableName)
|
|
}
|
|
}
|