import FluentKit /// Adds the declared defects and the photos to listings. /// /// Registered ahead of ``SeedCatalogue``, whose model writes both columns. struct AddListingDeclarations: AsyncMigration { // MARK: Methods func prepare(on database: Database) async throws { // One column per update: SQLite adds no more in a single statement. try await database.schema(ListingRecord.schema) .field("defects", .string) .update() try await database.schema(ListingRecord.schema) .field("photos", .string) .update() } func revert(on database: Database) async throws { try await database.schema(ListingRecord.schema) .deleteField("photos") .update() try await database.schema(ListingRecord.schema) .deleteField("defects") .update() } }