Extract legacy parts of the codebase into its own module

This commit is contained in:
Liam Morley 2021-11-15 16:07:15 -05:00 committed by rebuilt
parent cf6e80ce6b
commit 413096dfe2
269 changed files with 5549 additions and 5279 deletions

View file

@ -0,0 +1,5 @@
class ChangeQuestionListToLegacyQuestionList < ActiveRecord::Migration[6.1]
def change
rename_table :question_lists, :legacy_question_lists
end
end

View file

@ -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

View 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

View file

@ -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

View file

@ -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

View file

@ -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