mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 13:38:18 -08:00
feat: create a parents by language graph
Update demographics table with lanugage options Create a lanugage table to hold the new languages Update the demographic loader to input languages into the database Update the cleaner to read the language column Update the parent table to hold a reference to a language Update the data uploader script to read the language from the csv and update the language information for any parent items that already exist (or create database entries if none already exist) update the analyze interface to add controls for selecting ‘parents by group’ and a dropdown for ‘parent by language’ Update the analyze controller to read the parent-by-group parameter Create a graph for the parent-by-group view Bubble up averages for language calculations. Make sure n-size only counts responses for a given measure.
This commit is contained in:
parent
bedab713af
commit
0f457becf0
31 changed files with 413 additions and 109 deletions
5
db/migrate/20250408212201_add_housing_to_parent.rb
Normal file
5
db/migrate/20250408212201_add_housing_to_parent.rb
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
class AddHousingToParent < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
add_reference :parents, :housing, foreign_key: true
|
||||
end
|
||||
end
|
||||
10
db/migrate/20250411213850_create_languages.rb
Normal file
10
db/migrate/20250411213850_create_languages.rb
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
class CreateLanguages < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
create_table :languages do |t|
|
||||
t.string :designation
|
||||
t.string :slug
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
12
db/migrate/20250418184427_create_parent_languages.rb
Normal file
12
db/migrate/20250418184427_create_parent_languages.rb
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
class CreateParentLanguages < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
create_table :parent_languages do |t|
|
||||
t.references :parent, null: false, foreign_key: true
|
||||
t.references :language, null: false, foreign_key: true
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :parent_languages, %i[parent_id language_id]
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
class AddDesignationIndexToLanguage < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
add_index :languages, %i[designation]
|
||||
end
|
||||
end
|
||||
25
db/schema.rb
25
db/schema.rb
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[8.0].define(version: 2025_03_27_205800) do
|
||||
ActiveRecord::Schema[8.0].define(version: 2025_04_18_185655) do
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "pg_catalog.plpgsql"
|
||||
|
||||
|
|
@ -102,6 +102,14 @@ ActiveRecord::Schema[8.0].define(version: 2025_03_27_205800) do
|
|||
t.index ["slug"], name: "index_incomes_on_slug", unique: true
|
||||
end
|
||||
|
||||
create_table "languages", force: :cascade do |t|
|
||||
t.string "designation"
|
||||
t.string "slug"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["designation"], name: "index_languages_on_designation"
|
||||
end
|
||||
|
||||
create_table "legacy_attempts", id: :serial, force: :cascade do |t|
|
||||
t.integer "recipient_id"
|
||||
t.integer "schedule_id"
|
||||
|
|
@ -322,11 +330,23 @@ ActiveRecord::Schema[8.0].define(version: 2025_03_27_205800) do
|
|||
t.index ["subcategory_id"], name: "index_measures_on_subcategory_id"
|
||||
end
|
||||
|
||||
create_table "parent_languages", force: :cascade do |t|
|
||||
t.bigint "parent_id", null: false
|
||||
t.bigint "language_id", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["language_id"], name: "index_parent_languages_on_language_id"
|
||||
t.index ["parent_id", "language_id"], name: "index_parent_languages_on_parent_id_and_language_id"
|
||||
t.index ["parent_id"], name: "index_parent_languages_on_parent_id"
|
||||
end
|
||||
|
||||
create_table "parents", force: :cascade do |t|
|
||||
t.string "response_id"
|
||||
t.integer "number_of_children"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.bigint "housing_id"
|
||||
t.index ["housing_id"], name: "index_parents_on_housing_id"
|
||||
end
|
||||
|
||||
create_table "races", force: :cascade do |t|
|
||||
|
|
@ -514,6 +534,9 @@ ActiveRecord::Schema[8.0].define(version: 2025_03_27_205800) 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 "parent_languages", "languages"
|
||||
add_foreign_key "parent_languages", "parents"
|
||||
add_foreign_key "parents", "housings"
|
||||
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