mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 13:38:18 -08:00
chore: remove precalculated race scores. Calculate race scores on every reload
This commit is contained in:
parent
f035c4d9ad
commit
4afa030141
9 changed files with 80 additions and 232 deletions
18
db/migrate/20230807222503_drop_race_scores.rb
Normal file
18
db/migrate/20230807222503_drop_race_scores.rb
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
class DropRaceScores < ActiveRecord::Migration[7.0]
|
||||
def up
|
||||
drop_table :race_scores
|
||||
end
|
||||
|
||||
def down
|
||||
create_table :race_scores do |t|
|
||||
t.references :measure, null: false, foreign_key: true
|
||||
t.references :school, null: false, foreign_key: true
|
||||
t.references :academic_year, null: false, foreign_key: true
|
||||
t.references :race, null: false, foreign_key: true
|
||||
t.float :average
|
||||
t.boolean :meets_student_threshold
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
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: 2023_06_30_215110) do
|
||||
ActiveRecord::Schema[7.0].define(version: 2023_08_07_222503) do
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
||||
|
|
@ -304,21 +304,6 @@ ActiveRecord::Schema[7.0].define(version: 2023_06_30_215110) 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"
|
||||
|
|
@ -491,10 +476,6 @@ ActiveRecord::Schema[7.0].define(version: 2023_06_30_215110) 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