-ActiveRecord::Schema.define(version: 2021_06_29_010657) do
+ActiveRecord::Schema.define(version: 2021_07_02_023009) do
@@ -472,2 +472,3 @@ create_table "companies", id: :serial, force: :cascade do |t|
t.text "previous_system_identifiers", default: [], array: true
+ t.bigint "company_lead_id"
t.index ["account_manager_id"], name: "index_companies_on_account_manager_id"
@@ -475,2 +476,3 @@ create_table "companies", id: :serial, force: :cascade do |t|
t.index ["address_postcode"], name: "index_companies_on_address_postcode"
+ t.index ["company_lead_id"], name: "index_companies_on_company_lead_id"
t.index ["entity_type"], name: "index_companies_on_entity_type"
@@ -507,4 +509,12 @@ create_table "company_leads", force: :cascade do |t|
t.string "reason_for_closing"
+ t.bigint "referral_source_id"
+ t.string "sub_source_type"
+ t.bigint "sub_source_id"
+ t.datetime "on_hold_at"
+ t.datetime "closed_at"
+ t.datetime "converted_at"
t.index ["lead_manager_id"], name: "index_company_leads_on_lead_manager_id"
+ t.index ["referral_source_id"], name: "index_company_leads_on_referral_source_id"
t.index ["site_id"], name: "index_company_leads_on_site_id"
+ t.index ["sub_source_type", "sub_source_id"], name: "index_company_leads_on_sub_source_type_and_sub_source_id"
end
@@ -929,2 +939,3 @@ create_table "expenses", id: :serial, force: :cascade do |t|
t.date "invoice_actual_date_of_service"
+ t.bigint "professional_service_activity_id"
t.index ["approver_id"], name: "index_expenses_on_approver_id"
@@ -934,2 +945,3 @@ create_table "expenses", id: :serial, force: :cascade do |t|
t.index ["jobseeker_id"], name: "index_expenses_on_jobseeker_id"
+ t.index ["professional_service_activity_id"], name: "index_expenses_on_professional_service_activity_id"
t.index ["second_approver_id"], name: "index_expenses_on_second_approver_id"
@@ -2725,3 +2737,5 @@ create_table "widget_configurations", id: :serial, force: :cascade do |t|
add_foreign_key "commitment_assessments_surveys", "users", column: "created_by_id"
+ add_foreign_key "companies", "company_leads"
add_foreign_key "companies", "users", column: "recruitment_coordinator_id"
+ add_foreign_key "company_leads", "referral_sources"
add_foreign_key "company_leads", "sites"
@@ -2737,2 +2751,3 @@ create_table "widget_configurations", id: :serial, force: :cascade do |t|
add_foreign_key "expenses", "expense_payment_types"
+ add_foreign_key "expenses", "professional_service_activities"
add_foreign_key "expenses", "sites"