-ActiveRecord::Schema.define(version: 2023_02_07_112426) do +ActiveRecord::Schema.define(version: 2023_02_15_025320) do # These are extensions that must be enabled in order to support this database enable_extension "citext" @@ -615,14 +615,18 @@ t.bigint "referral_source_id" t.string "sub_source_type" t.bigint "sub_source_id" + t.integer "primary_organisation_id" + t.bigint "employer_status_id" t.index ["account_manager_id"], name: "index_companies_on_account_manager_id" t.index ["activity_status"], name: "index_companies_on_activity_status" t.index ["address_postcode"], name: "index_companies_on_address_postcode" t.index ["company_lead_id"], name: "index_companies_on_company_lead_id" t.index ["created_by_id"], name: "index_companies_on_created_by_id" + t.index ["employer_status_id"], name: "index_companies_on_employer_status_id" t.index ["entity_type"], name: "index_companies_on_entity_type" t.index ["ess_identifier"], name: "index_companies_on_ess_identifier" t.index ["parent_id"], name: "index_companies_on_parent_id" + t.index ["primary_organisation_id"], name: "index_companies_on_primary_organisation_id" t.index ["recruitment_coordinator_id"], name: "index_companies_on_recruitment_coordinator_id" t.index ["referral_source_id"], name: "index_companies_on_referral_source_id" t.index ["region_id"], name: "index_companies_on_region_id" @@ -928,6 +932,12 @@ t.index ["company_id"], name: "index_employer_campaigns_on_company_id" end + create_table "employer_statuses", force: :cascade do |t| + t.string "name" + t.datetime "deleted_at" + t.index ["deleted_at"], name: "index_employer_statuses_on_deleted_at" + end + create_table "employment_hours", force: :cascade do |t| t.bigint "site_id", null: false t.bigint "placement_id" @@ -1400,6 +1410,7 @@ t.datetime "updated_at", null: false t.integer "available", default: 1 t.bigint "repeat_id" + t.index ["created_by_id"], name: "index_health_sessions_on_created_by_id" t.index ["repeat_id"], name: "index_health_sessions_on_repeat_id" t.index ["site_id"], name: "index_health_sessions_on_site_id" end @@ -1790,6 +1801,16 @@ t.index ["sub_source_type", "sub_source_id"], name: "index_jobseekers_on_sub_source_type_and_sub_source_id" end + create_table "kpis", force: :cascade do |t| + t.text "title", null: false + t.string "target", null: false + t.boolean "active", default: true, null: false + t.datetime "deleted_at" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["deleted_at"], name: "index_kpis_on_deleted_at" + end + create_table "lead_sub_sources", force: :cascade do |t| t.string "name", null: false t.bigint "referral_source_id" @@ -3494,7 +3515,7 @@ t.datetime "missing_at" t.datetime "created_at", null: false t.datetime "updated_at", null: false - t.index ["barcode"], name: "index_vouchers_on_barcode", unique: true + t.index ["barcode", "url"], name: "index_vouchers_on_barcode_and_url", unique: true t.index ["site_float_id"], name: "index_vouchers_on_site_float_id" end @@ -3546,6 +3567,13 @@ t.index ["smart_form_id"], name: "index_wage_subsidy_agreements_on_smart_form_id" end + create_table "wage_subsidy_end_reasons", force: :cascade do |t| + t.string "name" + t.datetime "deleted_at" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + end + create_table "wage_subsidy_payment_portal_invitations", force: :cascade do |t| t.uuid "uuid", default: -> { "uuid_generate_v4()" }, null: false t.bigint "contact_id", null: false @@ -3617,12 +3645,13 @@ t.datetime "second_approved_at" t.datetime "ended_at" t.bigint "ended_by_id" - t.text "end_reason" + t.text "legacy_end_reason" t.datetime "cancelled_at" t.bigint "cancelled_by_id" t.text "cancel_reason" t.string "previous_system_identifier" t.bigint "suggested_contact_id" + t.bigint "wage_subsidy_end_reason_id" t.index "((id)::text) text_pattern_ops", name: "index_wage_subsidy_requests_on_cast_id_as_text" t.index ["cancelled_by_id"], name: "index_wage_subsidy_requests_on_cancelled_by_id" t.index ["custom_expense_type_id"], name: "index_wage_subsidy_requests_on_custom_expense_type_id" @@ -3635,6 +3664,7 @@ t.index ["second_approved_by_id"], name: "index_wage_subsidy_requests_on_second_approved_by_id" t.index ["suggested_contact_id"], name: "index_wage_subsidy_requests_on_suggested_contact_id" t.index ["wage_subsidy_agreement_id"], name: "index_wage_subsidy_requests_on_wage_subsidy_agreement_id" + t.index ["wage_subsidy_end_reason_id"], name: "index_wage_subsidy_requests_on_wage_subsidy_end_reason_id" end create_table "webhooks", force: :cascade do |t| @@ -3722,6 +3752,7 @@ add_foreign_key "commitment_assessments_surveys", "jobseekers" add_foreign_key "commitment_assessments_surveys", "users", column: "created_by_id" add_foreign_key "companies", "company_leads" + add_foreign_key "companies", "employer_statuses" add_foreign_key "companies", "users", column: "created_by_id" add_foreign_key "companies", "users", column: "recruitment_coordinator_id" add_foreign_key "company_leads", "referral_sources" @@ -3873,6 +3904,7 @@ add_foreign_key "wage_subsidy_requests", "users", column: "requested_by_id" add_foreign_key "wage_subsidy_requests", "users", column: "second_approved_by_id" add_foreign_key "wage_subsidy_requests", "wage_subsidy_agreements" + add_foreign_key "wage_subsidy_requests", "wage_subsidy_end_reasons" add_foreign_key "widget_configurations", "users" add_foreign_key "work_for_doles", "jobseekers" add_foreign_key "work_for_doles", "sites" end