diff --git a/db/migrate/20210923165046_create_sorecop_taxes.rb b/db/migrate/20210923165046_create_sorecop_taxes.rb index bbeeaff..1bf6e8b 100644 --- a/db/migrate/20210923165046_create_sorecop_taxes.rb +++ b/db/migrate/20210923165046_create_sorecop_taxes.rb @@ -1,11 +1,12 @@ class CreateSorecopTaxes < ActiveRecord::Migration[6.0] def change create_table :sorecop_taxes do |t| - t.decimal :critere_min, :precision => 10, :scale => 2 - t.decimal :critere_max, :precision => 10, :scale => 2 + t.decimal :critere_min, precision: 10, scale: 2 + t.decimal :critere_max, precision: 10, scale: 2 t.string :title t.boolean :fixed_price, default: true - t.references :sorecop_cats, foreign_key: true + t.decimal :price, precision: 10, scale: 2 + t.references :sorecop_cat, foreign_key: true t.timestamps end diff --git a/db/migrate/20210923170130_add_sorecop_cat_id_to_p_product_refs.rb b/db/migrate/20210923170130_add_sorecop_cat_id_to_p_product_refs.rb new file mode 100644 index 0000000..b4d65a9 --- /dev/null +++ b/db/migrate/20210923170130_add_sorecop_cat_id_to_p_product_refs.rb @@ -0,0 +1,5 @@ +class AddSorecopCatIdToPProductRefs < ActiveRecord::Migration[6.0] + def change + add_column :p_product_refs, :sorecop_cat_id, :integer + end +end diff --git a/db/schema.rb b/db/schema.rb index abb4522..5e36bad 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2021_09_23_165046) do +ActiveRecord::Schema.define(version: 2021_09_23_170130) do create_table "accounting_zones", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t| t.string "name" @@ -1801,6 +1801,7 @@ ActiveRecord::Schema.define(version: 2021_09_23_165046) do t.decimal "ct_deee", precision: 10, scale: 2 t.string "ean" t.string "sorecop_comment" + t.integer "sorecop_cat_id" end create_table "p_product_specs", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t| @@ -2765,10 +2766,11 @@ ActiveRecord::Schema.define(version: 2021_09_23_165046) do t.decimal "critere_max", precision: 10, scale: 2 t.string "title" t.boolean "fixed_price", default: true - t.bigint "sorecop_cats_id" + t.decimal "price", precision: 10, scale: 2 + t.bigint "sorecop_cat_id" t.datetime "created_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false - t.index ["sorecop_cats_id"], name: "index_sorecop_taxes_on_sorecop_cats_id" + t.index ["sorecop_cat_id"], name: "index_sorecop_taxes_on_sorecop_cat_id" end create_table "specific_preferences", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t| @@ -3193,7 +3195,7 @@ ActiveRecord::Schema.define(version: 2021_09_23_165046) do add_foreign_key "partition_lines", "partitions" add_foreign_key "partitions", "admins" add_foreign_key "s_modules", "s_modules_states" - add_foreign_key "sorecop_taxes", "sorecop_cats", column: "sorecop_cats_id" + add_foreign_key "sorecop_taxes", "sorecop_cats" add_foreign_key "stat_lines", "p_commercials" add_foreign_key "stat_lines", "p_customers" add_foreign_key "stat_lines", "p_product_refs"