Browse Source

Change migration because of linter

pull/228/head
Kat 3 years ago
parent
commit
eceb4bccc7
  1. 51
      db/migrate/20220117104521_change_currency_types.rb

51
db/migrate/20220117104521_change_currency_types.rb

@ -1,22 +1,43 @@
class ChangeCurrencyTypes < ActiveRecord::Migration[7.0]
def up
change_column :case_logs, :earnings, :decimal, precision: 10, scale: 2
change_column :case_logs, :brent, :decimal, precision: 10, scale: 2
change_column :case_logs, :scharge, :decimal, precision: 10, scale: 2
change_column :case_logs, :pscharge, :decimal, precision: 10, scale: 2
change_column :case_logs, :supcharg, :decimal, precision: 10, scale: 2
change_column :case_logs, :tcharge, :decimal, precision: 10, scale: 2
change_column :case_logs, :tshortfall, :decimal, precision: 10, scale: 2
change_column :case_logs, :chcharge, :decimal, precision: 10, scale: 2
change_table :case_logs, bulk: true do |t|
t.remove :earnings
t.column :earnings, :decimal, precision: 10, scale: 2
t.remove :brent
t.column :brent, :decimal, precision: 10, scale: 2
t.remove :scharge
t.column :scharge, :decimal, precision: 10, scale: 2
t.remove :pscharge
t.column :pscharge, :decimal, precision: 10, scale: 2
t.remove :supcharg
t.column :supcharg, :decimal, precision: 10, scale: 2
t.remove :tcharge
t.column :tcharge, :decimal, precision: 10, scale: 2
t.remove :tshortfall
t.column :tshortfall, :decimal, precision: 10, scale: 2
t.remove :chcharge
t.column :chcharge, :decimal, precision: 10, scale: 2
end
end
def down
change_column :case_logs, :earnings, :integer
change_column :case_logs, :brent, :integer
change_column :case_logs, :scharge, :integer
change_column :case_logs, :pscharge, :integer
change_column :case_logs, :supcharg, :integer
change_column :case_logs, :tcharge, :integer
change_column :case_logs, :tshortfall, :integer
change_table :case_logs, bulk: true do |t|
t.remove :earnings
t.column :earnings, :integer
t.remove :brent
t.column :brent, :integer
t.remove :scharge
t.column :scharge, :integer
t.remove :pscharge
t.column :pscharge, :integer
t.remove :supcharg
t.column :supcharg, :integer
t.remove :tcharge
t.column :tcharge, :integer
t.remove :tshortfall
t.column :tshortfall, :integer
t.remove :chcharge
t.column :chcharge, :integer
end
end
end

Loading…
Cancel
Save