-
-
Notifications
You must be signed in to change notification settings - Fork 570
Kits part 2 - KitItem #5517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Kits part 2 - KitItem #5517
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # == Schema Information | ||
| # | ||
| # Table name: items | ||
| # | ||
| # id :integer not null, primary key | ||
| # active :boolean default(TRUE) | ||
| # additional_info :text | ||
| # barcode_count :integer | ||
| # distribution_quantity :integer | ||
| # name :string | ||
| # on_hand_minimum_quantity :integer default(0), not null | ||
| # on_hand_recommended_quantity :integer | ||
| # package_size :integer | ||
| # partner_key :string | ||
| # reporting_category :string | ||
| # type :string default("ConcreteItem"), not null | ||
| # value_in_cents :integer default(0) | ||
| # visible_to_partners :boolean default(TRUE), not null | ||
| # created_at :datetime not null | ||
| # updated_at :datetime not null | ||
| # item_category_id :integer | ||
| # kit_id :integer | ||
| # organization_id :integer | ||
| # | ||
| class ConcreteItem < Item | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # == Schema Information | ||
| # | ||
| # Table name: items | ||
| # | ||
| # id :integer not null, primary key | ||
| # active :boolean default(TRUE) | ||
| # additional_info :text | ||
| # barcode_count :integer | ||
| # distribution_quantity :integer | ||
| # name :string | ||
| # on_hand_minimum_quantity :integer default(0), not null | ||
| # on_hand_recommended_quantity :integer | ||
| # package_size :integer | ||
| # partner_key :string | ||
| # reporting_category :string | ||
| # type :string default("ConcreteItem"), not null | ||
| # value_in_cents :integer default(0) | ||
| # visible_to_partners :boolean default(TRUE), not null | ||
| # created_at :datetime not null | ||
| # updated_at :datetime not null | ||
| # item_category_id :integer | ||
| # kit_id :integer | ||
| # organization_id :integer | ||
| # | ||
| class KitItem < Item | ||
| # for now. Technically not optional, but since we will be changing this to be standalone (no kit), | ||
| # there isn't really a reason to enforce this at the moment. | ||
| belongs_to :kit, optional: true | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| class AddTypeToItems < ActiveRecord::Migration[8.0] | ||
| def up | ||
| add_column :items, :type, :string, default: 'ConcreteItem', null: false | ||
| Item.where.not(kit_id: nil).update_all(type: 'KitItem', updated_at: Time.zone.now) | ||
| end | ||
|
|
||
| def down | ||
| add_column :items, :type, :string, default: 'ConcreteItem', null: false | ||
| end | ||
|
|
||
| end | ||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -10,7 +10,7 @@ | |||
| # | ||||
| # It's strongly recommended that you check this file into your version control system. | ||||
|
|
||||
| ActiveRecord::Schema[8.0].define(version: 2025_10_07_141240) do | ||||
| ActiveRecord::Schema[8.0].define(version: 2026_03_13_201123) do | ||||
| # These are extensions that must be enabled in order to support this database | ||||
| enable_extension "pg_catalog.plpgsql" | ||||
|
|
||||
|
|
@@ -231,21 +231,6 @@ | |||
| t.index ["user_id"], name: "index_deprecated_feedback_messages_on_user_id" | ||||
| end | ||||
|
|
||||
| create_table "diaper_drive_participants", id: :serial, force: :cascade do |t| | ||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unrelated table drop -- is it incorrectly in the main branch, or is this a mistake in the PR?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's incorrectly in the main branch. Line 1 in b8daa2f
|
||||
| t.string "contact_name" | ||||
| t.string "email" | ||||
| t.string "phone" | ||||
| t.string "comment" | ||||
| t.integer "organization_id" | ||||
| t.datetime "created_at", precision: nil, null: false | ||||
| t.datetime "updated_at", precision: nil, null: false | ||||
| t.string "address" | ||||
| t.string "business_name" | ||||
| t.float "latitude" | ||||
| t.float "longitude" | ||||
| t.index ["latitude", "longitude"], name: "index_diaper_drive_participants_on_latitude_and_longitude" | ||||
| end | ||||
|
|
||||
| create_table "distributions", id: :serial, force: :cascade do |t| | ||||
| t.text "comment" | ||||
| t.datetime "created_at", precision: nil, null: false | ||||
|
|
@@ -341,16 +326,6 @@ | |||
| t.index ["partner_id"], name: "index_families_on_partner_id" | ||||
| end | ||||
|
|
||||
| create_table "feedback_messages", force: :cascade do |t| | ||||
| t.bigint "user_id" | ||||
| t.string "message" | ||||
| t.string "path" | ||||
| t.datetime "created_at", precision: nil, null: false | ||||
| t.datetime "updated_at", precision: nil, null: false | ||||
| t.boolean "resolved" | ||||
| t.index ["user_id"], name: "index_feedback_messages_on_user_id" | ||||
| end | ||||
|
|
||||
| create_table "flipper_features", force: :cascade do |t| | ||||
| t.string "key", null: false | ||||
| t.datetime "created_at", precision: nil, null: false | ||||
|
|
@@ -433,6 +408,7 @@ | |||
| t.integer "item_category_id" | ||||
| t.text "additional_info" | ||||
| t.string "reporting_category" | ||||
| t.string "type", default: "ConcreteItem", 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" | ||||
|
|
@@ -519,9 +495,9 @@ | |||
| t.boolean "signature_for_distribution_pdf", default: false | ||||
| t.boolean "receive_email_on_requests", default: false, null: false | ||||
| t.boolean "include_in_kind_values_in_exported_files", default: false, null: false | ||||
| t.boolean "bank_is_set_up", default: false, null: false | ||||
| t.string "reminder_schedule_definition" | ||||
| t.boolean "include_packages_in_distribution_export", default: false, null: false | ||||
| t.boolean "bank_is_set_up", default: false, null: false | ||||
| t.index ["latitude", "longitude"], name: "index_organizations_on_latitude_and_longitude" | ||||
| end | ||||
|
|
||||
|
|
@@ -543,10 +519,11 @@ | |||
| t.string "reminder_schedule_definition" | ||||
| t.index ["name", "organization_id"], name: "index_partner_groups_on_name_and_organization_id", unique: true | ||||
| t.index ["organization_id"], name: "index_partner_groups_on_organization_id" | ||||
| t.check_constraint "deadline_day <= 28", name: "deadline_day_of_month_check" | ||||
| t.check_constraint "reminder_day <= 28", name: "reminder_day_of_month_check" | ||||
| end | ||||
|
|
||||
| add_check_constraint "partner_groups", "deadline_day <= 28", name: "deadline_day_of_month_check", validate: false | ||||
| add_check_constraint "partner_groups", "reminder_day <= 28", name: "reminder_day_of_month_check", validate: false | ||||
|
|
||||
| create_table "partner_profiles", force: :cascade do |t| | ||||
| t.bigint "essentials_bank_id" | ||||
| t.integer "partner_id" | ||||
|
|
||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice