mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-13 09:20:38 -07:00
working on aggregated results
This commit is contained in:
parent
f5b473ed28
commit
48eb55ad94
11 changed files with 120 additions and 8 deletions
13
db/migrate/20170312202259_create_school_categories.rb
Normal file
13
db/migrate/20170312202259_create_school_categories.rb
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
class CreateSchoolCategories < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :school_categories do |t|
|
||||
t.references :school, foreign_key: true
|
||||
t.references :category, foreign_key: true
|
||||
t.integer :attempt_count
|
||||
t.integer :response_count
|
||||
t.integer :answer_index_total
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
16
db/schema.rb
16
db/schema.rb
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20170311195824) do
|
||||
ActiveRecord::Schema.define(version: 20170312202259) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
|
@ -122,6 +122,18 @@ ActiveRecord::Schema.define(version: 20170311195824) do
|
|||
t.index ["school_id"], name: "index_schedules_on_school_id", using: :btree
|
||||
end
|
||||
|
||||
create_table "school_categories", force: :cascade do |t|
|
||||
t.integer "school_id"
|
||||
t.integer "category_id"
|
||||
t.integer "attempt_count"
|
||||
t.integer "response_count"
|
||||
t.integer "answer_index_total"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["category_id"], name: "index_school_categories_on_category_id", using: :btree
|
||||
t.index ["school_id"], name: "index_school_categories_on_school_id", using: :btree
|
||||
end
|
||||
|
||||
create_table "schools", force: :cascade do |t|
|
||||
t.string "name"
|
||||
t.integer "district_id"
|
||||
|
|
@ -149,4 +161,6 @@ ActiveRecord::Schema.define(version: 20170311195824) do
|
|||
|
||||
add_foreign_key "recipient_lists", "schools"
|
||||
add_foreign_key "schedules", "schools"
|
||||
add_foreign_key "school_categories", "categories"
|
||||
add_foreign_key "school_categories", "schools"
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue