SetInitialEventForums

struct SetInitialEventForums : AsyncMigration

A Migration that creates Forums for each Event in the schedule.

  • prepare(on:) Asynchronous

    Required by Migration protocol. Creates a set of forums for the schedule events.

    Declaration

    Swift

    func prepare(on database: Database) async throws

    Parameters

    database

    A connection to the database, provided automatically.

    Return Value

    Void.

  • revert(on:) Asynchronous

    Deletes all the event forums created by this migration.

    Declaration

    Swift

    func revert(on database: Database) async throws

    Parameters

    database

    A connection to the database, provided automatically.

    Return Value

    Void.

  • Declaration

    Swift

    static func buildEventForum(_ event: Event, creatorID: UUID, shadowCategory: Category, officialCategory: Category)
    	throws -> Forum
  • Builds a text string for posting to the Events forum thread for an Event. This post is created by admin. On initial Events migration, each Event gets a thread in the Events category associated with it, and each thread gets an initial post.

    Declaration

    Swift

    static func buildEventPostText(_ event: Event) -> String

    Parameters

    event

    The event for which to produce a blurb.

    Return Value

    A string suitable for adding to a ForumPost, describing the event.