<%
'=======================================================================================================================
' MIGRATION: create_orders_table
'=======================================================================================================================

Sub Migration_Up(migration)
    migration.CreateTable "Orders", _
        "OrderID COUNTER PRIMARY KEY, " & _
        "Email VARCHAR(255) NOT NULL, " & _
        "JurisdictionNumber VARCHAR(50) NOT NULL, " & _
        "Token VARCHAR(36) NOT NULL, " & _
        "TokenExpiresAt DATETIME NOT NULL, " & _
        "TokenUsedAt DATETIME, " & _
        "CreatedAt DATETIME NOT NULL"

    migration.CreateIndex "IX_Orders_Token", "Orders", "Token"
End Sub

Sub Migration_Down(migration)
    migration.DropIndex "IX_Orders_Token", "Orders"
    migration.DropTable "Orders"
End Sub
%>
