class BillingInvoicesManualFlow < ActiveRecord::Migration[7.2]
  def change
    change_column_default :billing_invoices, :source, from: "aruba", to: "manual"
    change_column_default :billing_invoices, :status, from: "issued", to: "draft"

    add_column :billing_invoices, :emailed_at, :datetime
    add_index :billing_invoices, :billing_payment_id,
              unique: true,
              where: "billing_payment_id IS NOT NULL",
              name: "index_billing_invoices_unique_payment"
  end
end
