api/database/migrations/1751804567514_create_colle_attachments_table.ts
2025-07-23 00:19:09 +02:00

22 lines
No EOL
532 B
TypeScript

import { BaseSchema } from '@adonisjs/lucid/schema'
export default class extends BaseSchema {
protected tableName = 'colle_attachments'
async up() {
this.schema.createTable(this.tableName, (table) => {
table.increments('id').primary()
table.string('name').notNullable()
table.string('path').notNullable()
table
.integer('colle_id')
.unsigned()
.references('colles.id')
.onDelete('CASCADE')
})
}
async down() {
this.schema.dropTable(this.tableName)
}
}