mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
Change race score calculations so the average bubbles up through survey_items
-> scales -> measure. Precalculate averages for performance.
This commit is contained in:
parent
3f2279e2e8
commit
105f30f220
26 changed files with 379 additions and 84 deletions
21
db/schema.rb
21
db/schema.rb
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[7.0].define(version: 2022_07_28_232445) do
|
||||
ActiveRecord::Schema[7.0].define(version: 2022_08_09_213959) do
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "pg_stat_statements"
|
||||
enable_extension "plpgsql"
|
||||
|
|
@ -290,6 +290,21 @@ ActiveRecord::Schema[7.0].define(version: 2022_07_28_232445) do
|
|||
t.index ["subcategory_id"], name: "index_measures_on_subcategory_id"
|
||||
end
|
||||
|
||||
create_table "race_scores", force: :cascade do |t|
|
||||
t.bigint "measure_id", null: false
|
||||
t.bigint "school_id", null: false
|
||||
t.bigint "academic_year_id", null: false
|
||||
t.bigint "race_id", null: false
|
||||
t.float "average"
|
||||
t.boolean "meets_student_threshold"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["academic_year_id"], name: "index_race_scores_on_academic_year_id"
|
||||
t.index ["measure_id"], name: "index_race_scores_on_measure_id"
|
||||
t.index ["race_id"], name: "index_race_scores_on_race_id"
|
||||
t.index ["school_id"], name: "index_race_scores_on_school_id"
|
||||
end
|
||||
|
||||
create_table "races", force: :cascade do |t|
|
||||
t.string "designation"
|
||||
t.integer "qualtrics_code"
|
||||
|
|
@ -428,6 +443,10 @@ ActiveRecord::Schema[7.0].define(version: 2022_07_28_232445) do
|
|||
add_foreign_key "legacy_school_categories", "legacy_categories", column: "category_id"
|
||||
add_foreign_key "legacy_school_categories", "legacy_schools", column: "school_id"
|
||||
add_foreign_key "measures", "subcategories"
|
||||
add_foreign_key "race_scores", "academic_years"
|
||||
add_foreign_key "race_scores", "measures"
|
||||
add_foreign_key "race_scores", "races"
|
||||
add_foreign_key "race_scores", "schools"
|
||||
add_foreign_key "respondents", "academic_years"
|
||||
add_foreign_key "respondents", "schools"
|
||||
add_foreign_key "response_rates", "academic_years"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue