import { BaseSchema } from '@adonisjs/lucid/schema' /** * Where a release's archive password came from: `nzb` (the NZB's * ``) or `spot` (the spot's title or description). */ export default class extends BaseSchema { async up() { this.schema.alterTable('releases', (table) => table.string('password_source', 8)) this.schema.raw(`UPDATE releases SET password_source = 'nzb' WHERE password IS NOT NULL`) } async down() { this.schema.alterTable('releases', (table) => table.dropColumn('password_source')) } }