mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
Add indexes on measures, survey items, and responses
This commit is contained in:
parent
fd55c7c82a
commit
b28f37d8b7
4 changed files with 29 additions and 1 deletions
|
|
@ -0,0 +1,8 @@
|
||||||
|
class AddIndexesToSurveyItemResponses < ActiveRecord::Migration[5.0]
|
||||||
|
def change
|
||||||
|
add_index :survey_item_responses, :school_id
|
||||||
|
add_index :survey_item_responses, :survey_item_id
|
||||||
|
add_index :survey_item_responses, :response_id
|
||||||
|
add_index :survey_item_responses, :academic_year_id
|
||||||
|
end
|
||||||
|
end
|
||||||
6
db/migrate/20210923113323_add_indexes_to_survey_items.rb
Normal file
6
db/migrate/20210923113323_add_indexes_to_survey_items.rb
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
class AddIndexesToSurveyItems < ActiveRecord::Migration[5.0]
|
||||||
|
def change
|
||||||
|
add_index :survey_items, :survey_item_id
|
||||||
|
add_index :survey_items, :measure_id
|
||||||
|
end
|
||||||
|
end
|
||||||
6
db/migrate/20210923113404_add_indexes_to_measures.rb
Normal file
6
db/migrate/20210923113404_add_indexes_to_measures.rb
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
class AddIndexesToMeasures < ActiveRecord::Migration[5.0]
|
||||||
|
def change
|
||||||
|
add_index :measures, :measure_id
|
||||||
|
add_index :measures, :subcategory_id
|
||||||
|
end
|
||||||
|
end
|
||||||
10
db/schema.rb
10
db/schema.rb
|
|
@ -10,7 +10,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 20210921155142) do
|
ActiveRecord::Schema.define(version: 20210923113404) do
|
||||||
|
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
|
|
@ -71,6 +71,8 @@ ActiveRecord::Schema.define(version: 20210921155142) do
|
||||||
t.float "approval_low_benchmark", null: false
|
t.float "approval_low_benchmark", null: false
|
||||||
t.float "ideal_low_benchmark", null: false
|
t.float "ideal_low_benchmark", null: false
|
||||||
t.integer "subcategory_id", null: false
|
t.integer "subcategory_id", null: false
|
||||||
|
t.index ["measure_id"], name: "index_measures_on_measure_id", using: :btree
|
||||||
|
t.index ["subcategory_id"], name: "index_measures_on_subcategory_id", using: :btree
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "question_lists", force: :cascade do |t|
|
create_table "question_lists", force: :cascade do |t|
|
||||||
|
|
@ -228,12 +230,18 @@ ActiveRecord::Schema.define(version: 20210921155142) do
|
||||||
t.integer "survey_item_id", null: false
|
t.integer "survey_item_id", null: false
|
||||||
t.string "response_id", null: false
|
t.string "response_id", null: false
|
||||||
t.integer "academic_year_id", null: false
|
t.integer "academic_year_id", null: false
|
||||||
|
t.index ["academic_year_id"], name: "index_survey_item_responses_on_academic_year_id", using: :btree
|
||||||
|
t.index ["response_id"], name: "index_survey_item_responses_on_response_id", using: :btree
|
||||||
|
t.index ["school_id"], name: "index_survey_item_responses_on_school_id", using: :btree
|
||||||
|
t.index ["survey_item_id"], name: "index_survey_item_responses_on_survey_item_id", using: :btree
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "survey_items", force: :cascade do |t|
|
create_table "survey_items", force: :cascade do |t|
|
||||||
t.integer "measure_id", null: false
|
t.integer "measure_id", null: false
|
||||||
t.string "survey_item_id", null: false
|
t.string "survey_item_id", null: false
|
||||||
t.string "prompt"
|
t.string "prompt"
|
||||||
|
t.index ["measure_id"], name: "index_survey_items_on_measure_id", using: :btree
|
||||||
|
t.index ["survey_item_id"], name: "index_survey_items_on_survey_item_id", using: :btree
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "user_schools", force: :cascade do |t|
|
create_table "user_schools", force: :cascade do |t|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue