import { BaseSchema } from '@adonisjs/lucid/schema' /** * SFV listings (CONCEPT.md D34): the files an SFV names belong to its * release; files arriving later are matched by name. */ export default class extends BaseSchema { async up() { this.schema.createTable('sfv_entries', (table) => { table.bigInteger('release_id').notNullable().references('releases.id').onDelete('CASCADE') table.text('name').notNullable() table.string('crc', 8).notNullable() table.text('poster') table.timestamp('posted_at', { useTz: true }) table.primary(['release_id', 'name']) table.index(['name']) }) } async down() { this.schema.dropTable('sfv_entries') } }