Able to create schools now

This commit is contained in:
Nelson Jovel 2024-01-04 20:15:33 -08:00
parent a4fddbeced
commit 865b7b17af
11 changed files with 26 additions and 19 deletions

View file

@ -1,6 +1,6 @@
module Dashboard
class School < ApplicationRecord
belongs_to :district, class_name: "Dashboard::District"
belongs_to :dashboard_district, class_name: "Dashboard::District"
has_many :dashboard_survey_item_responses, dependent: :delete_all

View file

@ -1,9 +1,9 @@
module Dashboard
class SurveyItem < ApplicationRecord
belongs_to :dashboard_scale
# belongs_to :dashboard_scale
has_one :dashboard_measure, through: dashboard_scale
has_one :dashboard_subcategory, through: dashboard_measure
# has_one :dashboard_measure, through: dashboard_scale
# has_one :dashboard_subcategory, through: dashboard_measure
has_many :dashboard_survey_item_responses

View file

@ -3,7 +3,7 @@ class CreateDashboardCategories < ActiveRecord::Migration[7.1]
create_table :dashboard_categories do |t|
t.string :name
t.text :description
t.string :slug, unique: true
t.string :slug
t.string :category_id
t.string :short_description

View file

@ -4,7 +4,7 @@ class CreateDashboardSubcategories < ActiveRecord::Migration[7.1]
t.string :name
t.text :description
t.string :subcategory_id
t.references :dashboard_category_id, null: false, foreign_key: true
t.references :dashboard_categories, null: false, foreign_key: true
t.timestamps
end

View file

@ -2,7 +2,7 @@ class CreateDashboardDistricts < ActiveRecord::Migration[7.1]
def change
create_table :dashboard_districts do |t|
t.string :name
t.string :slug, unique: true
t.string :slug
t.integer :qualtrics_code
t.timestamps

View file

@ -2,9 +2,9 @@ class CreateDashboardSchools < ActiveRecord::Migration[7.1]
def change
create_table :dashboard_schools do |t|
t.string :name
t.references :dashboard_district_id, null: false, foreign_key: true
t.references :dashboard_district, null: false, foreign_key: true
t.text :description
t.string :slug, unique: true
t.string :slug
t.integer :qualtrics_code
t.integer :dese_id
t.boolean :is_hs

View file

@ -2,7 +2,7 @@ class CreateDashboardElls < ActiveRecord::Migration[7.1]
def change
create_table :dashboard_ells do |t|
t.string :designation
t.string :slug, unique: true
t.string :slug
t.timestamps
end

View file

@ -2,7 +2,7 @@ class CreateDashboardIncomes < ActiveRecord::Migration[7.1]
def change
create_table :dashboard_incomes do |t|
t.string :designation
t.string :slug, unique: true
t.string :slug
t.timestamps
end

View file

@ -3,7 +3,7 @@ class CreateDashboardRaces < ActiveRecord::Migration[7.1]
create_table :dashboard_races do |t|
t.string :designation
t.integer :qualtrics_code
t.string :slug, unique: true
t.string :slug
t.timestamps
end

View file

@ -2,7 +2,7 @@ class CreateDashboardSpeds < ActiveRecord::Migration[7.1]
def change
create_table :dashboard_speds do |t|
t.string :designation
t.string :slug, unique: true
t.string :slug
t.timestamps
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.1].define(version: 2024_01_04_192128) do
ActiveRecord::Schema[7.1].define(version: 2024_01_05_040909) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -47,6 +47,13 @@ ActiveRecord::Schema[7.1].define(version: 2024_01_04_192128) do
t.index ["dashboard_school_id"], name: "index_dashboard_admin_data_values_on_dashboard_school_id"
end
create_table "dashboard_atoms", force: :cascade do |t|
t.integer "survey_item"
t.text "text"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "dashboard_categories", force: :cascade do |t|
t.string "name"
t.text "description"
@ -217,11 +224,11 @@ ActiveRecord::Schema[7.1].define(version: 2024_01_04_192128) do
t.bigint "dashboard_school_id", null: false
t.bigint "dashboard_survey_item_id", null: false
t.bigint "dashboard_academic_year_id", null: false
t.bigint "dashboard_student_id", null: false
t.bigint "dashboard_gender_id", null: false
t.bigint "dashboard_income_id", null: false
t.bigint "dashboard_ell_id", null: false
t.bigint "dashboard_sped_id", null: false
t.bigint "dashboard_student_id"
t.bigint "dashboard_gender_id"
t.bigint "dashboard_income_id"
t.bigint "dashboard_ell_id"
t.bigint "dashboard_sped_id"
t.string "response_id"
t.integer "grade"
t.datetime "recorded_date"