-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ER-1271 Delete old user_answers and user_assessments tables (#1267)
* Create migration to drop user answers and user assessments tables * Fix rubocop errors * Revert research participant update in schema * Update file so it includes all columns in pre-dropped state for user answers table
- Loading branch information
Showing
3 changed files
with
43 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
class DropUserAnswersTable < ActiveRecord::Migration[7.1] | ||
def up | ||
drop_table :user_answers | ||
end | ||
|
||
def down | ||
create_table :user_answers do |t| | ||
t.references :user, null: false, foreign_key: true | ||
t.integer :questionnaire_id, null: false, index: true | ||
t.string :question | ||
t.string :answer | ||
t.boolean :correct | ||
t.boolean :archived | ||
t.index %i[questionnaire_id user_id] | ||
t.timestamps | ||
t.string :module | ||
t.string :name | ||
t.string :assessments_type | ||
t.references :user_assessment, null: true, foreign_key: true | ||
t.string :state | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
class DropUserAssessmentsTable < ActiveRecord::Migration[7.1] | ||
def up | ||
drop_table :user_assessments | ||
end | ||
|
||
def down | ||
create_table :user_assessments do |t| | ||
t.references :user, null: false, foreign_key: true | ||
t.string :score | ||
t.string :status | ||
t.string :module | ||
t.string :assessments_type | ||
t.boolean :archived | ||
t.datetime :completed | ||
t.index %i[score status] | ||
t.timestamps | ||
end | ||
end | ||
end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.