mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-20 00:37:26 +00:00
15 lines
425 B
Ruby
15 lines
425 B
Ruby
# frozen_string_literal: true
|
|
|
|
class SetDefaultInvoiceStatus < ActiveRecord::Migration[7.0]
|
|
def change
|
|
add_column :invoices, :cancelled, :boolean, default: false, null: false
|
|
ActiveRecord::Base.connection.execute(<<-SQL.squish
|
|
UPDATE invoices
|
|
SET cancelled = true
|
|
WHERE status = 'inactive'
|
|
SQL
|
|
)
|
|
remove_column :invoices, :status, :string
|
|
end
|
|
end
|