Employer table broken up and new idcard module setup

This commit is contained in:
Jason Jordan
2026-03-06 10:56:20 -05:00
parent 8ecabf60ff
commit 6a068243f4
31 changed files with 628 additions and 571 deletions
@@ -7,10 +7,10 @@ class CreateIdCardSetups < ActiveRecord::Migration[7.2]
t.string :rx_group_number
t.boolean :active, default: false
t.belongs_to :employer, null: false, foreign_key: true
t.belongs_to :id_card_employer_logo, null: true, foreign_key: true
t.belongs_to :id_card_network_logo, null: true, foreign_key: true
t.belongs_to :id_card_provider_section, null: false, foreign_key: true
t.belongs_to :id_card_rx_section, null: false, foreign_key: true
t.belongs_to :employer_logo, null: true, foreign_key: { to_table: :id_card_employer_logos }
t.belongs_to :network_logo, null: true, foreign_key: { to_table: :id_card_network_logos }
t.belongs_to :provider_section, null: true, foreign_key: { to_table: :id_card_provider_sections }
t.belongs_to :rx_section, null: true, foreign_key: { to_table: :id_card_rx_sections }
t.timestamps
end
@@ -4,7 +4,8 @@ class CreateIdCardPlans < ActiveRecord::Migration[7.2]
t.string :title
t.integer :pb_product_key
t.string :pl_plan_key
t.belongs_to :id_card_setup, null: true, foreign_key: true
t.boolean :template
t.belongs_to :setup, null: true, foreign_key: { to_table: :id_card_setups }
t.timestamps
end
@@ -4,7 +4,7 @@ class CreateIdCardPlanBenefits < ActiveRecord::Migration[7.2]
t.string :benefit_desc
t.string :benefit
t.integer :sequence
t.belongs_to :id_card_plan, null: false, foreign_key: true
t.belongs_to :plan, null: false, foreign_key: { to_table: :id_card_plans }
t.timestamps
end
@@ -3,7 +3,7 @@ class CreateIdCardExceptions < ActiveRecord::Migration[7.2]
create_table :id_card_exceptions do |t|
t.string :type
t.string :value
t.belongs_to :id_card_setup, null: false, foreign_key: true
t.belongs_to :setup, null: false, foreign_key: { to_table: :id_card_setups }
t.timestamps
end
@@ -3,9 +3,9 @@ class CreateIdCardExceptionItems < ActiveRecord::Migration[7.2]
create_table :id_card_exception_items do |t|
t.string :field_name
t.string :field_value
t.belongs_to :id_card_exception, null: false, foreign_key: true
t.belongs_to :id_card_network_logo, null: true, foreign_key: true
t.belongs_to :id_card_provider_section, null: true, foreign_key: true
t.belongs_to :exception, null: false, foreign_key: { to_table: :id_card_exceptions }
t.belongs_to :network_logo, null: true, foreign_key: { to_table: :id_card_network_logos }
t.belongs_to :provider_section, null: true, foreign_key: { to_table: :id_card_provider_sections }
t.timestamps
end
+31 -30
View File
@@ -37,23 +37,23 @@ ActiveRecord::Schema[7.2].define(version: 2026_01_16_182836) do
create_table "id_card_exception_items", force: :cascade do |t|
t.string "field_name"
t.string "field_value"
t.bigint "id_card_exception_id", null: false
t.bigint "id_card_network_logo_id"
t.bigint "id_card_provider_section_id"
t.bigint "exception_id", null: false
t.bigint "network_logo_id"
t.bigint "provider_section_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["id_card_exception_id"], name: "index_id_card_exception_items_on_id_card_exception_id"
t.index ["id_card_network_logo_id"], name: "index_id_card_exception_items_on_id_card_network_logo_id"
t.index ["id_card_provider_section_id"], name: "index_id_card_exception_items_on_id_card_provider_section_id"
t.index ["exception_id"], name: "index_id_card_exception_items_on_exception_id"
t.index ["network_logo_id"], name: "index_id_card_exception_items_on_network_logo_id"
t.index ["provider_section_id"], name: "index_id_card_exception_items_on_provider_section_id"
end
create_table "id_card_exceptions", force: :cascade do |t|
t.string "type"
t.string "value"
t.bigint "id_card_setup_id", null: false
t.bigint "setup_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["id_card_setup_id"], name: "index_id_card_exceptions_on_id_card_setup_id"
t.index ["setup_id"], name: "index_id_card_exceptions_on_setup_id"
end
create_table "id_card_network_logos", force: :cascade do |t|
@@ -70,20 +70,21 @@ ActiveRecord::Schema[7.2].define(version: 2026_01_16_182836) do
t.string "benefit_desc"
t.string "benefit"
t.integer "sequence"
t.bigint "id_card_plan_id", null: false
t.bigint "plan_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["id_card_plan_id"], name: "index_id_card_plan_benefits_on_id_card_plan_id"
t.index ["plan_id"], name: "index_id_card_plan_benefits_on_plan_id"
end
create_table "id_card_plans", force: :cascade do |t|
t.string "title"
t.integer "pb_product_key"
t.string "pl_plan_key"
t.bigint "id_card_setup_id"
t.boolean "template"
t.bigint "setup_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["id_card_setup_id"], name: "index_id_card_plans_on_id_card_setup_id"
t.index ["setup_id"], name: "index_id_card_plans_on_setup_id"
end
create_table "id_card_print_data", force: :cascade do |t|
@@ -226,17 +227,17 @@ ActiveRecord::Schema[7.2].define(version: 2026_01_16_182836) do
t.string "rx_group_number"
t.boolean "active", default: false
t.bigint "employer_id", null: false
t.bigint "id_card_employer_logo_id"
t.bigint "id_card_network_logo_id"
t.bigint "id_card_provider_section_id", null: false
t.bigint "id_card_rx_section_id", null: false
t.bigint "employer_logo_id"
t.bigint "network_logo_id"
t.bigint "provider_section_id"
t.bigint "rx_section_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["employer_id"], name: "index_id_card_setups_on_employer_id"
t.index ["id_card_employer_logo_id"], name: "index_id_card_setups_on_id_card_employer_logo_id"
t.index ["id_card_network_logo_id"], name: "index_id_card_setups_on_id_card_network_logo_id"
t.index ["id_card_provider_section_id"], name: "index_id_card_setups_on_id_card_provider_section_id"
t.index ["id_card_rx_section_id"], name: "index_id_card_setups_on_id_card_rx_section_id"
t.index ["employer_logo_id"], name: "index_id_card_setups_on_employer_logo_id"
t.index ["network_logo_id"], name: "index_id_card_setups_on_network_logo_id"
t.index ["provider_section_id"], name: "index_id_card_setups_on_provider_section_id"
t.index ["rx_section_id"], name: "index_id_card_setups_on_rx_section_id"
end
create_table "members", force: :cascade do |t|
@@ -254,17 +255,17 @@ ActiveRecord::Schema[7.2].define(version: 2026_01_16_182836) do
t.index ["id_card_plan_id"], name: "index_members_on_id_card_plan_id"
end
add_foreign_key "id_card_exception_items", "id_card_exceptions"
add_foreign_key "id_card_exception_items", "id_card_network_logos"
add_foreign_key "id_card_exception_items", "id_card_provider_sections"
add_foreign_key "id_card_exceptions", "id_card_setups"
add_foreign_key "id_card_plan_benefits", "id_card_plans"
add_foreign_key "id_card_plans", "id_card_setups"
add_foreign_key "id_card_exception_items", "id_card_exceptions", column: "exception_id"
add_foreign_key "id_card_exception_items", "id_card_network_logos", column: "network_logo_id"
add_foreign_key "id_card_exception_items", "id_card_provider_sections", column: "provider_section_id"
add_foreign_key "id_card_exceptions", "id_card_setups", column: "setup_id"
add_foreign_key "id_card_plan_benefits", "id_card_plans", column: "plan_id"
add_foreign_key "id_card_plans", "id_card_setups", column: "setup_id"
add_foreign_key "id_card_setups", "employers"
add_foreign_key "id_card_setups", "id_card_employer_logos"
add_foreign_key "id_card_setups", "id_card_network_logos"
add_foreign_key "id_card_setups", "id_card_provider_sections"
add_foreign_key "id_card_setups", "id_card_rx_sections"
add_foreign_key "id_card_setups", "id_card_employer_logos", column: "employer_logo_id"
add_foreign_key "id_card_setups", "id_card_network_logos", column: "network_logo_id"
add_foreign_key "id_card_setups", "id_card_provider_sections", column: "provider_section_id"
add_foreign_key "id_card_setups", "id_card_rx_sections", column: "rx_section_id"
add_foreign_key "members", "employers"
add_foreign_key "members", "id_card_plans"
end