17 lines
465 B
TypeScript
17 lines
465 B
TypeScript
import { BaseSchema } from "@adonisjs/lucid/schema"
|
|
|
|
export default class CreatePagesTable extends BaseSchema {
|
|
protected tableName = "pages"
|
|
|
|
public override async up(): Promise<void> {
|
|
void this.schema.createTable(this.tableName, (table) => {
|
|
table.increments("id").notNullable()
|
|
table.string("title", 255).notNullable().unique()
|
|
})
|
|
}
|
|
|
|
public override async down(): Promise<void> {
|
|
void this.schema.dropTable(this.tableName)
|
|
}
|
|
}
|