<%
'=======================================================================================================================
' MIGRATION: add_mailing_nonprofit_auth_code_fields
'=======================================================================================================================
' This migration was auto-generated. Add your migration logic below.
'
' The migration object provides these helper methods:
'   - migration.ExecuteSQL(sql)                              - Execute raw SQL
'   - migration.CreateTable(name, columns)                   - Create a table
'   - migration.DropTable(name)                              - Drop a table
'   - migration.AddColumn(table, column, type)               - Add a column
'   - migration.DropColumn(table, column)                    - Drop a column
'   - migration.CreateIndex(name, table, columns)            - Create an index
'   - migration.DropIndex(name, table)                       - Drop an index
'
' For complex operations, use migration.DB to access the database directly:
'   migration.DB.Execute "INSERT INTO users (name) VALUES (?)", Array("John")
'

'-----------------------------------------------------------------------------------------------------------------------
' UP - Apply the migration
'-----------------------------------------------------------------------------------------------------------------------
Sub Migration_Up(migration)
    ' Ballot Mailing Service section (Q4) gains an auth-code follow-up to "Do you have
    ' Nonprofit Status with the USPS?", mirroring the Blue AV Envelope section, plus an
    ' "I don't know" checkbox that lets the applicant skip providing the code.
    migration.AddColumn "OrderDetails", "MailingNonprofitAuthCode", "VARCHAR(100)"
    migration.AddColumn "OrderDetails", "MailingNonprofitAuthCodeUnknown", "YESNO"
End Sub

'-----------------------------------------------------------------------------------------------------------------------
' DOWN - Rollback the migration
'-----------------------------------------------------------------------------------------------------------------------
Sub Migration_Down(migration)
    migration.DropColumn "OrderDetails", "MailingNonprofitAuthCodeUnknown"
    migration.DropColumn "OrderDetails", "MailingNonprofitAuthCode"
End Sub
%>
