add mutations to exchange painel
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
# frozen_string_literal: true
|
||||
class AddDefaultValueToSellCryptoOrderRecivedAmountCents < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
# rubocop:disable Rails/ReversibleMigration
|
||||
execute(<<-SQL.squish)
|
||||
UPDATE sell_crypto_orders
|
||||
SET received_amount_cents = 0
|
||||
WHERE received_amount_cents IS NULL
|
||||
SQL
|
||||
|
||||
change_column_default(:sell_crypto_orders, :received_amount_cents, from: nil, to: 0)
|
||||
change_column_null(:sell_crypto_orders, :received_amount_cents, false)
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,14 @@
|
||||
# frozen_string_literal: true
|
||||
class AddDefaultValueToBuyCriptoPaidAmountCents < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
# rubocop:disable Rails/ReversibleMigration
|
||||
execute(<<-SQL.squish)
|
||||
UPDATE buy_crypto_orders
|
||||
SET received_amount = 0
|
||||
WHERE received_amount IS NULL
|
||||
SQL
|
||||
|
||||
change_column_default(:buy_crypto_orders, :received_amount, from: nil, to: 0)
|
||||
change_column_null(:buy_crypto_orders, :received_amount, false)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user