19 lines
573 B
TypeScript
19 lines
573 B
TypeScript
import { BaseSchema } from '@adonisjs/lucid/schema'
|
|
|
|
export default class extends BaseSchema {
|
|
protected tableName = 'keywords'
|
|
|
|
async up() {
|
|
this.schema.createTable(this.tableName, (table) => {
|
|
table.increments('id').primary()
|
|
table.string('keyword', 255).notNullable().unique()
|
|
table.boolean('is_active').notNullable().defaultTo(true)
|
|
table.timestamp('created_at', { useTz: true }).notNullable()
|
|
table.timestamp('updated_at', { useTz: true }).notNullable()
|
|
})
|
|
}
|
|
|
|
async down() {
|
|
this.schema.dropTable(this.tableName)
|
|
}
|
|
} |