# This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # Note that this schema.rb definition is the authoritative source for your # database schema. If you need to create the application database on another # system, you should be using db:schema:load, not running all the migrations # from scratch. The latter is a flawed and unsustainable approach (the more migrations # you'll amass, the slower it'll run and the greater likelihood for issues). # # It's strongly recommended that you check this file into your version control system. ActiveRecord::Schema.define(version: 20181006131541) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" create_table "client_contract_articles", id: false, force: :cascade do |t| t.integer "client_contract_id" t.integer "contract_article_cpy_id" end create_table "logistics_core_addendums", id: :serial, force: :cascade do |t| t.integer "service_increment_id" t.integer "addition_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["addition_id"], name: "add_on_addition_indx" t.index ["service_increment_id"], name: "add_on_si_indx" end create_table "logistics_core_additional_documents", id: :serial, force: :cascade do |t| t.integer "document_type_id" t.string "documentable_type" t.integer "documentable_id" t.integer "original" t.integer "copy" t.integer "certified" t.boolean "is_endorsed" t.boolean "is_mandatory" t.integer "transaction_type_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["document_type_id"], name: "ad_on_dt_indx" t.index ["documentable_type", "documentable_id"], name: "document_type_on_additional_document_indx" t.index ["transaction_type_id"], name: "tt_on_ad_indx" end create_table "logistics_core_agencies", id: :serial, force: :cascade do |t| t.string "code" t.string "name" t.string "telephone" t.string "contact_person" t.string "city" t.string "subcity" t.integer "woreda" t.string "house_no" t.string "email" t.string "postal_code" t.string "contact_telephone" t.string "contact_email" t.integer "agency_category_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["agency_category_id"], name: "ac_on_agencies_indx" end create_table "logistics_core_agency_permit_documents", id: :serial, force: :cascade do |t| t.integer "agency_id" t.integer "document_type_id" t.integer "original_docs" t.integer "copy_docs" t.integer "certified_copy_docs" t.boolean "is_endorsed" t.boolean "is_mandatory" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["agency_id"], name: "apd_on_agency_indx" t.index ["document_type_id"], name: "apd_on_dt_indx" end create_table "logistics_core_agents", id: :serial, force: :cascade do |t| t.string "name" t.string "email" t.string "contact_telephone" t.datetime "created_at", null: false t.datetime "updated_at", null: false end create_table "logistics_core_air_cargo_limits", id: :serial, force: :cascade do |t| t.integer "chargeable_service_unit_of_charge_id" t.integer "transaction_type_id" t.float "lower_limit" t.float "upper_limit" t.float "over_charge_rate" t.date "effective_date" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["chargeable_service_unit_of_charge_id"], name: "acl_on_csuoc_indx" t.index ["transaction_type_id"], name: "acl_on_tt_indx" end create_table "logistics_core_air_volume_factors", id: :serial, force: :cascade do |t| t.float "factor" t.datetime "created_at", null: false t.datetime "updated_at", null: false end create_table "logistics_core_airway_bill_rates", id: :serial, force: :cascade do |t| t.integer "transaction_type_id" t.integer "chargeable_service_unit_of_charge_id" t.float "low" t.float "medium" t.float "high" t.date "effective_date" t.float "margin" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["chargeable_service_unit_of_charge_id"], name: "awb_on_csuoc" t.index ["transaction_type_id"], name: "awb_on_tt_indx" end create_table "logistics_core_bill_of_lading_rates", id: :serial, force: :cascade do |t| t.integer "chargeable_service_unit_of_charge_id" t.integer "transaction_type_id" t.date "effective_date" t.float "high" t.float "low" t.float "margin" t.float "medium" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["chargeable_service_unit_of_charge_id"], name: "bolr_on_csuoc_indx" t.index ["transaction_type_id"], name: "bolr_on_tt_indx" end create_table "logistics_core_break_bulk_cargo_details", id: :serial, force: :cascade do |t| t.float "actual_weight" t.float "volume" t.integer "quantity" t.integer "content_type_id" t.integer "offer_request_id" t.float "length" t.float "width" t.float "height" t.integer "cargo_type_id" t.string "description" t.integer "break_bulk_unit_id" t.string "status" t.integer "service_delivery_unit_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.float "truck_number", default: 0.0 t.index ["break_bulk_unit_id"], name: "bb_unit_on_break_bulk_cargo_type" t.index ["cargo_type_id"], name: "cargo_type_on_break_bulk_cargo_type" t.index ["content_type_id"], name: "content_on_break_bulk_cargo" t.index ["offer_request_id"], name: "offer_req_on_break_bulk_cargo" t.index ["service_delivery_unit_id"], name: "sdu_on_break_bulk_cargo" end create_table "logistics_core_break_bulk_demurrage_rates", id: :serial, force: :cascade do |t| t.integer "break_bulk_unit_id" t.integer "transaction_type_id" t.integer "demurrage_rate_period_id" t.float "rate" t.date "effective_date" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["break_bulk_unit_id"], name: "bbdr_on_bbu_indx" t.index ["demurrage_rate_period_id"], name: "bbdr_on_drp_indx" t.index ["transaction_type_id"], name: "bbdr_on_tt_indx" end create_table "logistics_core_break_bulk_rates", id: :serial, force: :cascade do |t| t.integer "transaction_type_id" t.integer "chargeable_service_unit_of_charge_id" t.float "low" t.float "medium" t.float "high" t.date "effective_date" t.float "margin" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["chargeable_service_unit_of_charge_id"], name: "bbr_on_csuoc_indx" t.index ["transaction_type_id"], name: "bbr_on_tt_indx" end create_table "logistics_core_break_bulk_storage_rates", id: :serial, force: :cascade do |t| t.integer "break_bulk_unit_id" t.integer "transaction_type_id" t.integer "warehouse_rate_period_id" t.integer "content_type_id" t.float "rate" t.date "effective_date" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["break_bulk_unit_id"], name: "bbsr_on_bbu_indx" t.index ["content_type_id"], name: "bbsr_on_ct_indx" t.index ["transaction_type_id"], name: "bbsr_on_tt_indx" t.index ["warehouse_rate_period_id"], name: "bbsr_on_wrp_indx" end create_table "logistics_core_break_bulk_truck_assignments", id: :serial, force: :cascade do |t| t.float "truck_type" t.datetime "created_at", null: false t.datetime "updated_at", null: false end create_table "logistics_core_break_bulk_unit_rates", id: :serial, force: :cascade do |t| t.integer "chargeable_service_unit_of_charge_id" t.integer "transaction_type_id" t.integer "break_bulk_unit_id" t.float "high" t.float "medium" t.float "low" t.date "effective_date" t.float "margin" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["break_bulk_unit_id"], name: "bbur_on_bbu_indx" t.index ["chargeable_service_unit_of_charge_id"], name: "bbur_on_csuoc_indx" t.index ["transaction_type_id"], name: "bbur_on_tt_indx" end create_table "logistics_core_broad_gauge_bbs", id: :serial, force: :cascade do |t| t.integer "break_bulk_unit_id" t.float "length" t.float "width" t.float "height" t.float "actual_weight" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["break_bulk_unit_id"], name: "bgbbs_on_bbu_indx" end create_table "logistics_core_broad_gauge_cnts", id: :serial, force: :cascade do |t| t.integer "container_size_id" t.integer "container_type_id" t.float "length" t.float "width" t.float "height" t.float "actual_weight" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["container_size_id"], name: "bgc_on_cs_indx" t.index ["container_type_id"], name: "bgc_on_ct_indx" end create_table "logistics_core_car_carrier_rates", id: :serial, force: :cascade do |t| t.integer "route_id" t.integer "break_bulk_unit_id" t.float "rate" t.float "margin" t.integer "transporter_id" t.integer "transport_rate_period_id" t.string "rate_type" t.integer "selected_transporter_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["break_bulk_unit_id"], name: "ccr_on_bbu_indx" t.index ["route_id"], name: "ccr_on_route_indx" t.index ["selected_transporter_id"], name: "ccr_on_st_indx" t.index ["transport_rate_period_id"], name: "ccr_on_trp_indx" t.index ["transporter_id"], name: "ccr_on_transporter_indx" end create_table "logistics_core_cargo_details", id: :serial, force: :cascade do |t| t.integer "container_type_id" t.integer "container_size_id" t.float "quantity" t.integer "content_type_id" t.integer "offer_request_id" t.integer "cargo_type_id" t.string "description" t.float "weight" t.float "length" t.float "width" t.float "height" t.string "status" t.integer "service_delivery_unit_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.float "truck_number", default: 0.0 t.index ["container_size_id"], name: "cnt_size_on_cargo_detail_indx" t.index ["container_type_id"], name: "cnt_type_on_cargo_detail_indx" t.index ["content_type_id"], name: "content_on_cargo_detail_indx" t.index ["offer_request_id"], name: "offer_req_on_cargo_detail_indx" end create_table "logistics_core_carrier_agents", id: :serial, force: :cascade do |t| t.integer "carrier_id" t.integer "agent_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["agent_id"], name: "ca_on_a_indx" t.index ["carrier_id"], name: "ca_on_c_indx" end create_table "logistics_core_carriers", id: :serial, force: :cascade do |t| t.string "name" t.string "email" t.string "contact_telephone" t.integer "carrier_type_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["carrier_type_id"], name: "index_logistics_core_carriers_on_carrier_type_id" end create_table "logistics_core_chargeable_service_container_type_rates", id: false, force: :cascade do |t| t.integer "special_increment_container_rate_id" t.integer "chargeable_service_unit_of_charge_id" t.index ["special_increment_container_rate_id", "chargeable_service_unit_of_charge_id"], name: "idx_container_type_special_increment_1" end create_table "logistics_core_chargeable_service_content_type_rates", id: false, force: :cascade do |t| t.integer "special_increment_content_rate_id" t.integer "chargeable_service_unit_of_charge_id" t.index ["special_increment_content_rate_id", "chargeable_service_unit_of_charge_id"], name: "idx_content_type_special_increment_1" end create_table "logistics_core_chargeable_service_increments", id: :serial, force: :cascade do |t| t.integer "chargeable_service_unit_of_charge_id" t.integer "service_increment_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["chargeable_service_unit_of_charge_id"], name: "csi_on_csuoc_indx" t.index ["service_increment_id"], name: "csi_on_si_indx" end create_table "logistics_core_chargeable_service_unit_of_charges", id: :serial, force: :cascade do |t| t.integer "service_delivery_unit_id" t.integer "chargeable_service_id" t.integer "unit_of_charge_id" t.boolean "has_increment" t.boolean "has_container_special_increment" t.boolean "has_content_special_increment" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["chargeable_service_id"], name: "csuoc_on_cs_indx" t.index ["service_delivery_unit_id"], name: "csuoc_on_sdu_indx" t.index ["unit_of_charge_id"], name: "csuoc_on_uoc_indx" end create_table "logistics_core_chargeable_services", id: :serial, force: :cascade do |t| t.string "code", null: false t.string "name", null: false t.integer "order" t.integer "chargeable_service_type_id" t.integer "transport_service_type_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["chargeable_service_type_id"], name: "cs_on_cst_indx" t.index ["transport_service_type_id"], name: "cs_on_tst_indx" end create_table "logistics_core_client_contracts", id: :serial, force: :cascade do |t| t.integer "offer_request_id" t.string "title" t.integer "status" t.string "ref_no" t.date "contract_date" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.date "expiry_date" t.date "effective_date" t.index ["offer_request_id"], name: "cc_on_or_indx" end create_table "logistics_core_clients", id: :serial, force: :cascade do |t| t.string "name", null: false t.string "postal_code" t.string "city" t.integer "country_id" t.integer "client_category_id" t.string "telephone" t.string "fax" t.string "email" t.string "license" t.string "tin" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["client_category_id"], name: "clent_on_client_category_indx" t.index ["country_id"], name: "index_logistics_core_clients_on_country_id" end create_table "logistics_core_common_documents", id: :serial, force: :cascade do |t| t.integer "document_type_id" t.integer "original" t.integer "copy" t.integer "certified" t.boolean "is_endorsed" t.boolean "is_mandatory" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["document_type_id"], name: "dt_on_cd" end create_table "logistics_core_container_demurrage_rates", id: :serial, force: :cascade do |t| t.integer "container_size_id" t.integer "transaction_type_id" t.integer "demurrage_rate_period_id" t.integer "container_type_id" t.integer "content_type_id" t.float "rate" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["container_size_id"], name: "cdr_on_cs_indx" t.index ["container_type_id"], name: "cdr_on_ct_indx" t.index ["content_type_id"], name: "cdr_on_cnt_indx" t.index ["demurrage_rate_period_id"], name: "cdr_on_drp_indx" t.index ["transaction_type_id"], name: "cdr_on_tt_indx" end create_table "logistics_core_container_storage_rates", id: :serial, force: :cascade do |t| t.integer "container_size_id" t.integer "transaction_type_id" t.integer "warehouse_rate_period_id" t.integer "container_type_id" t.integer "content_type_id" t.float "rate" t.date "effective_date" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["container_size_id"], name: "csr_on_cs_indx" t.index ["container_type_id"], name: "csr_on_ct_indx" t.index ["content_type_id"], name: "csr_on_cnt_indx" t.index ["transaction_type_id"], name: "csr_on_tt_indx" t.index ["warehouse_rate_period_id"], name: "csr_on_wrp_indx" end create_table "logistics_core_container_types", id: :serial, force: :cascade do |t| t.string "code" t.string "name" t.boolean "is_standard", default: false end create_table "logistics_core_contract_article_cpies", id: :serial, force: :cascade do |t| t.string "tag" t.string "name" t.string "text" t.integer "parent_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false end create_table "logistics_core_contract_break_bulk_unit_rates", id: :serial, force: :cascade do |t| t.integer "chargeable_service_unit_of_charge_id" t.integer "transaction_type_id" t.integer "break_bulk_unit_id" t.boolean "in_contract" t.float "rate" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.integer "contract_id" t.float "margin" t.index ["break_bulk_unit_id"], name: "cabr_on_bbu3_indx" t.index ["chargeable_service_unit_of_charge_id"], name: "cabr_on_csuoc3_indx" t.index ["transaction_type_id"], name: "cabr_on_tt3_indx" end create_table "logistics_core_contract_container_rates", id: :serial, force: :cascade do |t| t.integer "chargeable_service_unit_of_charge_id" t.integer "transaction_type_id" t.integer "container_size_id" t.boolean "in_contract" t.float "margin" t.float "rate" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.integer "contract_id" t.index ["chargeable_service_unit_of_charge_id"], name: "cabr_on_csuoc1_indx" t.index ["container_size_id"], name: "cabr_on_cs1_indx" t.index ["transaction_type_id"], name: "cabr_on_tt1_indx" end create_table "logistics_core_contract_item_rates", id: :serial, force: :cascade do |t| t.integer "chargeable_service_unit_of_charge_id" t.integer "transaction_type_id" t.boolean "in_contract" t.float "margin" t.float "minimum_quantity" t.float "rate" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.integer "contract_id" t.index ["chargeable_service_unit_of_charge_id"], name: "cabr_on_csuoc2_indx" t.index ["transaction_type_id"], name: "cabr_on_tt2_indx" end create_table "logistics_core_contract_kilogram_rates", id: :serial, force: :cascade do |t| t.float "from" t.boolean "in_contract" t.float "margin" t.float "rate" t.float "to" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.integer "contract_id" end create_table "logistics_core_contract_rates", id: :serial, force: :cascade do |t| t.integer "chargeable_service_unit_of_charge_id" t.integer "transaction_type_id" t.boolean "in_contract" t.float "rate" t.string "type" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.integer "contract_id" t.float "margin" t.index ["chargeable_service_unit_of_charge_id"], name: "cabr_on_csuoc_indx" t.index ["transaction_type_id"], name: "cabr_on_tt_indx" end create_table "logistics_core_contracts", id: :serial, force: :cascade do |t| t.string "contract_number" t.string "title" t.date "start_date" t.date "end_date" t.date "contract_signed_date" t.integer "client_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false end create_table "logistics_core_convoy_rates", id: :serial, force: :cascade do |t| t.integer "chargeable_service_unit_of_charge_id" t.integer "transaction_type_id" t.date "effective_date" t.float "high" t.float "low" t.float "margin" t.float "medium" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["chargeable_service_unit_of_charge_id"], name: "cr_on_csuoc_indx" t.index ["transaction_type_id"], name: "cr_on_tt_selindx" end create_table "logistics_core_currency_rates", id: :serial, force: :cascade do |t| t.float "rate_to_base_selling", null: false t.float "rate_to_base_buying" t.date "rate_date", default: "2018-10-07", null: false t.integer "currency_id", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["currency_id"], name: "currency_on_currency_rate_indx" end create_table "logistics_core_customs_offices", id: :serial, force: :cascade do |t| t.string "code", null: false t.string "name", null: false t.text "location", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false end create_table "logistics_core_customs_transport_tariffs", id: :serial, force: :cascade do |t| t.integer "route_id", null: false t.integer "entry_point_id", null: false t.float "total_distance", null: false t.float "distance_to_entry_point", null: false t.float "proportion", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["entry_point_id"], name: "ctt_on_ep_indx" t.index ["route_id", "entry_point_id"], name: "route_entry_point_uniq_indx", unique: true t.index ["route_id"], name: "ctt_on_route_indx" end create_table "logistics_core_declarants", id: :serial, force: :cascade do |t| t.string "first_name" t.string "last_name" t.string "number" t.datetime "created_at", null: false t.datetime "updated_at", null: false end create_table "logistics_core_declaration_types", id: :serial, force: :cascade do |t| t.string "code", null: false t.string "name", null: false t.integer "transaction_type_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["transaction_type_id"], name: "dt_on_tt_indx" end create_table "logistics_core_demurrage_rate_periods", id: :serial, force: :cascade do |t| t.integer "carrier_agent_id" t.integer "from" t.integer "to" t.string "rate_period" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["carrier_agent_id"], name: "drp_on_ca_indx" end create_table "logistics_core_demurrage_rates", id: :serial, force: :cascade do |t| t.integer "demurrage_rate_period_id" t.integer "unit_of_charge_id" t.float "rate" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["demurrage_rate_period_id"], name: "dr_on_drp_indx" t.index ["unit_of_charge_id"], name: "dr_on_uoc_indx" end create_table "logistics_core_document_types", id: :serial, force: :cascade do |t| t.string "code" t.string "name" t.string "description" t.integer "document_type_category_id" t.integer "document_type_origin_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["document_type_category_id"], name: "dtc_on_dt" t.index ["document_type_origin_id"], name: "dto_on_dt" end create_table "logistics_core_equipment_service_rates", id: :serial, force: :cascade do |t| t.string "code" t.string "description" t.date "effective_date" t.string "name" t.float "rate_hr" t.float "rate_km" t.date "valid_until" t.datetime "created_at", null: false t.datetime "updated_at", null: false end create_table "logistics_core_esl_transport_tariff_rates", id: :serial, force: :cascade do |t| t.integer "esl_transport_tariff_id", null: false t.float "qt_from", null: false t.float "qt_to", null: false t.float "rate", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["esl_transport_tariff_id", "qt_from", "qt_to"], name: "transport_from_to_uniq_indx", unique: true t.index ["esl_transport_tariff_id"], name: "tariff_rate_on_transport_tariff_indx" end create_table "logistics_core_esl_transport_tariffs", id: :serial, force: :cascade do |t| t.integer "route_id", null: false t.string "storage_point", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["route_id", "storage_point"], name: "route_storage_point_uniq_indx", unique: true t.index ["route_id"], name: "route_on_transport_tariffs_indx" end create_table "logistics_core_extended_lookups", id: :serial, force: :cascade do |t| t.string "code", null: false t.string "name", null: false t.string "description" t.string "type", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["code", "type"], name: "index_logistics_core_extended_lookups_on_code_and_type", unique: true end create_table "logistics_core_freight_ton_demurrage_rates", id: :serial, force: :cascade do |t| t.integer "demurrage_rate_period_id" t.integer "transaction_type_id" t.date "effective_date" t.float "rate" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["demurrage_rate_period_id"], name: "ftdr_on_drp_indx" t.index ["transaction_type_id"], name: "ftdr_on_tt_indx" end create_table "logistics_core_freight_ton_storage_rates", id: :serial, force: :cascade do |t| t.integer "content_type_id" t.integer "transaction_type_id" t.integer "warehouse_rate_period_id" t.date "effective_date" t.float "rate" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["content_type_id"], name: "ftsr_on_ct_indx" t.index ["transaction_type_id"], name: "ftsr_on_tt_indx" t.index ["warehouse_rate_period_id"], name: "ftsr_on_wrp_indx" end create_table "logistics_core_increment_rates", id: :serial, force: :cascade do |t| t.float "percent" t.date "effective_date" t.integer "service_increment_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["service_increment_id"], name: "ir_on_si_indx" end create_table "logistics_core_item_rates", id: :serial, force: :cascade do |t| t.integer "chargeable_service_unit_of_charge_id" t.date "effective_date" t.float "margin" t.float "minimum_quantity" t.float "rate" t.integer "transaction_type_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["chargeable_service_unit_of_charge_id"], name: "ir_on_csuoc_indx" t.index ["transaction_type_id"], name: "ir_on_tt_indx" end create_table "logistics_core_kilogram_rates", id: :serial, force: :cascade do |t| t.float "from" t.float "to" t.float "high" t.float "medium" t.float "low" t.float "margin" t.date "effective_date" t.integer "chargeable_service_unit_of_charge_id" t.integer "transaction_type_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["chargeable_service_unit_of_charge_id"], name: "kr_on_csuoc_indx" t.index ["transaction_type_id"], name: "kr_on_tt_indx" end create_table "logistics_core_lookups", id: :serial, force: :cascade do |t| t.string "code", null: false t.string "name", null: false t.string "type", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["code", "type"], name: "index_logistics_core_lookups_on_code_and_type", unique: true end create_table "logistics_core_offer_requests", id: :serial, force: :cascade do |t| t.string "request_no" t.integer "user_id" t.integer "communication_channel_id" t.string "status" t.string "source_detail" t.string "point_of_recipient" t.date "date_of_recipient" t.string "general_remark" t.string "rate_level" t.string "security_status" t.boolean "is_sent" t.date "sent_date" t.string "remark" t.date "date_status_set" t.integer "no_of_items" t.integer "no_of_convoy" t.boolean "is_bulk" t.integer "agent_id" t.integer "carrier_id" t.date "arrival_date" t.float "days_before_returning_container" t.float "days_until_loaded" t.string "quotation_status" t.string "additional_service_status" t.integer "operation_id" t.integer "warehouse_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.integer "client_id" t.boolean "freight_forwarding" t.boolean "customs_clearing" t.boolean "transport" t.integer "operation_type_id" t.integer "transaction_type_id" t.integer "contract_id" t.index ["agent_id"], name: "or_on_agent_indx" t.index ["carrier_id"], name: "or_on_carrier_indx" t.index ["communication_channel_id"], name: "or_on_cc_indx" t.index ["operation_id"], name: "or_on_operation_indx" t.index ["user_id"], name: "or_on_user_indx" t.index ["warehouse_id"], name: "warehouse_on_or_indx" end create_table "logistics_core_operation_documents", id: :serial, force: :cascade do |t| t.integer "operation_id" t.string "document", null: false t.integer "original", null: false t.integer "copy", null: false t.integer "certified", null: false t.boolean "is_mandatory", default: false, null: false t.boolean "is_accepted", default: false, null: false t.string "source" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "file" t.index ["operation_id"], name: "od_on_operation_indx" end create_table "logistics_core_operation_summaries", id: :serial, force: :cascade do |t| t.integer "operation_id", null: false t.text "tax" t.text "fact" t.text "declaration" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["operation_id"], name: "index_logistics_core_operation_summaries_on_operation_id" end create_table "logistics_core_operations", id: :serial, force: :cascade do |t| t.string "operation_number" t.string "contract_number" t.boolean "is_new_customer", default: false t.string "status" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.integer "offer_request_id" t.integer "declarant_id" t.integer "declaration_type_id" t.integer "transport_mode_id" t.integer "customs_office_id" t.integer "customs_office_unit_id" t.integer "country_of_origin_id" t.integer "acquisition_mode_id" t.integer "payment_term_id" t.integer "delivery_term_id" t.integer "container_arrangement_id" t.integer "customs_transport_tariff_id" t.integer "esl_transport_tariff_id" t.integer "warehouse_id" t.string "trade_license_number" t.string "tin_number" t.string "t_number" t.string "investment_license_number" t.string "load_level" t.boolean "is_transfer" t.string "transfer_name" t.string "transfer_tin_no" t.string "transport_modality" t.boolean "tasks_generated", default: false t.integer "owner_id" t.index ["acquisition_mode_id"], name: "am_on_od_indx" t.index ["container_arrangement_id"], name: "ca_on_od_indx" t.index ["country_of_origin_id"], name: "coo_on_od_indx" t.index ["customs_office_id"], name: "co_on_od_indx" t.index ["customs_office_unit_id"], name: "cou_on_od_indx" t.index ["customs_transport_tariff_id"], name: "ctt_on_od_indx" t.index ["declarant_id"], name: "declarant_on_od_indx" t.index ["declaration_type_id"], name: "dty_on_od_indx" t.index ["delivery_term_id"], name: "dt_on_od_indx" t.index ["esl_transport_tariff_id"], name: "ett_on_od_indx" t.index ["owner_id"], name: "operations_on_owner_indx" t.index ["payment_term_id"], name: "pt_on_od_indx" t.index ["transport_mode_id"], name: "tm_on_od_indx" t.index ["warehouse_id"], name: "wh_on_od_indx" end create_table "logistics_core_out_of_gauge_bb_rates", id: :serial, force: :cascade do |t| t.integer "break_bulk_unit_id" t.date "effective_date" t.float "height_from" t.float "height_to" t.float "length_from" t.float "length_to" t.float "margin" t.float "rate" t.integer "route_id" t.date "valid_until" t.float "weight_from" t.float "weight_to" t.float "width_from" t.float "width_to" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["break_bulk_unit_id"], name: "oogbr_on_bbu_indx" t.index ["route_id"], name: "oogbr_on_route_indx" end create_table "logistics_core_out_of_gauge_cnt_rates", id: :serial, force: :cascade do |t| t.integer "container_size_id" t.date "effective_date" t.float "height_from" t.float "height_to" t.float "length_from" t.float "length_to" t.float "margin" t.float "rate" t.integer "route_id" t.date "valid_until" t.float "weight_from" t.float "weight_to" t.float "width_from" t.float "width_to" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["container_size_id"], name: "oogcr_on_cs_indx" t.index ["route_id"], name: "oogcr_on_route_indx" end create_table "logistics_core_reference_numbers", id: :serial, force: :cascade do |t| t.string "reference_type" t.string "prefix" t.integer "next_no" t.datetime "created_at", null: false t.datetime "updated_at", null: false end create_table "logistics_core_review_notes", id: :serial, force: :cascade do |t| t.string "note" t.integer "correspondence_id" t.string "correspondence_type" t.datetime "created_at", null: false t.datetime "updated_at", null: false end create_table "logistics_core_route_rates", id: :serial, force: :cascade do |t| t.float "rate" t.integer "route_id" t.integer "transporter_id" t.integer "weight_range_id" t.integer "rate_period_id" t.string "rate_type" t.integer "container_size_id" t.integer "selected_transporter_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["container_size_id"], name: "rr_on_cs_indx" t.index ["rate_period_id"], name: "rr_on_rp_indx" t.index ["route_id"], name: "rr_on_route_indx" t.index ["selected_transporter_id"], name: "rr_on_st_indx" t.index ["transporter_id"], name: "rr_on_transporter_indx" t.index ["weight_range_id"], name: "rr_on_wr_indx" end create_table "logistics_core_routes", id: :serial, force: :cascade do |t| t.integer "from_id" t.integer "to_id" t.string "description" t.integer "node_id" t.string "zone" t.float "radius" t.string "route_type" t.float "margin" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["from_id"], name: "route_on_rl_from_indx" t.index ["node_id"], name: "route_on_rl_node_indx" t.index ["to_id"], name: "route_on_rl_to_indx" end create_table "logistics_core_self_driving_rates", id: :serial, force: :cascade do |t| t.integer "break_bulk_unit_id" t.float "margin" t.decimal "rate" t.integer "rate_period_id" t.string "rate_type" t.integer "route_id" t.integer "selected_transporter_id" t.integer "transporter_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["break_bulk_unit_id"], name: "sdr_on_bbu_indx" t.index ["rate_period_id"], name: "sdr_on_trp_indx" t.index ["route_id"], name: "sdr_on_route_indx" t.index ["selected_transporter_id"], name: "sdr_on_st_indx" t.index ["transporter_id"], name: "sdr_on_transporter_indx" end create_table "logistics_core_service_delivery_unit_chargeable_services", id: :serial, force: :cascade do |t| t.integer "service_delivery_unit_id" t.integer "chargeable_service_id" t.boolean "is_mandatory", default: false t.index ["service_delivery_unit_id", "chargeable_service_id"], name: "sdu_on_services_indx" end create_table "logistics_core_service_delivery_unit_services", id: :serial, force: :cascade do |t| t.integer "service_delivery_unit_id" t.integer "chargeable_service_id" t.boolean "is_mandatory" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["chargeable_service_id"], name: "sdus_on_cs_indx" t.index ["service_delivery_unit_id"], name: "sdus_on_sdu_indx" end create_table "logistics_core_service_delivery_units", id: :serial, force: :cascade do |t| t.string "code", null: false t.string "name", null: false t.integer "currency_id", null: false t.string "address" t.integer "parent_id" t.integer "service_delivery_unit_type_id", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["currency_id"], name: "currency_on_sdu_indx" t.index ["service_delivery_unit_type_id"], name: "sdu_type_on_sdu_indx" end create_table "logistics_core_service_increments", id: :serial, force: :cascade do |t| t.string "code" t.string "name" t.boolean "has_increment" t.integer "chargeable_service_unit_of_charge_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["chargeable_service_unit_of_charge_id"], name: "si_on_csuoc_indx" end create_table "logistics_core_service_rates", id: :serial, force: :cascade do |t| t.integer "container_size_id" t.integer "transaction_type_id" t.integer "chargeable_service_unit_of_charge_id" t.float "low" t.float "medium" t.float "high" t.date "effective_date" t.float "margin" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["chargeable_service_unit_of_charge_id"], name: "sr_on_csuoc_indx" t.index ["container_size_id"], name: "sr_on_cs_indx" t.index ["transaction_type_id"], name: "sr_on_tt_indx" end create_table "logistics_core_special_increment_container_rates", id: :serial, force: :cascade do |t| t.integer "container_type_id" t.float "rate" t.date "effective_date" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["container_type_id"], name: "sicr_on_cnt_indx" end create_table "logistics_core_special_increment_content_rates", id: :serial, force: :cascade do |t| t.integer "content_type_id" t.float "rate" t.date "effective_date" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["content_type_id"], name: "sicr_on_ct_indx" end create_table "logistics_core_transport_rate_periods", id: :serial, force: :cascade do |t| t.date "effective_date" t.date "valid_until" t.boolean "current_period" t.datetime "created_at", null: false t.datetime "updated_at", null: false end create_table "logistics_core_transporters", id: :serial, force: :cascade do |t| t.string "name" t.string "postal_code" t.string "city" t.integer "country_id" t.string "telephone" t.string "fax" t.string "email" t.string "contact_person" t.string "contact_telephone" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["country_id"], name: "transporter_on_country_indx" end create_table "logistics_core_truck_rates", id: :serial, force: :cascade do |t| t.integer "transaction_type_id" t.integer "chargeable_service_unit_of_charge_id" t.float "rate" t.date "effective_date" t.float "low" t.float "medium" t.float "high" t.float "margin" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["chargeable_service_unit_of_charge_id"], name: "tr_on_csuoc_indx" t.index ["transaction_type_id"], name: "tr_on_tt_indx" end create_table "logistics_core_truck_type_assignments", id: :serial, force: :cascade do |t| t.integer "container_size_id" t.float "truck_type" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["container_size_id"], name: "tta_on_cs_indx" end create_table "logistics_core_truck_type_bb_weight_ranges", id: :serial, force: :cascade do |t| t.integer "weight_range_id" t.integer "break_bulk_truck_assignment_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["break_bulk_truck_assignment_id"], name: "ttbbwr_on_bbta_indx" t.index ["weight_range_id"], name: "ttbbwr_on_wr_indx" end create_table "logistics_core_truck_type_cnt_weight_ranges", id: :serial, force: :cascade do |t| t.integer "truck_type_assignment_id" t.integer "weight_range_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["truck_type_assignment_id"], name: "ttcwr_on_tta_indx" t.index ["weight_range_id"], name: "ttcwr_on_wr_indx" end create_table "logistics_core_twenty_feet_equivalence_ratios", id: :serial, force: :cascade do |t| t.integer "container_size_id" t.float "ratio" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["container_size_id"], name: "tfer_on_cs_indx" end create_table "logistics_core_twenty_foot_equivalence_unit_rates", id: :serial, force: :cascade do |t| t.integer "chargeable_service_unit_of_charge_id" t.date "effective_date" t.float "high" t.float "low" t.float "medium" t.float "margin" t.integer "transaction_type_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["chargeable_service_unit_of_charge_id"], name: "tfeur_on_csuoc_indx" t.index ["transaction_type_id"], name: "tfeur_on_tt_indx" end create_table "logistics_core_units", id: :serial, force: :cascade do |t| t.string "name" t.string "abbreviation" t.integer "unit_type_id" t.float "rate_to_base" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["unit_type_id"], name: "units_on_ut_indx" end create_table "logistics_core_warehouse_rate_periods", id: :serial, force: :cascade do |t| t.integer "warehouse_id" t.string "rate_period" t.integer "from" t.integer "to" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["warehouse_id"], name: "wrp_on_wh_indx" end create_table "logistics_core_warehouses", id: :serial, force: :cascade do |t| t.string "code" t.string "name" t.string "description" t.string "location" t.string "email" t.string "contact_telephone" t.datetime "created_at", null: false t.datetime "updated_at", null: false end create_table "logistics_core_weight_ranges", id: :serial, force: :cascade do |t| t.float "weight_from" t.float "weight_to" t.datetime "created_at", null: false t.datetime "updated_at", null: false end create_table "mks_auth_application_modules", id: :serial, force: :cascade do |t| t.string "code", null: false t.string "name", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false end create_table "mks_auth_menus", id: :serial, force: :cascade do |t| t.string "text", null: false t.string "icon_cls" t.string "class_name" t.string "location" t.integer "parent_id" t.integer "application_module_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["application_module_id"], name: "index_mks_auth_menus_on_application_module_id" t.index ["parent_id"], name: "index_mks_auth_menus_on_parent_id" end create_table "mks_auth_menus_user_roles", id: :serial, force: :cascade do |t| t.integer "menu_id" t.integer "user_role_id" t.index ["menu_id", "user_role_id"], name: "index_mks_auth_menus_user_roles_on_menu_id_and_user_role_id" end create_table "mks_auth_user_roles", id: :serial, force: :cascade do |t| t.string "name", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false end create_table "mks_auth_users", id: :serial, force: :cascade do |t| t.string "first_name", null: false t.string "last_name", null: false t.string "email", null: false t.boolean "active", default: true, null: false t.integer "application_module_id" t.string "password_digest" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["application_module_id"], name: "index_mks_auth_users_on_application_module_id" end create_table "mks_auth_users_user_roles", id: false, force: :cascade do |t| t.integer "user_id" t.integer "user_role_id" t.index ["user_id", "user_role_id"], name: "index_mks_auth_users_user_roles_on_user_id_and_user_role_id" end add_foreign_key "logistics_core_addendums", "logistics_core_service_increments", column: "addition_id", name: "fk_addendum_additions" add_foreign_key "logistics_core_addendums", "logistics_core_service_increments", column: "service_increment_id", name: "fk_addendum_service_increments" add_foreign_key "logistics_core_additional_documents", "logistics_core_document_types", column: "document_type_id" add_foreign_key "logistics_core_additional_documents", "logistics_core_lookups", column: "transaction_type_id" add_foreign_key "logistics_core_agencies", "logistics_core_extended_lookups", column: "agency_category_id" add_foreign_key "logistics_core_agency_permit_documents", "logistics_core_agencies", column: "agency_id" add_foreign_key "logistics_core_agency_permit_documents", "logistics_core_document_types", column: "document_type_id" add_foreign_key "logistics_core_air_cargo_limits", "logistics_core_chargeable_service_unit_of_charges", column: "chargeable_service_unit_of_charge_id" add_foreign_key "logistics_core_air_cargo_limits", "logistics_core_lookups", column: "transaction_type_id" add_foreign_key "logistics_core_airway_bill_rates", "logistics_core_chargeable_service_unit_of_charges", column: "chargeable_service_unit_of_charge_id" add_foreign_key "logistics_core_airway_bill_rates", "logistics_core_lookups", column: "transaction_type_id" add_foreign_key "logistics_core_bill_of_lading_rates", "logistics_core_chargeable_service_unit_of_charges", column: "chargeable_service_unit_of_charge_id" add_foreign_key "logistics_core_bill_of_lading_rates", "logistics_core_lookups", column: "transaction_type_id" add_foreign_key "logistics_core_break_bulk_cargo_details", "logistics_core_lookups", column: "break_bulk_unit_id" add_foreign_key "logistics_core_break_bulk_cargo_details", "logistics_core_lookups", column: "cargo_type_id" add_foreign_key "logistics_core_break_bulk_cargo_details", "logistics_core_lookups", column: "content_type_id" add_foreign_key "logistics_core_break_bulk_cargo_details", "logistics_core_offer_requests", column: "offer_request_id" add_foreign_key "logistics_core_break_bulk_demurrage_rates", "logistics_core_demurrage_rate_periods", column: "demurrage_rate_period_id" add_foreign_key "logistics_core_break_bulk_demurrage_rates", "logistics_core_lookups", column: "break_bulk_unit_id" add_foreign_key "logistics_core_break_bulk_demurrage_rates", "logistics_core_lookups", column: "transaction_type_id" add_foreign_key "logistics_core_break_bulk_rates", "logistics_core_chargeable_service_unit_of_charges", column: "chargeable_service_unit_of_charge_id" add_foreign_key "logistics_core_break_bulk_rates", "logistics_core_lookups", column: "transaction_type_id" add_foreign_key "logistics_core_break_bulk_storage_rates", "logistics_core_lookups", column: "break_bulk_unit_id" add_foreign_key "logistics_core_break_bulk_storage_rates", "logistics_core_lookups", column: "content_type_id" add_foreign_key "logistics_core_break_bulk_storage_rates", "logistics_core_lookups", column: "transaction_type_id" add_foreign_key "logistics_core_break_bulk_storage_rates", "logistics_core_warehouse_rate_periods", column: "warehouse_rate_period_id" add_foreign_key "logistics_core_break_bulk_unit_rates", "logistics_core_chargeable_service_unit_of_charges", column: "chargeable_service_unit_of_charge_id" add_foreign_key "logistics_core_break_bulk_unit_rates", "logistics_core_lookups", column: "break_bulk_unit_id" add_foreign_key "logistics_core_break_bulk_unit_rates", "logistics_core_lookups", column: "transaction_type_id" add_foreign_key "logistics_core_broad_gauge_bbs", "logistics_core_lookups", column: "break_bulk_unit_id" add_foreign_key "logistics_core_broad_gauge_cnts", "logistics_core_lookups", column: "container_size_id" add_foreign_key "logistics_core_broad_gauge_cnts", "logistics_core_lookups", column: "container_type_id" add_foreign_key "logistics_core_car_carrier_rates", "logistics_core_lookups", column: "break_bulk_unit_id" add_foreign_key "logistics_core_car_carrier_rates", "logistics_core_routes", column: "route_id" add_foreign_key "logistics_core_car_carrier_rates", "logistics_core_transport_rate_periods", column: "transport_rate_period_id" add_foreign_key "logistics_core_car_carrier_rates", "logistics_core_transporters", column: "selected_transporter_id", name: "fk_ccr_on_selected_transporter" add_foreign_key "logistics_core_car_carrier_rates", "logistics_core_transporters", column: "transporter_id" add_foreign_key "logistics_core_cargo_details", "logistics_core_container_types", column: "container_type_id" add_foreign_key "logistics_core_cargo_details", "logistics_core_lookups", column: "container_size_id" add_foreign_key "logistics_core_cargo_details", "logistics_core_lookups", column: "content_type_id" add_foreign_key "logistics_core_cargo_details", "logistics_core_offer_requests", column: "offer_request_id" add_foreign_key "logistics_core_carriers", "logistics_core_extended_lookups", column: "carrier_type_id" add_foreign_key "logistics_core_chargeable_service_container_type_rates", "logistics_core_chargeable_service_unit_of_charges", column: "chargeable_service_unit_of_charge_id" add_foreign_key "logistics_core_chargeable_service_container_type_rates", "logistics_core_special_increment_container_rates", column: "special_increment_container_rate_id" add_foreign_key "logistics_core_chargeable_service_content_type_rates", "logistics_core_chargeable_service_unit_of_charges", column: "chargeable_service_unit_of_charge_id" add_foreign_key "logistics_core_chargeable_service_content_type_rates", "logistics_core_special_increment_content_rates", column: "special_increment_content_rate_id" add_foreign_key "logistics_core_chargeable_service_increments", "logistics_core_chargeable_service_unit_of_charges", column: "chargeable_service_unit_of_charge_id" add_foreign_key "logistics_core_chargeable_service_increments", "logistics_core_service_increments", column: "service_increment_id" add_foreign_key "logistics_core_chargeable_service_unit_of_charges", "logistics_core_chargeable_services", column: "chargeable_service_id" add_foreign_key "logistics_core_chargeable_service_unit_of_charges", "logistics_core_lookups", column: "unit_of_charge_id" add_foreign_key "logistics_core_chargeable_service_unit_of_charges", "logistics_core_service_delivery_units", column: "service_delivery_unit_id" add_foreign_key "logistics_core_chargeable_services", "logistics_core_lookups", column: "chargeable_service_type_id" add_foreign_key "logistics_core_chargeable_services", "logistics_core_lookups", column: "transport_service_type_id" add_foreign_key "logistics_core_client_contracts", "logistics_core_offer_requests", column: "offer_request_id" add_foreign_key "logistics_core_clients", "logistics_core_lookups", column: "client_category_id", name: "fk_cl_on_cc" add_foreign_key "logistics_core_clients", "logistics_core_lookups", column: "country_id" add_foreign_key "logistics_core_common_documents", "logistics_core_document_types", column: "document_type_id" add_foreign_key "logistics_core_container_demurrage_rates", "logistics_core_demurrage_rate_periods", column: "demurrage_rate_period_id" add_foreign_key "logistics_core_container_demurrage_rates", "logistics_core_lookups", column: "container_size_id" add_foreign_key "logistics_core_container_demurrage_rates", "logistics_core_lookups", column: "container_type_id" add_foreign_key "logistics_core_container_demurrage_rates", "logistics_core_lookups", column: "content_type_id" add_foreign_key "logistics_core_container_demurrage_rates", "logistics_core_lookups", column: "transaction_type_id" add_foreign_key "logistics_core_container_storage_rates", "logistics_core_lookups", column: "container_size_id" add_foreign_key "logistics_core_container_storage_rates", "logistics_core_lookups", column: "container_type_id" add_foreign_key "logistics_core_container_storage_rates", "logistics_core_lookups", column: "content_type_id" add_foreign_key "logistics_core_container_storage_rates", "logistics_core_lookups", column: "transaction_type_id" add_foreign_key "logistics_core_container_storage_rates", "logistics_core_warehouse_rate_periods", column: "warehouse_rate_period_id" add_foreign_key "logistics_core_contract_break_bulk_unit_rates", "logistics_core_chargeable_service_unit_of_charges", column: "chargeable_service_unit_of_charge_id" add_foreign_key "logistics_core_contract_break_bulk_unit_rates", "logistics_core_lookups", column: "break_bulk_unit_id", name: "fk_cabr_on_bbu" add_foreign_key "logistics_core_contract_break_bulk_unit_rates", "logistics_core_lookups", column: "transaction_type_id" add_foreign_key "logistics_core_contract_container_rates", "logistics_core_chargeable_service_unit_of_charges", column: "chargeable_service_unit_of_charge_id" add_foreign_key "logistics_core_contract_container_rates", "logistics_core_lookups", column: "container_size_id", name: "fk_cabr_on_cs" add_foreign_key "logistics_core_contract_container_rates", "logistics_core_lookups", column: "transaction_type_id" add_foreign_key "logistics_core_contract_item_rates", "logistics_core_chargeable_service_unit_of_charges", column: "chargeable_service_unit_of_charge_id" add_foreign_key "logistics_core_contract_item_rates", "logistics_core_lookups", column: "transaction_type_id" add_foreign_key "logistics_core_contract_rates", "logistics_core_chargeable_service_unit_of_charges", column: "chargeable_service_unit_of_charge_id" add_foreign_key "logistics_core_contract_rates", "logistics_core_lookups", column: "transaction_type_id" add_foreign_key "logistics_core_contracts", "logistics_core_clients", column: "client_id" add_foreign_key "logistics_core_convoy_rates", "logistics_core_chargeable_service_unit_of_charges", column: "chargeable_service_unit_of_charge_id" add_foreign_key "logistics_core_convoy_rates", "logistics_core_lookups", column: "transaction_type_id" add_foreign_key "logistics_core_currency_rates", "logistics_core_lookups", column: "currency_id" add_foreign_key "logistics_core_customs_transport_tariffs", "logistics_core_extended_lookups", column: "entry_point_id" add_foreign_key "logistics_core_customs_transport_tariffs", "logistics_core_routes", column: "route_id" add_foreign_key "logistics_core_declaration_types", "logistics_core_lookups", column: "transaction_type_id" add_foreign_key "logistics_core_demurrage_rate_periods", "logistics_core_carrier_agents", column: "carrier_agent_id" add_foreign_key "logistics_core_demurrage_rates", "logistics_core_demurrage_rate_periods", column: "demurrage_rate_period_id" add_foreign_key "logistics_core_demurrage_rates", "logistics_core_lookups", column: "unit_of_charge_id" add_foreign_key "logistics_core_document_types", "logistics_core_extended_lookups", column: "document_type_category_id" add_foreign_key "logistics_core_document_types", "logistics_core_extended_lookups", column: "document_type_origin_id" add_foreign_key "logistics_core_esl_transport_tariff_rates", "logistics_core_esl_transport_tariffs", column: "esl_transport_tariff_id" add_foreign_key "logistics_core_esl_transport_tariffs", "logistics_core_routes", column: "route_id" add_foreign_key "logistics_core_freight_ton_demurrage_rates", "logistics_core_demurrage_rate_periods", column: "demurrage_rate_period_id" add_foreign_key "logistics_core_freight_ton_demurrage_rates", "logistics_core_lookups", column: "transaction_type_id" add_foreign_key "logistics_core_freight_ton_storage_rates", "logistics_core_lookups", column: "content_type_id" add_foreign_key "logistics_core_freight_ton_storage_rates", "logistics_core_lookups", column: "transaction_type_id", name: "fk_fstr_on_tt" add_foreign_key "logistics_core_freight_ton_storage_rates", "logistics_core_warehouse_rate_periods", column: "warehouse_rate_period_id" add_foreign_key "logistics_core_increment_rates", "logistics_core_service_increments", column: "service_increment_id" add_foreign_key "logistics_core_item_rates", "logistics_core_chargeable_service_unit_of_charges", column: "chargeable_service_unit_of_charge_id" add_foreign_key "logistics_core_item_rates", "logistics_core_lookups", column: "transaction_type_id" add_foreign_key "logistics_core_kilogram_rates", "logistics_core_chargeable_service_unit_of_charges", column: "chargeable_service_unit_of_charge_id" add_foreign_key "logistics_core_kilogram_rates", "logistics_core_lookups", column: "transaction_type_id" add_foreign_key "logistics_core_offer_requests", "logistics_core_agents", column: "agent_id" add_foreign_key "logistics_core_offer_requests", "logistics_core_carriers", column: "carrier_id" add_foreign_key "logistics_core_offer_requests", "logistics_core_clients", column: "client_id" add_foreign_key "logistics_core_offer_requests", "logistics_core_contracts", column: "contract_id" add_foreign_key "logistics_core_offer_requests", "logistics_core_lookups", column: "communication_channel_id" add_foreign_key "logistics_core_offer_requests", "logistics_core_operations", column: "operation_id" add_foreign_key "logistics_core_offer_requests", "logistics_core_warehouses", column: "warehouse_id" add_foreign_key "logistics_core_offer_requests", "mks_auth_users", column: "user_id" add_foreign_key "logistics_core_operation_documents", "logistics_core_operations", column: "operation_id" add_foreign_key "logistics_core_operation_summaries", "logistics_core_operations", column: "operation_id" add_foreign_key "logistics_core_operations", "logistics_core_customs_offices", column: "customs_office_id" add_foreign_key "logistics_core_operations", "logistics_core_customs_transport_tariffs", column: "customs_transport_tariff_id" add_foreign_key "logistics_core_operations", "logistics_core_declarants", column: "declarant_id" add_foreign_key "logistics_core_operations", "logistics_core_declaration_types", column: "declaration_type_id" add_foreign_key "logistics_core_operations", "logistics_core_esl_transport_tariffs", column: "esl_transport_tariff_id" add_foreign_key "logistics_core_operations", "logistics_core_extended_lookups", column: "acquisition_mode_id" add_foreign_key "logistics_core_operations", "logistics_core_extended_lookups", column: "container_arrangement_id" add_foreign_key "logistics_core_operations", "logistics_core_extended_lookups", column: "delivery_term_id" add_foreign_key "logistics_core_operations", "logistics_core_extended_lookups", column: "payment_term_id" add_foreign_key "logistics_core_operations", "logistics_core_extended_lookups", column: "transport_mode_id" add_foreign_key "logistics_core_operations", "logistics_core_lookups", column: "country_of_origin_id" add_foreign_key "logistics_core_operations", "logistics_core_lookups", column: "customs_office_unit_id" add_foreign_key "logistics_core_operations", "logistics_core_warehouses", column: "warehouse_id" add_foreign_key "logistics_core_operations", "mks_auth_users", column: "owner_id" add_foreign_key "logistics_core_out_of_gauge_bb_rates", "logistics_core_lookups", column: "break_bulk_unit_id" add_foreign_key "logistics_core_out_of_gauge_bb_rates", "logistics_core_routes", column: "route_id" add_foreign_key "logistics_core_out_of_gauge_cnt_rates", "logistics_core_lookups", column: "container_size_id" add_foreign_key "logistics_core_out_of_gauge_cnt_rates", "logistics_core_routes", column: "route_id" add_foreign_key "logistics_core_route_rates", "logistics_core_lookups", column: "container_size_id" add_foreign_key "logistics_core_route_rates", "logistics_core_routes", column: "route_id" add_foreign_key "logistics_core_route_rates", "logistics_core_transport_rate_periods", column: "rate_period_id" add_foreign_key "logistics_core_route_rates", "logistics_core_transporters", column: "selected_transporter_id" add_foreign_key "logistics_core_route_rates", "logistics_core_transporters", column: "transporter_id" add_foreign_key "logistics_core_route_rates", "logistics_core_weight_ranges", column: "weight_range_id" add_foreign_key "logistics_core_routes", "logistics_core_lookups", column: "from_id", name: "fk_route_from" add_foreign_key "logistics_core_routes", "logistics_core_lookups", column: "node_id", name: "fk_route_node" add_foreign_key "logistics_core_routes", "logistics_core_lookups", column: "to_id", name: "fk_route_to" add_foreign_key "logistics_core_self_driving_rates", "logistics_core_lookups", column: "break_bulk_unit_id" add_foreign_key "logistics_core_self_driving_rates", "logistics_core_routes", column: "route_id" add_foreign_key "logistics_core_self_driving_rates", "logistics_core_transport_rate_periods", column: "rate_period_id" add_foreign_key "logistics_core_self_driving_rates", "logistics_core_transporters", column: "selected_transporter_id" add_foreign_key "logistics_core_self_driving_rates", "logistics_core_transporters", column: "transporter_id", name: "fk_sdr_on_trans" add_foreign_key "logistics_core_service_delivery_unit_chargeable_services", "logistics_core_chargeable_services", column: "chargeable_service_id" add_foreign_key "logistics_core_service_delivery_unit_chargeable_services", "logistics_core_service_delivery_units", column: "service_delivery_unit_id" add_foreign_key "logistics_core_service_delivery_unit_services", "logistics_core_chargeable_services", column: "chargeable_service_id" add_foreign_key "logistics_core_service_delivery_unit_services", "logistics_core_service_delivery_units", column: "service_delivery_unit_id" add_foreign_key "logistics_core_service_delivery_units", "logistics_core_lookups", column: "currency_id" add_foreign_key "logistics_core_service_delivery_units", "logistics_core_lookups", column: "service_delivery_unit_type_id" add_foreign_key "logistics_core_service_increments", "logistics_core_chargeable_service_unit_of_charges", column: "chargeable_service_unit_of_charge_id" add_foreign_key "logistics_core_service_rates", "logistics_core_chargeable_service_unit_of_charges", column: "chargeable_service_unit_of_charge_id" add_foreign_key "logistics_core_service_rates", "logistics_core_lookups", column: "container_size_id" add_foreign_key "logistics_core_service_rates", "logistics_core_lookups", column: "transaction_type_id" add_foreign_key "logistics_core_special_increment_container_rates", "logistics_core_lookups", column: "container_type_id" add_foreign_key "logistics_core_special_increment_content_rates", "logistics_core_lookups", column: "content_type_id" add_foreign_key "logistics_core_transporters", "logistics_core_lookups", column: "country_id" add_foreign_key "logistics_core_truck_rates", "logistics_core_chargeable_service_unit_of_charges", column: "chargeable_service_unit_of_charge_id" add_foreign_key "logistics_core_truck_rates", "logistics_core_lookups", column: "transaction_type_id" add_foreign_key "logistics_core_truck_type_assignments", "logistics_core_lookups", column: "container_size_id" add_foreign_key "logistics_core_truck_type_bb_weight_ranges", "logistics_core_break_bulk_truck_assignments", column: "break_bulk_truck_assignment_id" add_foreign_key "logistics_core_truck_type_bb_weight_ranges", "logistics_core_weight_ranges", column: "weight_range_id" add_foreign_key "logistics_core_truck_type_cnt_weight_ranges", "logistics_core_truck_type_assignments", column: "truck_type_assignment_id" add_foreign_key "logistics_core_truck_type_cnt_weight_ranges", "logistics_core_weight_ranges", column: "weight_range_id" add_foreign_key "logistics_core_twenty_feet_equivalence_ratios", "logistics_core_lookups", column: "container_size_id" add_foreign_key "logistics_core_twenty_foot_equivalence_unit_rates", "logistics_core_chargeable_service_unit_of_charges", column: "chargeable_service_unit_of_charge_id" add_foreign_key "logistics_core_twenty_foot_equivalence_unit_rates", "logistics_core_lookups", column: "transaction_type_id" add_foreign_key "logistics_core_units", "logistics_core_lookups", column: "unit_type_id" add_foreign_key "mks_auth_menus", "mks_auth_application_modules", column: "application_module_id" add_foreign_key "mks_auth_menus", "mks_auth_menus", column: "parent_id" add_foreign_key "mks_auth_menus_user_roles", "mks_auth_menus", column: "menu_id" add_foreign_key "mks_auth_menus_user_roles", "mks_auth_user_roles", column: "user_role_id" add_foreign_key "mks_auth_users", "mks_auth_application_modules", column: "application_module_id" add_foreign_key "mks_auth_users_user_roles", "mks_auth_user_roles", column: "user_role_id" add_foreign_key "mks_auth_users_user_roles", "mks_auth_users", column: "user_id" end