<%
'=======================================================================================================================
' MIGRATION: add_blue_office_copies_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)
    ' Blue AV Envelope section - "would you like additional office copies when ordering
    ' KCI envelopes?" Only asked when BlueWantsQuote = true, so it must tolerate NULL like
    ' BlueHasNonprofitStatus does - kept as VARCHAR rather than YESNO, which can't store NULL.
    migration.AddColumn "OrderDetails", "BlueWantsOfficeCopies", "VARCHAR(10)"
    migration.AddColumn "OrderDetails", "BlueOfficeCopiesQty", "INTEGER"
End Sub

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