import FluentKit import Foundation /// Re-dates the demo cons from the first weekend after it runs, for databases seeded when ``CreateCommunity`` used fixed dates. struct RedateEvents: AsyncMigration { // MARK: Methods func prepare(on database: Database) async throws { for (event, _) in Seed.events(after: .init()) { try await EventRecord.query(on: database) .filter(\.$slug == event.slug) .set(\.$startsOn, to: event.startsOn) .set(\.$endsOn, to: event.endsOn) .update() } } func revert(on database: Database) async throws {} }