Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIGRATION: create Access Report OtherCurriculumOffering table #23668

Merged
merged 4 commits into from
Jul 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 20 additions & 0 deletions dashboard/app/models/census/other_curriculum_offering.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# == Schema Information
#
# Table name: other_curriculum_offerings
#
# id :integer not null, primary key
# curriculum_provider_name :string(255) not null
# school_id :string(12) not null
# course :string(255) not null
# school_year :integer not null
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# fk_rails_5682e60354 (school_id)
# index_other_curriculum_offerings_unique (curriculum_provider_name,school_id,course,school_year) UNIQUE
#

class Census::OtherCurriculumOffering < ApplicationRecord
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
class CreateCensusOtherCurriculumOfferings < ActiveRecord::Migration[5.0]
def change
create_table :other_curriculum_offerings do |t|
t.string :curriculum_provider_name, null: false
t.string :school_id, limit: 12, null: false
t.string :course, null: false
# limit on integers is number of bytes, not digits or display length
t.integer :school_year, limit: 2, null: false

t.timestamps
end

add_foreign_key :other_curriculum_offerings, :schools
add_index :other_curriculum_offerings,
[:curriculum_provider_name, :school_id, :course, :school_year],
unique: true,
name: 'index_other_curriculum_offerings_unique'
end
end
14 changes: 13 additions & 1 deletion dashboard/db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20180704013020) do
ActiveRecord::Schema.define(version: 20180712175948) do

create_table "activities", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci" do |t|
t.integer "user_id"
Expand Down Expand Up @@ -533,6 +533,17 @@
t.float "value", limit: 24, null: false
end

create_table "other_curriculum_offerings", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci" do |t|
t.string "curriculum_provider_name", null: false
t.string "school_id", limit: 12, null: false
t.string "course", null: false
t.integer "school_year", limit: 2, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["curriculum_provider_name", "school_id", "course", "school_year"], name: "index_other_curriculum_offerings_unique", unique: true, using: :btree
t.index ["school_id"], name: "fk_rails_5682e60354", using: :btree
end

create_table "paired_user_levels", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci" do |t|
t.integer "driver_user_level_id"
t.integer "navigator_user_level_id"
Expand Down Expand Up @@ -1583,6 +1594,7 @@
add_foreign_key "hint_view_requests", "users"
add_foreign_key "ib_school_codes", "schools"
add_foreign_key "level_concept_difficulties", "levels"
add_foreign_key "other_curriculum_offerings", "schools"
add_foreign_key "pd_payment_terms", "regional_partners"
add_foreign_key "pd_regional_partner_cohorts", "pd_workshops", column: "summer_workshop_id"
add_foreign_key "pd_teachercon1819_registrations", "regional_partners"
Expand Down