Remove cost_price fields from database

This commit is contained in:
Matt-Yorkley
2021-02-16 20:35:31 +00:00
parent 42a5d7cdc7
commit b31d75aa67
2 changed files with 14 additions and 3 deletions

View File

@@ -0,0 +1,13 @@
class RemoveCostPriceFromVariantAndLineItem < ActiveRecord::Migration
def up
remove_column :spree_variants, :cost_price
remove_column :spree_line_items, :cost_price
end
def down
add_column :spree_variants, :cost_price, :decimal,
precision: 8, scale: 2
add_column :spree_line_items, :cost_price, :integer,
precision: 8, scale: 2
end
end

View File

@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20210203215049) do
ActiveRecord::Schema.define(version: 20210216203057) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -504,7 +504,6 @@ ActiveRecord::Schema.define(version: 20210203215049) do
t.string "currency", limit: 255
t.decimal "distribution_fee", precision: 10, scale: 2
t.decimal "final_weight_volume", precision: 10, scale: 2
t.decimal "cost_price", precision: 10, scale: 2
t.integer "tax_category_id"
end
@@ -1069,7 +1068,6 @@ ActiveRecord::Schema.define(version: 20210203215049) do
t.datetime "deleted_at"
t.boolean "is_master", default: false
t.integer "product_id"
t.decimal "cost_price", precision: 10, scale: 2
t.integer "position"
t.string "cost_currency", limit: 255
t.float "unit_value", default: 1.0, null: false