GenerateDiscordRegistrationCodes

struct GenerateDiscordRegistrationCodes : AsyncMigration
  • prepare(on:) Asynchronous

    Required by Migration protocol. Generates 100 unique registration codes and adds them to the regCode table as Discord codes. Members of TwitarrTeam may then hand these codes out to Discord users via Discord private message so that Discord users can then make Twitarr accounts on the public test server.

    These registration codes all have isDiscordUser set to TRUE and should only exist on the public test server, not on production.

    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 registration codes in the “registrationcode” table.

    Declaration

    Swift

    func revert(on database: Database) async throws

    Parameters

    database

    A connection to the database, provided automatically.

    Return Value

    Void.