usenet-indexer/database/migrations/1768620764710_create_files_table.ts

25 lines
674 B
TypeScript

import { BaseSchema } from '@adonisjs/lucid/schema'
export default class extends BaseSchema {
protected tableName = 'files'
async up() {
this.schema.createTable(this.tableName, (table) => {
table.increments('id').primary()
table.string('filename').notNullable()
table.string('poster').notNullable()
table.bigInteger('date').notNullable()
table.integer('parts').notNullable()
table.jsonb('message_ids').notNullable()
table.jsonb('groups')
table.timestamp('created_at', { useTz: true })
table.timestamp('updated_at', { useTz: true })
})
}
async down() {
this.schema.dropTable(this.tableName)
}
}