|
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_107_175_100) do |
14 | | - |
| 13 | +ActiveRecord::Schema.define(version: 20_210_729_003_516) do |
15 | 14 | # These are extensions that must be enabled in order to support this database |
16 | 15 | enable_extension "plpgsql" |
17 | 16 |
|
|
33 | 32 | t.bigint "record_id", null: false |
34 | 33 | t.datetime "created_at", null: false |
35 | 34 | t.datetime "updated_at", null: false |
36 | | - t.index ["record_type", "record_id", "name"], name: "index_action_text_rich_texts_uniqueness", unique: true |
| 35 | + t.index %w(record_type record_id name), name: "index_action_text_rich_texts_uniqueness", unique: true |
37 | 36 | end |
38 | 37 |
|
39 | 38 | create_table "active_storage_attachments", force: :cascade do |t| |
|
43 | 42 | t.bigint "blob_id", null: false |
44 | 43 | t.datetime "created_at", null: false |
45 | 44 | t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id" |
46 | | - t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true |
| 45 | + t.index %w(record_type record_id name blob_id), name: "index_active_storage_attachments_uniqueness", unique: true |
47 | 46 | end |
48 | 47 |
|
49 | 48 | create_table "active_storage_blobs", force: :cascade do |t| |
|
63 | 62 | t.string "variation_digest", null: false |
64 | 63 | t.datetime "created_at", precision: 6, null: false |
65 | 64 | t.datetime "updated_at", precision: 6, null: false |
66 | | - t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true |
| 65 | + t.index %w(blob_id variation_digest), name: "index_active_storage_variant_records_uniqueness", unique: true |
67 | 66 | end |
68 | 67 |
|
69 | 68 | create_table "adjustments", id: :serial, force: :cascade do |t| |
|
100 | 99 | t.datetime "updated_at", null: false |
101 | 100 | t.integer "organization_id" |
102 | 101 | t.string "barcodeable_type", default: "Item" |
103 | | - t.index ["barcodeable_type", "barcodeable_id"], name: "index_barcode_items_on_barcodeable_type_and_barcodeable_id" |
| 102 | + t.index %w(barcodeable_type barcodeable_id), name: "index_barcode_items_on_barcodeable_type_and_barcodeable_id" |
104 | 103 | t.index ["organization_id"], name: "index_barcode_items_on_organization_id" |
105 | 104 | end |
106 | 105 |
|
|
137 | 136 | t.string "business_name" |
138 | 137 | t.float "latitude" |
139 | 138 | t.float "longitude" |
140 | | - t.index ["latitude", "longitude"], name: "index_diaper_drive_participants_on_latitude_and_longitude" |
| 139 | + t.index %w(latitude longitude), name: "index_diaper_drive_participants_on_latitude_and_longitude" |
141 | 140 | end |
142 | 141 |
|
143 | 142 | create_table "diaper_drives", force: :cascade do |t| |
|
176 | 175 | t.integer "organization_id" |
177 | 176 | t.float "latitude" |
178 | 177 | t.float "longitude" |
179 | | - t.index ["latitude", "longitude"], name: "index_donation_sites_on_latitude_and_longitude" |
| 178 | + t.index %w(latitude longitude), name: "index_donation_sites_on_latitude_and_longitude" |
180 | 179 | t.index ["organization_id"], name: "index_donation_sites_on_organization_id" |
181 | 180 | end |
182 | 181 |
|
|
213 | 212 | t.string "value" |
214 | 213 | t.datetime "created_at", null: false |
215 | 214 | t.datetime "updated_at", null: false |
216 | | - t.index ["feature_key", "key", "value"], name: "index_flipper_gates_on_feature_key_and_key_and_value", unique: true |
| 215 | + t.index %w(feature_key key value), name: "index_flipper_gates_on_feature_key_and_key_and_value", unique: true |
217 | 216 | end |
218 | 217 |
|
219 | 218 | create_table "inventory_items", id: :serial, force: :cascade do |t| |
|
225 | 224 | end |
226 | 225 |
|
227 | 226 | create_table "item_categories", force: :cascade do |t| |
228 | | - t.string "name" |
| 227 | + t.string "name", null: false |
229 | 228 | t.text "description" |
230 | 229 | t.integer "organization_id", null: false |
231 | 230 | t.datetime "created_at", precision: 6, null: false |
232 | 231 | t.datetime "updated_at", precision: 6, null: false |
233 | | - t.index ["name", "organization_id"], name: "index_item_categories_on_name_and_organization_id", unique: true |
| 232 | + t.index %w(name organization_id), name: "index_item_categories_on_name_and_organization_id", unique: true |
234 | 233 | end |
235 | 234 |
|
236 | 235 | create_table "items", id: :serial, force: :cascade do |t| |
|
264 | 263 | t.boolean "active", default: true |
265 | 264 | t.boolean "visible_to_partners", default: true, null: false |
266 | 265 | t.integer "value_in_cents", default: 0 |
267 | | - t.index ["name", "organization_id"], name: "index_kits_on_name_and_organization_id", unique: true |
| 266 | + t.index %w(name organization_id), name: "index_kits_on_name_and_organization_id", unique: true |
268 | 267 | t.index ["organization_id"], name: "index_kits_on_organization_id" |
269 | 268 | end |
270 | 269 |
|
|
275 | 274 | t.string "itemizable_type" |
276 | 275 | t.datetime "created_at", null: false |
277 | 276 | t.datetime "updated_at", null: false |
278 | | - t.index ["itemizable_id", "itemizable_type"], name: "index_line_items_on_itemizable_id_and_itemizable_type" |
| 277 | + t.index %w(itemizable_id itemizable_type), name: "index_line_items_on_itemizable_id_and_itemizable_type" |
279 | 278 | end |
280 | 279 |
|
281 | 280 | create_table "manufacturers", force: :cascade do |t| |
|
306 | 305 | t.integer "default_storage_location" |
307 | 306 | t.text "partner_form_fields", default: [], array: true |
308 | 307 | t.integer "account_request_id" |
309 | | - t.index ["latitude", "longitude"], name: "index_organizations_on_latitude_and_longitude" |
| 308 | + t.index %w(latitude longitude), name: "index_organizations_on_latitude_and_longitude" |
310 | 309 | t.index ["short_name"], name: "index_organizations_on_short_name" |
311 | 310 | end |
312 | 311 |
|
313 | | - create_table "partner_group_items", force: :cascade do |t| |
314 | | - t.bigint "partner_group_id", null: false |
315 | | - t.bigint "item_id", null: false |
| 312 | + create_table "partner_groups", force: :cascade do |t| |
| 313 | + t.bigint "organization_id" |
| 314 | + t.string "name" |
316 | 315 | t.datetime "created_at", precision: 6, null: false |
317 | 316 | t.datetime "updated_at", precision: 6, null: false |
318 | | - t.index ["item_id"], name: "index_partner_group_items_on_item_id" |
319 | | - t.index ["partner_group_id"], name: "index_partner_group_items_on_partner_group_id" |
| 317 | + t.index %w(name organization_id), name: "index_partner_groups_on_name_and_organization_id", unique: true |
| 318 | + t.index ["organization_id"], name: "index_partner_groups_on_organization_id" |
320 | 319 | end |
321 | 320 |
|
322 | | - create_table "partner_group_memberships", force: :cascade do |t| |
323 | | - t.bigint "partner_group_id" |
| 321 | + create_table "partner_groups_item_categories", force: :cascade do |t| |
324 | 322 | t.bigint "partner_id" |
| 323 | + t.bigint "item_categories_id" |
325 | 324 | t.datetime "created_at", precision: 6, null: false |
326 | 325 | t.datetime "updated_at", precision: 6, null: false |
327 | | - t.index ["partner_group_id"], name: "index_partner_group_memberships_on_partner_group_id" |
328 | | - t.index ["partner_id"], name: "index_partner_group_memberships_on_partner_id" |
329 | | - end |
330 | | - |
331 | | - create_table "partner_groups", force: :cascade do |t| |
332 | | - t.bigint "organization_id" |
333 | | - t.string "name" |
334 | | - t.datetime "created_at", precision: 6, null: false |
335 | | - t.datetime "updated_at", precision: 6, null: false |
336 | | - t.index ["organization_id"], name: "index_partner_groups_on_organization_id" |
| 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" |
337 | 328 | end |
338 | 329 |
|
339 | 330 | create_table "partners", id: :serial, force: :cascade do |t| |
|
346 | 337 | t.boolean "send_reminders", default: false, null: false |
347 | 338 | t.text "notes" |
348 | 339 | t.integer "quota" |
| 340 | + t.bigint "partner_groups_id" |
349 | 341 | t.index ["organization_id"], name: "index_partners_on_organization_id" |
| 342 | + t.index ["partner_groups_id"], name: "index_partners_on_partner_groups_id" |
350 | 343 | end |
351 | 344 |
|
352 | 345 | create_table "purchases", force: :cascade do |t| |
|
391 | 384 | t.float "longitude" |
392 | 385 | t.integer "square_footage" |
393 | 386 | t.string "warehouse_type" |
394 | | - t.index ["latitude", "longitude"], name: "index_storage_locations_on_latitude_and_longitude" |
| 387 | + t.index %w(latitude longitude), name: "index_storage_locations_on_latitude_and_longitude" |
395 | 388 | t.index ["organization_id"], name: "index_storage_locations_on_organization_id" |
396 | 389 | end |
397 | 390 |
|
|
437 | 430 | t.index ["invitation_token"], name: "index_users_on_invitation_token", unique: true |
438 | 431 | t.index ["invitations_count"], name: "index_users_on_invitations_count" |
439 | 432 | t.index ["invited_by_id"], name: "index_users_on_invited_by_id" |
440 | | - t.index ["invited_by_type", "invited_by_id"], name: "index_users_on_invited_by_type_and_invited_by_id" |
| 433 | + t.index %w(invited_by_type invited_by_id), name: "index_users_on_invited_by" |
441 | 434 | t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true |
442 | 435 | end |
443 | 436 |
|
|
453 | 446 | t.float "longitude" |
454 | 447 | t.datetime "created_at", null: false |
455 | 448 | t.datetime "updated_at", null: false |
456 | | - t.index ["latitude", "longitude"], name: "index_vendors_on_latitude_and_longitude" |
| 449 | + t.index %w(latitude longitude), name: "index_vendors_on_latitude_and_longitude" |
457 | 450 | end |
458 | 451 |
|
459 | 452 | create_table "versions", force: :cascade do |t| |
|
483 | 476 | add_foreign_key "kits", "organizations" |
484 | 477 | add_foreign_key "manufacturers", "organizations" |
485 | 478 | add_foreign_key "organizations", "account_requests" |
486 | | - add_foreign_key "partner_group_items", "items" |
487 | | - add_foreign_key "partner_group_items", "partner_groups" |
488 | | - add_foreign_key "partner_group_memberships", "partner_groups" |
489 | | - add_foreign_key "partner_group_memberships", "partners" |
490 | 479 | 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" |
491 | 482 | add_foreign_key "requests", "distributions" |
492 | 483 | add_foreign_key "requests", "organizations" |
493 | 484 | add_foreign_key "requests", "partners" |
|
0 commit comments