mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-08 23:18:18 -07:00
Extract legacy parts of the codebase into its own module
This commit is contained in:
parent
cf6e80ce6b
commit
413096dfe2
269 changed files with 5549 additions and 5279 deletions
|
|
@ -0,0 +1,5 @@
|
|||
class ChangeQuestionListToLegacyQuestionList < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
rename_table :question_lists, :legacy_question_lists
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
class ChangeLegacyTablesSoTheyIncludeLegacyPrefix < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
rename_table :attempts, :legacy_attempts
|
||||
rename_table :categories, :legacy_categories
|
||||
rename_table :districts, :legacy_districts
|
||||
rename_table :questions, :legacy_questions
|
||||
rename_table :recipients, :legacy_recipients
|
||||
rename_table :recipient_lists, :legacy_recipient_lists
|
||||
rename_table :recipient_schedules, :legacy_recipient_schedules
|
||||
rename_table :schedules, :legacy_schedules
|
||||
rename_table :schools, :legacy_schools
|
||||
rename_table :school_categories, :legacy_school_categories
|
||||
rename_table :school_questions, :legacy_school_questions
|
||||
rename_table :students, :legacy_students
|
||||
rename_table :users, :legacy_users
|
||||
rename_table :user_schools, :legacy_user_schools
|
||||
end
|
||||
end
|
||||
13
db/migrate/20211112205415_create_school_for_new_dashboard.rb
Normal file
13
db/migrate/20211112205415_create_school_for_new_dashboard.rb
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
class CreateSchoolForNewDashboard < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
create_table :schools do |t|
|
||||
t.string :name
|
||||
t.integer :district_id
|
||||
t.text :description
|
||||
t.string :slug
|
||||
t.integer :qualtrics_code
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
class CreateDistrictForNewDashboard < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
create_table :districts do |t|
|
||||
t.string :name
|
||||
t.string :slug
|
||||
t.integer :qualtrics_code
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
class UpdateForeignKeyBetweenSurveyItemResponseAndSchool < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
ActiveRecord::Base.connection.execute("DELETE FROM survey_item_responses")
|
||||
|
||||
remove_foreign_key :survey_item_responses, :legacy_schools, column: :school_id
|
||||
add_foreign_key :survey_item_responses, :schools
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
class RenameSqmCategoriesToCategories < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
rename_table :sqm_categories, :categories
|
||||
rename_column :subcategories, :sqm_category_id, :category_id
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue