Skip to content

Commit

Permalink
ER-1271 Delete old user_answers and user_assessments tables (#1267)
Browse files Browse the repository at this point in the history
* 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
martikat authored Jul 18, 2024
1 parent 11110d0 commit db92d19
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 38 deletions.
23 changes: 23 additions & 0 deletions db/migrate/20240717072502_drop_user_answers_table.rb
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
19 changes: 19 additions & 0 deletions db/migrate/20240717072554_drop_user_assessments_table.rb
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
39 changes: 1 addition & 38 deletions db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit db92d19

Please sign in to comment.