From 526bc087b59c35f0d8c4949d6f09c7dcf03dacfb Mon Sep 17 00:00:00 2001 From: Splines Date: Sun, 22 Oct 2023 18:11:06 +0200 Subject: [PATCH] Merge together multiple annotation-related migrations --- db/migrate/20221015114100_create_annotations.rb | 2 ++ .../20230117124508_add_annotations_status_to_medium.rb | 2 +- .../20230117124528_add_annotations_status_to_lecture.rb | 2 +- ...62844_add_public_comment_id_and_subtext_to_annotation.rb | 6 ------ db/migrate/20231001065026_remove_subtext_from_annotation.rb | 5 ----- db/migrate/20231001065435_add_subcategory_to_annotation.rb | 5 ----- ...ange_annotations_status_default_in_media_and_lectures.rb | 6 ------ 7 files changed, 4 insertions(+), 24 deletions(-) delete mode 100644 db/migrate/20230523062844_add_public_comment_id_and_subtext_to_annotation.rb delete mode 100644 db/migrate/20231001065026_remove_subtext_from_annotation.rb delete mode 100644 db/migrate/20231001065435_add_subcategory_to_annotation.rb delete mode 100644 db/migrate/20231021100348_change_annotations_status_default_in_media_and_lectures.rb diff --git a/db/migrate/20221015114100_create_annotations.rb b/db/migrate/20221015114100_create_annotations.rb index c30220336..02bbd65bc 100644 --- a/db/migrate/20221015114100_create_annotations.rb +++ b/db/migrate/20221015114100_create_annotations.rb @@ -8,6 +8,8 @@ def change t.integer :category t.boolean :visible_for_teacher t.string :color + t.integer :public_comment_id + t.integer :subcategory t.timestamps end diff --git a/db/migrate/20230117124508_add_annotations_status_to_medium.rb b/db/migrate/20230117124508_add_annotations_status_to_medium.rb index 6de139be6..ca48b67d7 100644 --- a/db/migrate/20230117124508_add_annotations_status_to_medium.rb +++ b/db/migrate/20230117124508_add_annotations_status_to_medium.rb @@ -1,5 +1,5 @@ class AddAnnotationsStatusToMedium < ActiveRecord::Migration[7.0] def change - add_column :media, :annotations_status, :integer + add_column :media, :annotations_status, :integer, default: 0 end end diff --git a/db/migrate/20230117124528_add_annotations_status_to_lecture.rb b/db/migrate/20230117124528_add_annotations_status_to_lecture.rb index 3039866d7..e829fcc1a 100644 --- a/db/migrate/20230117124528_add_annotations_status_to_lecture.rb +++ b/db/migrate/20230117124528_add_annotations_status_to_lecture.rb @@ -1,5 +1,5 @@ class AddAnnotationsStatusToLecture < ActiveRecord::Migration[7.0] def change - add_column :lectures, :annotations_status, :integer + add_column :lectures, :annotations_status, :integer, default: -1 end end diff --git a/db/migrate/20230523062844_add_public_comment_id_and_subtext_to_annotation.rb b/db/migrate/20230523062844_add_public_comment_id_and_subtext_to_annotation.rb deleted file mode 100644 index 8a49b3d38..000000000 --- a/db/migrate/20230523062844_add_public_comment_id_and_subtext_to_annotation.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddPublicCommentIdAndSubtextToAnnotation < ActiveRecord::Migration[7.0] - def change - add_column :annotations, :public_comment_id, :integer - add_column :annotations, :subtext, :text - end -end diff --git a/db/migrate/20231001065026_remove_subtext_from_annotation.rb b/db/migrate/20231001065026_remove_subtext_from_annotation.rb deleted file mode 100644 index 2cb796b87..000000000 --- a/db/migrate/20231001065026_remove_subtext_from_annotation.rb +++ /dev/null @@ -1,5 +0,0 @@ -class RemoveSubtextFromAnnotation < ActiveRecord::Migration[7.0] - def change - remove_column :annotations, :subtext, :text - end -end diff --git a/db/migrate/20231001065435_add_subcategory_to_annotation.rb b/db/migrate/20231001065435_add_subcategory_to_annotation.rb deleted file mode 100644 index 62e2f8d4b..000000000 --- a/db/migrate/20231001065435_add_subcategory_to_annotation.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddSubcategoryToAnnotation < ActiveRecord::Migration[7.0] - def change - add_column :annotations, :subcategory, :integer - end -end diff --git a/db/migrate/20231021100348_change_annotations_status_default_in_media_and_lectures.rb b/db/migrate/20231021100348_change_annotations_status_default_in_media_and_lectures.rb deleted file mode 100644 index 52a2e7c21..000000000 --- a/db/migrate/20231021100348_change_annotations_status_default_in_media_and_lectures.rb +++ /dev/null @@ -1,6 +0,0 @@ -class ChangeAnnotationsStatusDefaultInMediaAndLectures < ActiveRecord::Migration[7.0] - def change - change_column_default :media, :annotations_status, 0 - change_column_default :lectures, :annotations_status, -1 - end -end