import { BaseSchema } from '@adonisjs/lucid/schema' /** * Spot details (CONCEPT.md D29): the description and image from the spot's * full header. Stored whenever the header is read (recent spots, moderation, * downloads); for other old spots on first view. `details_at` marks the read. */ export default class extends BaseSchema { async up() { this.schema.alterTable('spots', (table) => { table.text('description') table.jsonb('image') table.timestamp('details_at', { useTz: true }) }) } async down() { this.schema.alterTable('spots', (table) => { table.dropColumn('description') table.dropColumn('image') table.dropColumn('details_at') }) } }