Skip to content
1 change: 0 additions & 1 deletion app/models/concrete_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
# created_at :datetime not null
# updated_at :datetime not null
# item_category_id :integer
# kit_id :integer
# organization_id :integer
#
class ConcreteItem < Item
Expand Down
1 change: 0 additions & 1 deletion app/models/item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
# created_at :datetime not null
# updated_at :datetime not null
# item_category_id :integer
# kit_id :integer
# organization_id :integer
#

Expand Down
1 change: 0 additions & 1 deletion app/models/kit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
# created_at :datetime not null
# updated_at :datetime not null
# item_category_id :integer
# kit_id :integer
# organization_id :integer
#
class Kit < Item
Expand Down
15 changes: 15 additions & 0 deletions db/migrate/20260919150000_remove_kits_table_and_items_kit_id.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class RemoveKitsTableAndItemsKitId < ActiveRecord::Migration[8.1]
def up
safety_assured do
drop_table :kit_allocations if table_exists?(:kit_allocations)
drop_enum :kit_allocation_type, if_exists: true
remove_foreign_key :items, :kits if foreign_key_exists?(:items, :kits)
remove_column :items, :kit_id, :integer if column_exists?(:items, :kit_id)
drop_table :kits if table_exists?(:kits)
end
end

def down
fail ActiveRecord::IrreversibleMigration
end
end
32 changes: 0 additions & 32 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
# Custom types defined in this database.
# Note that some types may not work with other database engines. Be careful if changing database.
create_enum "category", ["US_County", "Other"]
create_enum "kit_allocation_type", ["inventory_in", "inventory_out"]

create_table "account_requests", force: :cascade do |t|
t.datetime "confirmed_at", precision: nil
Expand Down Expand Up @@ -398,7 +397,6 @@
t.datetime "created_at", precision: nil, null: false
t.integer "distribution_quantity"
t.integer "item_category_id"
t.integer "kit_id"
t.string "name"
t.integer "on_hand_minimum_quantity", default: 0, null: false
t.integer "on_hand_recommended_quantity"
Expand All @@ -411,36 +409,11 @@
t.datetime "updated_at", precision: nil, null: false
t.integer "value_in_cents", default: 0
t.boolean "visible_to_partners", default: true, null: false
t.index ["kit_id"], name: "index_items_on_kit_id"
t.index ["organization_id"], name: "index_items_on_organization_id"
t.index ["partner_key"], name: "index_items_on_partner_key"
t.check_constraint "distribution_quantity >= 0", name: "distribution_quantity_nonnegative"
end

create_table "kit_allocations", force: :cascade do |t|
t.datetime "created_at", null: false
t.enum "kit_allocation_type", default: "inventory_in", null: false, enum_type: "kit_allocation_type"
t.bigint "kit_id", null: false
t.bigint "organization_id", null: false
t.bigint "storage_location_id", null: false
t.datetime "updated_at", null: false
t.index ["kit_id"], name: "index_kit_allocations_on_kit_id"
t.index ["organization_id"], name: "index_kit_allocations_on_organization_id"
t.index ["storage_location_id"], name: "index_kit_allocations_on_storage_location_id"
end

create_table "kits", force: :cascade do |t|
t.boolean "active", default: true
t.datetime "created_at", null: false
t.string "name", null: false
t.integer "organization_id", null: false
t.datetime "updated_at", null: false
t.integer "value_in_cents", default: 0
t.boolean "visible_to_partners", default: true, null: false
t.index ["name", "organization_id"], name: "index_kits_on_name_and_organization_id", unique: true
t.index ["organization_id"], name: "index_kits_on_organization_id"
end

create_table "line_items", id: :serial, force: :cascade do |t|
t.datetime "created_at", precision: nil, null: false
t.integer "item_id"
Expand Down Expand Up @@ -878,11 +851,6 @@
add_foreign_key "item_categories_partner_groups", "partner_groups"
add_foreign_key "item_units", "items"
add_foreign_key "items", "item_categories"
add_foreign_key "items", "kits"
add_foreign_key "kit_allocations", "kits"
add_foreign_key "kit_allocations", "organizations"
add_foreign_key "kit_allocations", "storage_locations"
add_foreign_key "kits", "organizations"
add_foreign_key "manufacturers", "organizations"
add_foreign_key "organizations", "account_requests"
add_foreign_key "organizations", "ndbn_members", primary_key: "ndbn_member_id"
Expand Down
1 change: 0 additions & 1 deletion spec/factories/items.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
# created_at :datetime not null
# updated_at :datetime not null
# item_category_id :integer
# kit_id :integer
# organization_id :integer
#

Expand Down
1 change: 0 additions & 1 deletion spec/factories/kits.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
# created_at :datetime not null
# updated_at :datetime not null
# item_category_id :integer
# kit_id :integer
# organization_id :integer
#
FactoryBot.define do
Expand Down
1 change: 0 additions & 1 deletion spec/models/item_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
# created_at :datetime not null
# updated_at :datetime not null
# item_category_id :integer
# kit_id :integer
# organization_id :integer
#

Expand Down
1 change: 0 additions & 1 deletion spec/models/kit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
# created_at :datetime not null
# updated_at :datetime not null
# item_category_id :integer
# kit_id :integer
# organization_id :integer
#

Expand Down
Loading