diff --git a/db/migrate/20210923165046_create_sorecop_taxes.rb b/db/migrate/20210923165046_create_sorecop_taxes.rb index c272193..bbeeaff 100644 --- a/db/migrate/20210923165046_create_sorecop_taxes.rb +++ b/db/migrate/20210923165046_create_sorecop_taxes.rb @@ -1,11 +1,11 @@ class CreateSorecopTaxes < ActiveRecord::Migration[6.0] def change create_table :sorecop_taxes do |t| - t.decimal :critere_min - t.decimal :critere_max + t.decimal :critere_min, :precision => 10, :scale => 2 + t.decimal :critere_max, :precision => 10, :scale => 2 t.string :title - t.boolean :fixed_price - t.references :sorecop_cat_id, foreign_key: true + t.boolean :fixed_price, default: true + t.references :sorecop_cats, foreign_key: true t.timestamps end diff --git a/db/schema.rb b/db/schema.rb index 5baae52..abb4522 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_17_124338) do +ActiveRecord::Schema.define(version: 2021_09_23_165046) do create_table "accounting_zones", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t| t.string "name" @@ -2754,6 +2754,23 @@ ActiveRecord::Schema.define(version: 2021_09_17_124338) do t.decimal "ac_remise", precision: 14, scale: 2 end + create_table "sorecop_cats", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t| + t.string "name" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + end + + create_table "sorecop_taxes", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t| + 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.bigint "sorecop_cats_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" + end + create_table "specific_preferences", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t| t.string "key" t.string "value" @@ -3176,6 +3193,7 @@ ActiveRecord::Schema.define(version: 2021_09_17_124338) 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 "stat_lines", "p_commercials" add_foreign_key "stat_lines", "p_customers" add_foreign_key "stat_lines", "p_product_refs"