diff --git a/db/migrate/20240322021829_add_scorm_config_to_task_def.rb b/db/migrate/20240322021829_add_scorm_config_to_task_def.rb deleted file mode 100644 index 04847cb9b..000000000 --- a/db/migrate/20240322021829_add_scorm_config_to_task_def.rb +++ /dev/null @@ -1,21 +0,0 @@ -class AddScormConfigToTaskDef < ActiveRecord::Migration[7.0] - def change - change_table :task_definitions do |t| - t.boolean :scorm_enabled, default: false - t.boolean :scorm_allow_review, default: false - t.boolean :scorm_bypass_test, default: false - t.boolean :scorm_time_delay_enabled, default: false - t.integer :scorm_attempt_limit, default: 0 - end - end - - def down - change_table :task_definitions do |t| - t.remove :scorm_enabled - t.remove :scorm_allow_review - t.remove :scorm_bypass_test - t.remove :scorm_time_delay_enabled - t.remove :scorm_attempt_limit - end - end -end diff --git a/db/migrate/20240601103707_add_polymorphic_association_to_comment.rb b/db/migrate/20240601103707_add_polymorphic_association_to_comment.rb deleted file mode 100644 index f6828c0b2..000000000 --- a/db/migrate/20240601103707_add_polymorphic_association_to_comment.rb +++ /dev/null @@ -1,12 +0,0 @@ -class AddPolymorphicAssociationToComment < ActiveRecord::Migration[7.1] - def change - remove_index :task_comments, :overseer_assessment_id - - add_column :task_comments, :commentable_type, :string - rename_column :task_comments, :overseer_assessment_id, :commentable_id - - TaskComment.where('NOT commentable_id IS NULL').in_batches.update_all(commentable_type: 'OverseerAssessment') - - add_index :task_comments, [:commentable_type, :commentable_id] - end -end diff --git a/db/migrate/20240603020127_add_scorm_extensions.rb b/db/migrate/20240603020127_add_scorm_extensions.rb deleted file mode 100644 index 0e549611d..000000000 --- a/db/migrate/20240603020127_add_scorm_extensions.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddScormExtensions < ActiveRecord::Migration[7.1] - def change - add_column :tasks, :scorm_extensions, :integer, null: false, default: 0 - end -end diff --git a/db/migrate/20241025050957_add_scorm_feat.rb b/db/migrate/20241025050957_add_scorm_feat.rb new file mode 100644 index 000000000..e965984ec --- /dev/null +++ b/db/migrate/20241025050957_add_scorm_feat.rb @@ -0,0 +1,24 @@ +class AddScormFeat < ActiveRecord::Migration[7.1] + def change + # Record scorm extensions added to a task + add_column :tasks, :scorm_extensions, :integer, null: false, default: 0 + + change_table :task_definitions do |t| + t.boolean :scorm_enabled, default: false + t.boolean :scorm_allow_review, default: false + t.boolean :scorm_bypass_test, default: false + t.boolean :scorm_time_delay_enabled, default: false + t.integer :scorm_attempt_limit, default: 0 + end + + # Enable polymorphic relationships for task comments + remove_index :task_comments, :overseer_assessment_id + + add_column :task_comments, :commentable_type, :string + rename_column :task_comments, :overseer_assessment_id, :commentable_id + + TaskComment.where('NOT commentable_id IS NULL').in_batches.update_all(commentable_type: 'OverseerAssessment') + + add_index :task_comments, [:commentable_type, :commentable_id] + end +end diff --git a/db/schema.rb b/db/schema.rb index a2b40c6ed..bd307f628 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.1].define(version: 2024_07_01_221318) do +ActiveRecord::Schema[7.1].define(version: 2024_10_25_050957) do create_table "activity_types", charset: "utf8", collation: "utf8_unicode_ci", force: :cascade do |t| t.string "name", null: false t.string "abbreviation", null: false