|
10 | 10 | # |
11 | 11 | # It's strongly recommended that you check this file into your version control system. |
12 | 12 |
|
13 | | -ActiveRecord::Schema.define(version: 20_210_729_003_516) do |
| 13 | +ActiveRecord::Schema.define(version: 2021_07_29_003516) do |
| 14 | + |
14 | 15 | # These are extensions that must be enabled in order to support this database |
15 | 16 | enable_extension "plpgsql" |
16 | 17 |
|
|
32 | 33 | t.bigint "record_id", null: false |
33 | 34 | t.datetime "created_at", null: false |
34 | 35 | t.datetime "updated_at", null: false |
35 | | - t.index %w(record_type record_id name), name: "index_action_text_rich_texts_uniqueness", unique: true |
| 36 | + t.index ["record_type", "record_id", "name"], name: "index_action_text_rich_texts_uniqueness", unique: true |
36 | 37 | end |
37 | 38 |
|
38 | 39 | create_table "active_storage_attachments", force: :cascade do |t| |
|
42 | 43 | t.bigint "blob_id", null: false |
43 | 44 | t.datetime "created_at", null: false |
44 | 45 | t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id" |
45 | | - t.index %w(record_type record_id name blob_id), name: "index_active_storage_attachments_uniqueness", unique: true |
| 46 | + t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true |
46 | 47 | end |
47 | 48 |
|
48 | 49 | create_table "active_storage_blobs", force: :cascade do |t| |
|
62 | 63 | t.string "variation_digest", null: false |
63 | 64 | t.datetime "created_at", precision: 6, null: false |
64 | 65 | t.datetime "updated_at", precision: 6, null: false |
65 | | - t.index %w(blob_id variation_digest), name: "index_active_storage_variant_records_uniqueness", unique: true |
| 66 | + t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true |
66 | 67 | end |
67 | 68 |
|
68 | 69 | create_table "adjustments", id: :serial, force: :cascade do |t| |
|
99 | 100 | t.datetime "updated_at", null: false |
100 | 101 | t.integer "organization_id" |
101 | 102 | t.string "barcodeable_type", default: "Item" |
102 | | - t.index %w(barcodeable_type barcodeable_id), name: "index_barcode_items_on_barcodeable_type_and_barcodeable_id" |
| 103 | + t.index ["barcodeable_type", "barcodeable_id"], name: "index_barcode_items_on_barcodeable_type_and_barcodeable_id" |
103 | 104 | t.index ["organization_id"], name: "index_barcode_items_on_organization_id" |
104 | 105 | end |
105 | 106 |
|
|
136 | 137 | t.string "business_name" |
137 | 138 | t.float "latitude" |
138 | 139 | t.float "longitude" |
139 | | - t.index %w(latitude longitude), name: "index_diaper_drive_participants_on_latitude_and_longitude" |
| 140 | + t.index ["latitude", "longitude"], name: "index_diaper_drive_participants_on_latitude_and_longitude" |
140 | 141 | end |
141 | 142 |
|
142 | 143 | create_table "diaper_drives", force: :cascade do |t| |
|
175 | 176 | t.integer "organization_id" |
176 | 177 | t.float "latitude" |
177 | 178 | t.float "longitude" |
178 | | - t.index %w(latitude longitude), name: "index_donation_sites_on_latitude_and_longitude" |
| 179 | + t.index ["latitude", "longitude"], name: "index_donation_sites_on_latitude_and_longitude" |
179 | 180 | t.index ["organization_id"], name: "index_donation_sites_on_organization_id" |
180 | 181 | end |
181 | 182 |
|
|
212 | 213 | t.string "value" |
213 | 214 | t.datetime "created_at", null: false |
214 | 215 | t.datetime "updated_at", null: false |
215 | | - t.index %w(feature_key key value), name: "index_flipper_gates_on_feature_key_and_key_and_value", unique: true |
| 216 | + t.index ["feature_key", "key", "value"], name: "index_flipper_gates_on_feature_key_and_key_and_value", unique: true |
216 | 217 | end |
217 | 218 |
|
218 | 219 | create_table "inventory_items", id: :serial, force: :cascade do |t| |
|
229 | 230 | t.integer "organization_id", null: false |
230 | 231 | t.datetime "created_at", precision: 6, null: false |
231 | 232 | t.datetime "updated_at", precision: 6, null: false |
232 | | - t.index %w(name organization_id), name: "index_item_categories_on_name_and_organization_id", unique: true |
| 233 | + t.index ["name", "organization_id"], name: "index_item_categories_on_name_and_organization_id", unique: true |
| 234 | + end |
| 235 | + |
| 236 | + create_table "item_categories_partner_groups", force: :cascade do |t| |
| 237 | + t.bigint "partner_group_id", null: false |
| 238 | + t.bigint "item_category_id", null: false |
| 239 | + t.datetime "created_at", precision: 6, null: false |
| 240 | + t.datetime "updated_at", precision: 6, null: false |
| 241 | + t.index ["item_category_id"], name: "index_item_categories_partner_groups_on_item_category_id" |
| 242 | + t.index ["partner_group_id"], name: "index_item_categories_partner_groups_on_partner_group_id" |
233 | 243 | end |
234 | 244 |
|
235 | 245 | create_table "items", id: :serial, force: :cascade do |t| |
|
263 | 273 | t.boolean "active", default: true |
264 | 274 | t.boolean "visible_to_partners", default: true, null: false |
265 | 275 | t.integer "value_in_cents", default: 0 |
266 | | - t.index %w(name organization_id), name: "index_kits_on_name_and_organization_id", unique: true |
| 276 | + t.index ["name", "organization_id"], name: "index_kits_on_name_and_organization_id", unique: true |
267 | 277 | t.index ["organization_id"], name: "index_kits_on_organization_id" |
268 | 278 | end |
269 | 279 |
|
|
274 | 284 | t.string "itemizable_type" |
275 | 285 | t.datetime "created_at", null: false |
276 | 286 | t.datetime "updated_at", null: false |
277 | | - t.index %w(itemizable_id itemizable_type), name: "index_line_items_on_itemizable_id_and_itemizable_type" |
| 287 | + t.index ["itemizable_id", "itemizable_type"], name: "index_line_items_on_itemizable_id_and_itemizable_type" |
278 | 288 | end |
279 | 289 |
|
280 | 290 | create_table "manufacturers", force: :cascade do |t| |
|
305 | 315 | t.integer "default_storage_location" |
306 | 316 | t.text "partner_form_fields", default: [], array: true |
307 | 317 | t.integer "account_request_id" |
308 | | - t.index %w(latitude longitude), name: "index_organizations_on_latitude_and_longitude" |
| 318 | + t.index ["latitude", "longitude"], name: "index_organizations_on_latitude_and_longitude" |
309 | 319 | t.index ["short_name"], name: "index_organizations_on_short_name" |
310 | 320 | end |
311 | 321 |
|
|
314 | 324 | t.string "name" |
315 | 325 | t.datetime "created_at", precision: 6, null: false |
316 | 326 | t.datetime "updated_at", precision: 6, null: false |
317 | | - t.index %w(name organization_id), name: "index_partner_groups_on_name_and_organization_id", unique: true |
| 327 | + t.index ["name", "organization_id"], name: "index_partner_groups_on_name_and_organization_id", unique: true |
318 | 328 | t.index ["organization_id"], name: "index_partner_groups_on_organization_id" |
319 | 329 | end |
320 | 330 |
|
321 | | - create_table "partner_groups_item_categories", force: :cascade do |t| |
322 | | - t.bigint "partner_id" |
323 | | - t.bigint "item_categories_id" |
324 | | - t.datetime "created_at", precision: 6, null: false |
325 | | - t.datetime "updated_at", precision: 6, null: false |
326 | | - t.index ["item_categories_id"], name: "index_partner_groups_item_categories_on_item_categories_id" |
327 | | - t.index ["partner_id"], name: "index_partner_groups_item_categories_on_partner_id" |
328 | | - end |
329 | | - |
330 | 331 | create_table "partners", id: :serial, force: :cascade do |t| |
331 | 332 | t.string "name" |
332 | 333 | t.string "email" |
|
337 | 338 | t.boolean "send_reminders", default: false, null: false |
338 | 339 | t.text "notes" |
339 | 340 | t.integer "quota" |
340 | | - t.bigint "partner_groups_id" |
| 341 | + t.bigint "partner_group_id" |
341 | 342 | t.index ["organization_id"], name: "index_partners_on_organization_id" |
342 | | - t.index ["partner_groups_id"], name: "index_partners_on_partner_groups_id" |
| 343 | + t.index ["partner_group_id"], name: "index_partners_on_partner_group_id" |
343 | 344 | end |
344 | 345 |
|
345 | 346 | create_table "purchases", force: :cascade do |t| |
|
384 | 385 | t.float "longitude" |
385 | 386 | t.integer "square_footage" |
386 | 387 | t.string "warehouse_type" |
387 | | - t.index %w(latitude longitude), name: "index_storage_locations_on_latitude_and_longitude" |
| 388 | + t.index ["latitude", "longitude"], name: "index_storage_locations_on_latitude_and_longitude" |
388 | 389 | t.index ["organization_id"], name: "index_storage_locations_on_organization_id" |
389 | 390 | end |
390 | 391 |
|
|
430 | 431 | t.index ["invitation_token"], name: "index_users_on_invitation_token", unique: true |
431 | 432 | t.index ["invitations_count"], name: "index_users_on_invitations_count" |
432 | 433 | t.index ["invited_by_id"], name: "index_users_on_invited_by_id" |
433 | | - t.index %w(invited_by_type invited_by_id), name: "index_users_on_invited_by" |
| 434 | + t.index ["invited_by_type", "invited_by_id"], name: "index_users_on_invited_by" |
434 | 435 | t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true |
435 | 436 | end |
436 | 437 |
|
|
446 | 447 | t.float "longitude" |
447 | 448 | t.datetime "created_at", null: false |
448 | 449 | t.datetime "updated_at", null: false |
449 | | - t.index %w(latitude longitude), name: "index_vendors_on_latitude_and_longitude" |
| 450 | + t.index ["latitude", "longitude"], name: "index_vendors_on_latitude_and_longitude" |
450 | 451 | end |
451 | 452 |
|
452 | 453 | create_table "versions", force: :cascade do |t| |
|
457 | 458 | t.jsonb "object" |
458 | 459 | t.datetime "created_at" |
459 | 460 | t.jsonb "object_changes" |
460 | | - t.index %w(item_type item_id), name: "index_versions_on_item_type_and_item_id" |
| 461 | + t.index ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id" |
461 | 462 | end |
462 | 463 |
|
463 | 464 | add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id" |
|
471 | 472 | add_foreign_key "donations", "manufacturers" |
472 | 473 | add_foreign_key "donations", "storage_locations" |
473 | 474 | add_foreign_key "item_categories", "organizations" |
| 475 | + add_foreign_key "item_categories_partner_groups", "item_categories" |
| 476 | + add_foreign_key "item_categories_partner_groups", "partner_groups" |
474 | 477 | add_foreign_key "items", "item_categories" |
475 | 478 | add_foreign_key "items", "kits" |
476 | 479 | add_foreign_key "kits", "organizations" |
477 | 480 | add_foreign_key "manufacturers", "organizations" |
478 | 481 | add_foreign_key "organizations", "account_requests" |
479 | 482 | add_foreign_key "partner_groups", "organizations" |
480 | | - add_foreign_key "partner_groups_item_categories", "item_categories", column: "item_categories_id" |
481 | | - add_foreign_key "partner_groups_item_categories", "partners" |
482 | 483 | add_foreign_key "requests", "distributions" |
483 | 484 | add_foreign_key "requests", "organizations" |
484 | 485 | add_foreign_key "requests", "partners" |
|
0 commit comments