ImportBoardgames
struct ImportBoardgames : AsyncMigration
A Migration that imports the Games Catalog JSON file.
This file is located in the seeds/ subdirectory of the project.
-
prepare(on:Asynchronous) Required by
Migrationprotocol. Reads either a test or production.icsfile in theseeds/subdirectory, converts the lines into elements of an array, hands that off to a parser and populates theEventdatabase with the[Event]array returned.Requires
schedule.icsfile in seeds subdirectory.Declaration
Swift
func prepare(on database: Database) async throwsParameters
databaseA connection to the database, provided automatically.
Return Value
Void.
-
revert(on:Asynchronous) Required by
Migrationprotocol.Declaration
Swift
func revert(on database: Database) async throwsParameters
databaseA connection to the database, provided automatically.
Return Value
Void.
View on GitHub