-ActiveRecord::Schema.define(version: 2021_05_11_041616) do
+ActiveRecord::Schema.define(version: 2021_05_25_020926) do
@@ -527,2 +527,30 @@ create_table "contacts_jobseeker_portal_privacy_document_consents", id: false, f
+ create_table "cortex_rails_api_configs", id: :serial, force: :cascade do |t|
+ t.string "url", default: "https://cortex.esherhouse.org", null: false
+ t.string "token", default: "", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+ create_table "cortex_rails_organisations", id: :serial, force: :cascade do |t|
+ t.integer "api_config_id"
+ t.integer "credit_count", null: false
+ t.text "survey_types", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.index ["api_config_id"], name: "index_cortex_rails_organisations_on_api_config_id"
+ end
+ create_table "cortex_rails_surveys", id: :serial, force: :cascade do |t|
+ t.string "name", null: false
+ t.string "case_file_type", null: false
+ t.integer "case_file_id", null: false
+ t.text "payload", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.string "token"
+ t.index ["case_file_type", "case_file_id", "name"], name: "index_cortex_rails_surveys_uniqueness", unique: true
+ t.index ["token"], name: "index_cortex_rails_surveys_on_token", unique: true
+ end
create_table "custom_expense_types", id: :serial, force: :cascade do |t|
@@ -1484,2 +1512,32 @@ create_table "professional_service_staff", id: :serial, force: :cascade do |t|
+ create_table "program_referral_justification_templates", force: :cascade do |t|
+ t.string "name", null: false
+ t.text "content", null: false
+ t.boolean "active", default: true, null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+ create_table "program_referral_types", force: :cascade do |t|
+ t.bigint "custom_expense_type_id"
+ t.string "name", null: false
+ t.string "category", null: false
+ t.string "programme", null: false
+ t.string "stream_type"
+ t.boolean "active", default: true, null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.index ["custom_expense_type_id"], name: "index_program_referral_types_on_custom_expense_type_id"
+ end
+ create_table "program_referrals", force: :cascade do |t|
+ t.bigint "program_id", null: false
+ t.bigint "jobseeker_id", null: false
+ t.string "status", default: "draft", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.index ["jobseeker_id"], name: "index_program_referrals_on_jobseeker_id"
+ t.index ["program_id"], name: "index_program_referrals_on_program_id"
+ end
create_table "programmes", id: :serial, force: :cascade do |t|
@@ -1498,2 +1556,24 @@ create_table "programmes_users", id: false, force: :cascade do |t|
+ create_table "programs", force: :cascade do |t|
+ t.string "activity_id"
+ t.bigint "program_referral_type_id", null: false
+ t.string "program_name", null: false
+ t.bigint "site_id", null: false
+ t.datetime "started_at"
+ t.datetime "ended_at"
+ t.text "details", null: false
+ t.uuid "smart_form_id"
+ t.json "costs", default: {}, null: false
+ t.integer "number_of_sessions_cap"
+ t.integer "number_of_minutes_cap"
+ t.bigint "company_id"
+ t.boolean "active", default: true, null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.index ["company_id"], name: "index_programs_on_company_id"
+ t.index ["program_referral_type_id"], name: "index_programs_on_program_referral_type_id"
+ t.index ["site_id"], name: "index_programs_on_site_id"
+ t.index ["smart_form_id"], name: "index_programs_on_smart_form_id"
+ end
create_table "provider_ratings", id: :serial, force: :cascade do |t|
@@ -1918,2 +1998,16 @@ create_table "short_urls", id: false, force: :cascade do |t|
+ create_table "site_floats", force: :cascade do |t|
+ t.bigint "site_id"
+ t.bigint "supplier_id"
+ t.bigint "voucher_type_id"
+ t.decimal "voucher_amount"
+ t.integer "float_number"
+ t.boolean "active", default: true, null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.index ["site_id"], name: "index_site_floats_on_site_id"
+ t.index ["supplier_id"], name: "index_site_floats_on_supplier_id"
+ t.index ["voucher_type_id"], name: "index_site_floats_on_voucher_type_id"
+ end
create_table "site_groupings", id: :serial, force: :cascade do |t|
@@ -2467,2 +2561,24 @@ create_table "wage_subsidy_agreements", force: :cascade do |t|
+ create_table "wage_subsidy_payment_schedule_templates", force: :cascade do |t|
+ t.bigint "wage_subsidy_agreement_id"
+ t.string "name", null: false
+ t.string "frequency", null: false
+ t.integer "number_of_payments", null: false
+ t.boolean "active", default: true, null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.index ["name"], name: "index_wage_subsidy_payment_schedule_templates_on_name", unique: true
+ t.index ["wage_subsidy_agreement_id"], name: "index_ws_payment_schedule_templates_on_ws_agreement_id"
+ end
+ create_table "wage_subsidy_payment_schedules", force: :cascade do |t|
+ t.bigint "wage_subsidy_payment_schedule_template_id", null: false
+ t.bigint "wage_subsidy_request_id", null: false
+ t.date "agreement_start_date", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.index ["wage_subsidy_payment_schedule_template_id"], name: "index_ws_payment_schedules_on_ws_payment_schedule_template_id
"
+ t.index ["wage_subsidy_request_id"], name: "index_ws_payment_schedules_on_ws_request_id"
+ end
create_table "wage_subsidy_requests", force: :cascade do |t|
@@ -2522,2 +2638,3 @@ create_table "widget_configurations", id: :serial, force: :cascade do |t|
add_foreign_key "contacts", "users", column: "created_by_id"
+ add_foreign_key "cortex_rails_organisations", "cortex_rails_api_configs", column: "api_config_id"
add_foreign_key "emails", "reminders"
@@ -2555,2 +2672,9 @@ create_table "widget_configurations", id: :serial, force: :cascade do |t|
add_foreign_key "professional_service_staff", "users"
+ add_foreign_key "program_referral_types", "custom_expense_types"
+ add_foreign_key "program_referrals", "jobseekers"
+ add_foreign_key "program_referrals", "programs"
+ add_foreign_key "programs", "companies"
+ add_foreign_key "programs", "program_referral_types"
+ add_foreign_key "programs", "sites"
+ add_foreign_key "programs", "smart_forms"
add_foreign_key "quest_submission_view_tokens", "quest_submissions"
@@ -2563,2 +2687,5 @@ create_table "widget_configurations", id: :serial, force: :cascade do |t|
add_foreign_key "short_messages", "reminders"
+ add_foreign_key "site_floats", "companies", column: "supplier_id"
+ add_foreign_key "site_floats", "sites"
+ add_foreign_key "site_floats", "voucher_types"
add_foreign_key "sites", "locations"
@@ -2582,2 +2709,5 @@ create_table "widget_configurations", id: :serial, force: :cascade do |t|
add_foreign_key "wage_subsidy_agreements", "expense_payment_types"
+ add_foreign_key "wage_subsidy_payment_schedule_templates", "wage_subsidy_agreements"
+ add_foreign_key "wage_subsidy_payment_schedules", "wage_subsidy_payment_schedule_templates"
+ add_foreign_key "wage_subsidy_payment_schedules", "wage_subsidy_requests"
add_foreign_key "wage_subsidy_requests", "custom_expense_types"