|
58 | 58 | t.integer "user_id", default: 0, null: false
|
59 | 59 | t.integer "task_id", default: 0, null: false
|
60 | 60 | t.boolean "accepted", default: false
|
| 61 | + t.index ["task_id"], name: "fk_rails_b7c53ee3b6" |
61 | 62 | t.index ["user_id", "task_id"], name: "index_assignments_on_user_id_and_task_id", unique: true
|
62 | 63 | end
|
63 | 64 |
|
|
81 | 82 | t.text "receipt"
|
82 | 83 | t.binary "image", limit: 16777215
|
83 | 84 | t.integer "financial_link_id"
|
| 85 | + t.index ["bank_account_id"], name: "fk_rails_e0117c6727" |
84 | 86 | t.index ["financial_link_id"], name: "index_bank_transactions_on_financial_link_id"
|
85 | 87 | end
|
86 | 88 |
|
|
92 | 94 | t.datetime "created_at"
|
93 | 95 | t.datetime "updated_at"
|
94 | 96 | t.integer "parent_id"
|
| 97 | + t.index ["created_by_user_id"], name: "fk_rails_7294a1aa59" |
95 | 98 | t.index ["parent_id"], name: "index_documents_on_parent_id"
|
96 | 99 | end
|
97 | 100 |
|
|
108 | 111 | t.integer "financial_transaction_class_id", null: false
|
109 | 112 | t.string "name_short"
|
110 | 113 | t.integer "bank_account_id"
|
| 114 | + t.index ["financial_transaction_class_id"], name: "fk_rails_f2b646cddc" |
111 | 115 | t.index ["name_short"], name: "index_financial_transaction_types_on_name_short"
|
112 | 116 | end
|
113 | 117 |
|
|
121 | 125 | t.integer "financial_link_id"
|
122 | 126 | t.integer "reverts_id"
|
123 | 127 | t.integer "group_order_id"
|
| 128 | + t.index ["financial_link_id"], name: "fk_rails_d41d3fdfae" |
| 129 | + t.index ["financial_transaction_type_id"], name: "fk_rails_dba6d95fbf" |
| 130 | + t.index ["group_order_id"], name: "fk_rails_88ae0ba39c" |
124 | 131 | t.index ["ordergroup_id"], name: "index_financial_transactions_on_ordergroup_id"
|
125 | 132 | t.index ["reverts_id"], name: "index_financial_transactions_on_reverts_id", unique: true
|
| 133 | + t.index ["user_id"], name: "fk_rails_0cbb08eeee" |
126 | 134 | end
|
127 | 135 |
|
128 | 136 | create_table "group_order_article_quantities", id: :integer, force: :cascade do |t|
|
|
157 | 165 | t.index ["order_id"], name: "index_group_orders_on_order_id"
|
158 | 166 | t.index ["ordergroup_id", "order_id"], name: "index_group_orders_on_ordergroup_id_and_order_id", unique: true
|
159 | 167 | t.index ["ordergroup_id"], name: "index_group_orders_on_ordergroup_id"
|
| 168 | + t.index ["updated_by_user_id"], name: "fk_rails_1889c54304" |
160 | 169 | end
|
161 | 170 |
|
162 | 171 | create_table "groups", id: :integer, force: :cascade do |t|
|
|
190 | 199 | t.integer "group_id", default: 0, null: false
|
191 | 200 | t.integer "user_id", default: 0, null: false
|
192 | 201 | t.string "email", default: "", null: false
|
| 202 | + t.index ["group_id"], name: "fk_rails_9e216f1ff4" |
193 | 203 | t.index ["token"], name: "index_invites_on_token"
|
| 204 | + t.index ["user_id"], name: "fk_rails_ff69dbb2ac" |
194 | 205 | end
|
195 | 206 |
|
196 | 207 | create_table "invoices", id: :integer, force: :cascade do |t|
|
|
208 | 219 | t.string "attachment_mime"
|
209 | 220 | t.binary "attachment_data", limit: 16777215
|
210 | 221 | t.integer "financial_link_id"
|
| 222 | + t.index ["created_by_user_id"], name: "fk_rails_8fd25eeb3c" |
| 223 | + t.index ["financial_link_id"], name: "fk_rails_75b0aafe67" |
211 | 224 | t.index ["supplier_id"], name: "index_invoices_on_supplier_id"
|
212 | 225 | end
|
213 | 226 |
|
|
231 | 244 | create_table "memberships", id: :integer, force: :cascade do |t|
|
232 | 245 | t.integer "group_id", default: 0, null: false
|
233 | 246 | t.integer "user_id", default: 0, null: false
|
| 247 | + t.index ["group_id"], name: "fk_rails_aaf389f138" |
234 | 248 | t.index ["user_id", "group_id"], name: "index_memberships_on_user_id_and_group_id", unique: true
|
235 | 249 | end
|
236 | 250 |
|
|
253 | 267 | t.integer "group_id"
|
254 | 268 | t.string "salt"
|
255 | 269 | t.binary "received_email", limit: 16777215
|
| 270 | + t.index ["group_id"], name: "fk_rails_841b0ae6ac" |
| 271 | + t.index ["reply_to"], name: "fk_rails_3730b06fab" |
| 272 | + t.index ["sender_id"], name: "fk_rails_b8f26a382d" |
256 | 273 | end
|
257 | 274 |
|
258 | 275 | create_table "oauth_access_grants", id: :integer, force: :cascade do |t|
|
|
303 | 320 | t.integer "article_price_id"
|
304 | 321 | t.integer "units_billed"
|
305 | 322 | t.integer "units_received"
|
| 323 | + t.index ["article_id"], name: "fk_rails_44e6c21781" |
| 324 | + t.index ["article_price_id"], name: "fk_rails_798fa38c22" |
306 | 325 | t.index ["order_id", "article_id"], name: "index_order_articles_on_order_id_and_article_id", unique: true
|
307 | 326 | t.index ["order_id"], name: "index_order_articles_on_order_id"
|
308 | 327 | end
|
|
313 | 332 | t.text "text"
|
314 | 333 | t.datetime "created_at"
|
315 | 334 | t.index ["order_id"], name: "index_order_comments_on_order_id"
|
| 335 | + t.index ["user_id"], name: "fk_rails_9db67cf94d" |
316 | 336 | end
|
317 | 337 |
|
318 | 338 | create_table "orders", id: :integer, force: :cascade do |t|
|
|
331 | 351 | t.datetime "last_sent_mail"
|
332 | 352 | t.integer "end_action", default: 0, null: false
|
333 | 353 | t.decimal "transport", precision: 8, scale: 2
|
| 354 | + t.index ["created_by_user_id"], name: "fk_rails_30144627f8" |
| 355 | + t.index ["invoice_id"], name: "fk_rails_b33ed6c672" |
334 | 356 | t.index ["state"], name: "index_orders_on_state"
|
| 357 | + t.index ["supplier_id"], name: "fk_rails_d426350910" |
| 358 | + t.index ["updated_by_user_id"], name: "fk_rails_f3fe5911c4" |
335 | 359 | end
|
336 | 360 |
|
337 | 361 | create_table "page_versions", id: :integer, force: :cascade do |t|
|
|
343 | 367 | t.integer "parent_id"
|
344 | 368 | t.datetime "updated_at"
|
345 | 369 | t.index ["page_id"], name: "index_page_versions_on_page_id"
|
| 370 | + t.index ["parent_id"], name: "fk_rails_966d369f50" |
346 | 371 | end
|
347 | 372 |
|
348 | 373 | create_table "pages", id: :integer, force: :cascade do |t|
|
|
355 | 380 | t.integer "parent_id"
|
356 | 381 | t.datetime "created_at"
|
357 | 382 | t.datetime "updated_at"
|
| 383 | + t.index ["parent_id"], name: "fk_rails_409bbac70a" |
358 | 384 | t.index ["permalink"], name: "index_pages_on_permalink"
|
359 | 385 | t.index ["title"], name: "index_pages_on_title"
|
360 | 386 | end
|
|
379 | 405 | t.text "note"
|
380 | 406 | t.datetime "created_at"
|
381 | 407 | t.datetime "updated_at"
|
| 408 | + t.index ["ordergroup_id"], name: "fk_rails_931f43cfec" |
382 | 409 | t.index ["poll_id", "user_id", "ordergroup_id"], name: "index_poll_votes_on_poll_id_and_user_id_and_ordergroup_id", unique: true
|
| 410 | + t.index ["user_id"], name: "fk_rails_b64de9b025" |
383 | 411 | end
|
384 | 412 |
|
385 | 413 | create_table "polls", id: :integer, force: :cascade do |t|
|
|
399 | 427 | t.integer "max_points"
|
400 | 428 | t.datetime "created_at"
|
401 | 429 | t.datetime "updated_at"
|
| 430 | + t.index ["created_by_user_id"], name: "fk_rails_ddedb38d1d" |
402 | 431 | t.index ["final_choice"], name: "index_polls_on_final_choice"
|
403 | 432 | end
|
404 | 433 |
|
|
416 | 445 | t.integer "created_by_user_id", null: false
|
417 | 446 | t.integer "finished_by_user_id"
|
418 | 447 | t.datetime "finished_at"
|
| 448 | + t.index ["created_by_user_id"], name: "fk_rails_a222b5a8b4" |
419 | 449 | t.index ["finished_at"], name: "index_printer_jobs_on_finished_at"
|
| 450 | + t.index ["finished_by_user_id"], name: "fk_rails_c259d78e0a" |
| 451 | + t.index ["order_id"], name: "fk_rails_f691a1be68" |
420 | 452 | end
|
421 | 453 |
|
422 | 454 | create_table "settings", id: :integer, force: :cascade do |t|
|
|
435 | 467 | t.integer "stock_article_id"
|
436 | 468 | t.integer "quantity", default: 0
|
437 | 469 | t.datetime "created_at"
|
| 470 | + t.index ["order_id"], name: "fk_rails_6ddf028707" |
438 | 471 | t.index ["stock_article_id"], name: "index_stock_changes_on_stock_article_id"
|
439 | 472 | t.index ["stock_event_id"], name: "index_stock_changes_on_stock_event_id"
|
440 | 473 | end
|
|
446 | 479 | t.text "note"
|
447 | 480 | t.integer "invoice_id"
|
448 | 481 | t.string "type", null: false
|
| 482 | + t.index ["invoice_id"], name: "fk_rails_04a623ff69" |
449 | 483 | t.index ["supplier_id"], name: "index_stock_events_on_supplier_id"
|
450 | 484 | end
|
451 | 485 |
|
452 | 486 | create_table "supplier_categories", id: :integer, force: :cascade do |t|
|
453 | 487 | t.string "name", null: false
|
454 | 488 | t.string "description"
|
455 | 489 | t.integer "financial_transaction_class_id"
|
| 490 | + t.index ["financial_transaction_class_id"], name: "fk_rails_e4db9d9002" |
456 | 491 | end
|
457 | 492 |
|
458 | 493 | create_table "suppliers", id: :integer, force: :cascade do |t|
|
|
475 | 510 | t.string "iban"
|
476 | 511 | t.integer "supplier_category_id"
|
477 | 512 | t.index ["name"], name: "index_suppliers_on_name", unique: true
|
| 513 | + t.index ["shared_supplier_id"], name: "fk_rails_6958f49bbb" |
| 514 | + t.index ["supplier_category_id"], name: "fk_rails_f8fa27fa1f" |
478 | 515 | end
|
479 | 516 |
|
480 | 517 | create_table "tasks", id: :integer, force: :cascade do |t|
|
|
489 | 526 | t.integer "duration", default: 1
|
490 | 527 | t.integer "periodic_task_group_id"
|
491 | 528 | t.integer "created_by_user_id"
|
| 529 | + t.index ["created_by_user_id"], name: "fk_rails_1f562c7b99" |
492 | 530 | t.index ["due_date"], name: "index_tasks_on_due_date"
|
493 | 531 | t.index ["name"], name: "index_tasks_on_name"
|
| 532 | + t.index ["periodic_task_group_id"], name: "fk_rails_78a5d11f82" |
494 | 533 | t.index ["workgroup_id"], name: "index_tasks_on_workgroup_id"
|
495 | 534 | end
|
496 | 535 |
|
|
513 | 552 | t.index ["nick"], name: "index_users_on_nick", unique: true
|
514 | 553 | end
|
515 | 554 |
|
| 555 | + add_foreign_key "article_prices", "articles" |
| 556 | + add_foreign_key "articles", "article_categories" |
| 557 | + add_foreign_key "articles", "suppliers" |
| 558 | + add_foreign_key "assignments", "tasks" |
| 559 | + add_foreign_key "assignments", "users" |
| 560 | + add_foreign_key "bank_transactions", "bank_accounts" |
| 561 | + add_foreign_key "bank_transactions", "financial_links" |
| 562 | + add_foreign_key "documents", "users", column: "created_by_user_id" |
| 563 | + add_foreign_key "financial_transaction_types", "financial_transaction_classes" |
| 564 | + add_foreign_key "financial_transactions", "financial_links" |
| 565 | + add_foreign_key "financial_transactions", "financial_transaction_types" |
| 566 | + add_foreign_key "financial_transactions", "financial_transactions", column: "reverts_id" |
| 567 | + add_foreign_key "financial_transactions", "group_orders" |
| 568 | + add_foreign_key "financial_transactions", "groups", column: "ordergroup_id" |
| 569 | + add_foreign_key "financial_transactions", "users" |
| 570 | + add_foreign_key "group_order_article_quantities", "group_order_articles" |
| 571 | + add_foreign_key "group_order_articles", "group_orders" |
| 572 | + add_foreign_key "group_order_articles", "order_articles" |
| 573 | + add_foreign_key "group_orders", "groups", column: "ordergroup_id" |
| 574 | + add_foreign_key "group_orders", "orders" |
| 575 | + add_foreign_key "group_orders", "users", column: "updated_by_user_id" |
| 576 | + add_foreign_key "invites", "groups" |
| 577 | + add_foreign_key "invites", "users" |
| 578 | + add_foreign_key "invoices", "financial_links" |
| 579 | + add_foreign_key "invoices", "suppliers" |
| 580 | + add_foreign_key "invoices", "users", column: "created_by_user_id" |
| 581 | + add_foreign_key "memberships", "groups" |
| 582 | + add_foreign_key "memberships", "users" |
| 583 | + add_foreign_key "message_recipients", "messages" |
| 584 | + add_foreign_key "message_recipients", "users" |
| 585 | + add_foreign_key "messages", "groups" |
| 586 | + add_foreign_key "messages", "messages", column: "reply_to" |
| 587 | + add_foreign_key "messages", "users", column: "sender_id" |
| 588 | + add_foreign_key "order_articles", "article_prices" |
| 589 | + add_foreign_key "order_articles", "articles" |
| 590 | + add_foreign_key "order_articles", "orders" |
| 591 | + add_foreign_key "order_comments", "orders" |
| 592 | + add_foreign_key "order_comments", "users" |
| 593 | + add_foreign_key "orders", "invoices" |
| 594 | + add_foreign_key "orders", "suppliers" |
| 595 | + add_foreign_key "orders", "users", column: "created_by_user_id" |
| 596 | + add_foreign_key "orders", "users", column: "updated_by_user_id" |
| 597 | + add_foreign_key "page_versions", "pages" |
| 598 | + add_foreign_key "page_versions", "pages", column: "parent_id" |
| 599 | + add_foreign_key "pages", "pages", column: "parent_id" |
| 600 | + add_foreign_key "poll_choices", "poll_votes" |
| 601 | + add_foreign_key "poll_votes", "groups", column: "ordergroup_id" |
| 602 | + add_foreign_key "poll_votes", "polls" |
| 603 | + add_foreign_key "poll_votes", "users" |
| 604 | + add_foreign_key "polls", "users", column: "created_by_user_id" |
| 605 | + add_foreign_key "printer_job_updates", "printer_jobs" |
| 606 | + add_foreign_key "printer_jobs", "orders" |
| 607 | + add_foreign_key "printer_jobs", "users", column: "created_by_user_id" |
| 608 | + add_foreign_key "printer_jobs", "users", column: "finished_by_user_id" |
| 609 | + add_foreign_key "stock_changes", "articles", column: "stock_article_id" |
| 610 | + add_foreign_key "stock_changes", "orders" |
| 611 | + add_foreign_key "stock_changes", "stock_events" |
| 612 | + add_foreign_key "stock_events", "invoices" |
| 613 | + add_foreign_key "stock_events", "suppliers" |
| 614 | + add_foreign_key "supplier_categories", "financial_transaction_classes" |
| 615 | + add_foreign_key "suppliers", "supplier_categories" |
| 616 | + add_foreign_key "suppliers", "suppliers", column: "shared_supplier_id" |
| 617 | + add_foreign_key "tasks", "groups", column: "periodic_task_group_id" |
| 618 | + add_foreign_key "tasks", "groups", column: "workgroup_id" |
| 619 | + add_foreign_key "tasks", "users", column: "created_by_user_id" |
516 | 620 | end
|
0 commit comments