Add initial project files

This commit is contained in:
Igor Martyniuk
2026-09-01 13:03:41 +03:00
parent 22e111bb44
commit 74cb5b6176
1841 changed files with 242819 additions and 30 deletions
@@ -0,0 +1,29 @@
import { BaseSchema } from '@adonisjs/lucid/schema'
export default class extends BaseSchema {
protected tableName = 'web_components'
async up() {
this.schema.createTable(this.tableName, (table) => {
table.increments('id')
table
.integer('page_id')
.unsigned()
.notNullable()
.references('id')
.inTable('web_pages')
.onDelete('CASCADE')
table.string('type').notNullable()
table.jsonb('data').notNullable()
table.integer('sort_order').unsigned().notNullable().defaultTo(0)
table.timestamp('created_at', { useTz: true }).notNullable()
table.timestamp('updated_at', { useTz: true }).notNullable()
table.index(['page_id', 'sort_order'])
})
}
async down() {
this.schema.dropTable(this.tableName)
}
}