Skip to content

Commit

Permalink
Disable Rails/ cops in existing db migrations
Browse files Browse the repository at this point in the history
The respective comments were added manually, not automatically.
  • Loading branch information
Splines committed Dec 3, 2023
1 parent 2b4a33f commit ee50c57
Show file tree
Hide file tree
Showing 96 changed files with 302 additions and 203 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# rubocop:disable Rails/
class CreateInteractions < ActiveRecord::Migration[6.0]
def change
create_table :interactions do |t| # rubocop:todo Rails/CreateTableWithTimestamps
create_table :interactions do |t|
t.text :session_id
end
end
end
# rubocop:enable Rails/
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# rubocop:disable Rails/
class AddDetailsToInteraction < ActiveRecord::Migration[6.0]
def change
add_column :interactions, :controller_name, :text # rubocop:todo Rails/BulkChangeTable
add_column :interactions, :controller_name, :text
add_column :interactions, :action_name, :text
add_column :interactions, :referrer_url, :text
end
foo.nil? || foo.empty?
end
# rubocop:enable Rails/
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# rubocop:disable Rails/
class RemoveDetailsFromInteractions < ActiveRecord::Migration[6.0]
def change
remove_column :interactions, :controller_name, :text # rubocop:todo Rails/BulkChangeTable
remove_column :interactions, :controller_name, :text
remove_column :interactions, :action_name, :text
end
end
# rubocop:enable Rails/
4 changes: 3 additions & 1 deletion db/interactions_migrate/20191218131526_create_probes.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# rubocop:disable Rails/
class CreateProbes < ActiveRecord::Migration[6.0]
def change
create_table :probes do |t|
t.integer :question_id
t.integer :quiz_id
t.boolean :correct # rubocop:todo Rails/ThreeStateBooleanColumn
t.boolean :correct
t.text :session_id

t.timestamps
end
end
end
# rubocop:enable Rails/
4 changes: 3 additions & 1 deletion db/migrate/20170914162323_delete_asset_tag_join.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# rubocop:disable Rails/
class DeleteAssetTagJoin < ActiveRecord::Migration[5.1]
def change
drop_table :asset_tag_joins # rubocop:todo Rails/ReversibleMigration
drop_table :asset_tag_joins
end
end
# rubocop:enable Rails/
4 changes: 3 additions & 1 deletion db/migrate/20170919123229_add_admin_to_users.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# rubocop:disable Rails/
class AddAdminToUsers < ActiveRecord::Migration[5.1]
def change
add_column :users, :admin, :boolean # rubocop:todo Rails/ThreeStateBooleanColumn
add_column :users, :admin, :boolean
end
end
# rubocop:enable Rails/
8 changes: 5 additions & 3 deletions db/migrate/20171001204632_drop_asset.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# rubocop:disable Rails/
class DropAsset < ActiveRecord::Migration[5.1]
def change
drop_table :assets # rubocop:todo Rails/ReversibleMigration
drop_table :asset_medium_joins # rubocop:todo Rails/ReversibleMigration
drop_table :connections # rubocop:todo Rails/ReversibleMigration
drop_table :assets
drop_table :asset_medium_joins
drop_table :connections
end
end
# rubocop:enable Rails/
14 changes: 7 additions & 7 deletions db/migrate/20171009142032_add_modules_to_lecture.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# rubocop:disable Rails/
class AddModulesToLecture < ActiveRecord::Migration[5.1]
def change
# rubocop:todo Rails/ThreeStateBooleanColumn
add_column :lectures, :kaviar, :boolean # rubocop:todo Rails/BulkChangeTable, Rails/ThreeStateBooleanColumn
# rubocop:enable Rails/ThreeStateBooleanColumn
add_column :lectures, :sesam, :boolean # rubocop:todo Rails/ThreeStateBooleanColumn
add_column :lectures, :keks, :boolean # rubocop:todo Rails/ThreeStateBooleanColumn
add_column :lectures, :reste, :boolean # rubocop:todo Rails/ThreeStateBooleanColumn
add_column :lectures, :erdbeere, :boolean # rubocop:todo Rails/ThreeStateBooleanColumn
add_column :lectures, :kaviar, :boolean
add_column :lectures, :sesam, :boolean
add_column :lectures, :keks, :boolean
add_column :lectures, :reste, :boolean
add_column :lectures, :erdbeere, :boolean
end
end
# rubocop:enable Rails/
6 changes: 4 additions & 2 deletions db/migrate/20171011122408_add_confirmable_to_devise.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# rubocop:disable Rails/
class AddConfirmableToDevise < ActiveRecord::Migration[5.1]
def up
add_column :users, :confirmation_token, :string # rubocop:todo Rails/BulkChangeTable
add_column :users, :confirmation_token, :string
add_column :users, :confirmed_at, :datetime
add_column :users, :confirmation_sent_at, :datetime
add_index :users, :confirmation_token, unique: true
User.all.update_all confirmed_at: DateTime.now # rubocop:todo Rails/SkipsModelValidations
User.all.update_all confirmed_at: DateTime.now
end

def down
remove_columns :users, :confirmation_token, :confirmed_at, :confirmation_sent_at
end
end
# rubocop:enable Rails/
4 changes: 2 additions & 2 deletions db/migrate/20171011171726_remove_confirmablefrom_devise.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# rubocop:disable Rails/
class RemoveConfirmablefromDevise < ActiveRecord::Migration[5.1]
def change
# rubocop:todo Rails/ReversibleMigration
remove_columns :users, :confirmation_token, :confirmed_at, :confirmation_sent_at
# rubocop:enable Rails/ReversibleMigration
end
end
# rubocop:enable Rails/
4 changes: 3 additions & 1 deletion db/migrate/20171016171419_add_kiwi_to_lecture.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# rubocop:disable Rails/
class AddKiwiToLecture < ActiveRecord::Migration[5.1]
def change
add_column :lectures, :kiwi, :boolean # rubocop:todo Rails/ThreeStateBooleanColumn
add_column :lectures, :kiwi, :boolean
end
end
# rubocop:enable Rails/
4 changes: 3 additions & 1 deletion db/migrate/20171021135749_add_extras_to_medium.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# rubocop:disable Rails/
class AddExtrasToMedium < ActiveRecord::Migration[5.1]
def change
add_column :media, :extras_link, :text # rubocop:todo Rails/BulkChangeTable
add_column :media, :extras_link, :text
add_column :media, :extras_description, :text
end
end
# rubocop:enable Rails/
4 changes: 3 additions & 1 deletion db/migrate/20180524065013_add_consents_to_user.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# rubocop:disable Rails/
class AddConsentsToUser < ActiveRecord::Migration[5.1]
def change
add_column :users, :consents, :boolean # rubocop:todo Rails/ThreeStateBooleanColumn
add_column :users, :consents, :boolean
end
end
# rubocop:enable Rails/
4 changes: 3 additions & 1 deletion db/migrate/20180524103749_remove_trackable_from_user.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# rubocop:disable Rails/
class RemoveTrackableFromUser < ActiveRecord::Migration[5.1]
def change
remove_column :users, :sign_in_count, :integer # rubocop:todo Rails/BulkChangeTable
remove_column :users, :sign_in_count, :integer
remove_column :users, :current_sign_in_at, :datetime
remove_column :users, :last_sign_in_at, :datetime
remove_column :users, :current_sign_in_ip, :string
remove_column :users, :last_sign_in_ip, :string
end
end
# rubocop:enable Rails/
14 changes: 7 additions & 7 deletions db/migrate/20180806092317_add_fields_to_course_user_join.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# rubocop:disable Rails/
class AddFieldsToCourseUserJoin < ActiveRecord::Migration[5.2]
def change
# rubocop:todo Rails/ThreeStateBooleanColumn
add_column :course_user_joins, :sesam, :boolean # rubocop:todo Rails/BulkChangeTable, Rails/ThreeStateBooleanColumn
# rubocop:enable Rails/ThreeStateBooleanColumn
add_column :course_user_joins, :keks, :boolean # rubocop:todo Rails/ThreeStateBooleanColumn
add_column :course_user_joins, :erdbeere, :boolean # rubocop:todo Rails/ThreeStateBooleanColumn
add_column :course_user_joins, :kiwi, :boolean # rubocop:todo Rails/ThreeStateBooleanColumn
add_column :course_user_joins, :reste, :boolean # rubocop:todo Rails/ThreeStateBooleanColumn
add_column :course_user_joins, :sesam, :boolean
add_column :course_user_joins, :keks, :boolean
add_column :course_user_joins, :erdbeere, :boolean
add_column :course_user_joins, :kiwi, :boolean
add_column :course_user_joins, :reste, :boolean
end
end
# rubocop:enable Rails/
4 changes: 3 additions & 1 deletion db/migrate/20180806100940_add_news_to_course_user_join.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# rubocop:disable Rails/
class AddNewsToCourseUserJoin < ActiveRecord::Migration[5.2]
def change
add_column :course_user_joins, :news, :boolean # rubocop:todo Rails/ThreeStateBooleanColumn
add_column :course_user_joins, :news, :boolean
end
end
# rubocop:enable Rails/
4 changes: 3 additions & 1 deletion db/migrate/20180806124930_add_edited_profile_to_user.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# rubocop:disable Rails/
class AddEditedProfileToUser < ActiveRecord::Migration[5.2]
def change
add_column :users, :edited_profile, :boolean # rubocop:todo Rails/ThreeStateBooleanColumn
add_column :users, :edited_profile, :boolean
end
end
# rubocop:enable Rails/
4 changes: 3 additions & 1 deletion db/migrate/20180808092444_remove_properties_from_lecture.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# rubocop:disable Rails/
class RemovePropertiesFromLecture < ActiveRecord::Migration[5.2]
def change
remove_column :lectures, :kaviar, :boolean # rubocop:todo Rails/BulkChangeTable
remove_column :lectures, :kaviar, :boolean
remove_column :lectures, :sesam, :boolean
remove_column :lectures, :keks, :boolean
remove_column :lectures, :reste, :boolean
remove_column :lectures, :erdbeere, :boolean
remove_column :lectures, :kiwi, :boolean
end
end
# rubocop:enable Rails/
4 changes: 3 additions & 1 deletion db/migrate/20180816125615_add_teacher_to_user.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# rubocop:disable Rails/
class AddTeacherToUser < ActiveRecord::Migration[5.2]
def change
add_column :users, :teacher, :boolean # rubocop:todo Rails/ThreeStateBooleanColumn
add_column :users, :teacher, :boolean
end
end
# rubocop:enable Rails/
4 changes: 3 additions & 1 deletion db/migrate/20180819151835_create_editable_user_join_table.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# rubocop:disable Rails/
class CreateEditableUserJoinTable < ActiveRecord::Migration[5.2]
def change
create_table :editable_user_joins do |t| # rubocop:todo Rails/CreateTableWithTimestamps
create_table :editable_user_joins do |t|
t.integer :editable_id
t.string :editable_type
t.integer :user_id
Expand All @@ -11,3 +12,4 @@ def change
name: "polymorphic_editable_idx"
end
end
# rubocop:enable Rails/
6 changes: 3 additions & 3 deletions db/migrate/20180820123437_add_editor_and_name_to_user.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# rubocop:disable Rails/
class AddEditorAndNameToUser < ActiveRecord::Migration[5.2]
def change
# rubocop:todo Rails/ThreeStateBooleanColumn
add_column :users, :editor, :boolean # rubocop:todo Rails/BulkChangeTable, Rails/ThreeStateBooleanColumn
# rubocop:enable Rails/ThreeStateBooleanColumn
add_column :users, :editor, :boolean
add_column :users, :name, :text
end
end
# rubocop:enable Rails/
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# rubocop:disable Rails/
class RemoveTeacherAndTeacherIdFromUser < ActiveRecord::Migration[5.2]
def change
remove_column :users, :teacher, :boolean # rubocop:todo Rails/BulkChangeTable
remove_column :users, :teacher, :boolean
remove_column :users, :teacher_id, :integer
end
end
# rubocop:enable Rails/
4 changes: 3 additions & 1 deletion db/migrate/20180821132727_remove_teacher_fragments.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# rubocop:disable Rails/
class RemoveTeacherFragments < ActiveRecord::Migration[5.2]
def change
remove_column :lectures, :teacher_id # rubocop:todo Rails/ReversibleMigration
remove_column :lectures, :teacher_id
remove_reference :users, :teacher, foreign_key: true, index: true
end
end
# rubocop:enable Rails/
4 changes: 3 additions & 1 deletion db/migrate/20180830080855_add_position_to_section.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# rubocop:disable Rails/
class AddPositionToSection < ActiveRecord::Migration[5.2]
def change
add_column :sections, :position, :integer
Chapter.all.each do |chapter|
chapter.sections.order(:number).each.with_index(1) do |section, index|
section.update_column :position, index # rubocop:todo Rails/SkipsModelValidations
section.update_column :position, index
end
end
end
end
# rubocop:enable Rails/
4 changes: 3 additions & 1 deletion db/migrate/20180830081938_add_position_to_chapter.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# rubocop:disable Rails/
class AddPositionToChapter < ActiveRecord::Migration[5.2]
def change
add_column :chapters, :position, :integer
Lecture.all.each do |lecture|
lecture.chapters.order(:number).each.with_index(1) do |chapter, index|
chapter.update_column :position, index # rubocop:todo Rails/SkipsModelValidations
chapter.update_column :position, index
end
end
end
end
# rubocop:enable Rails/
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# rubocop:disable Rails/
class AddAbsoluteNumberingToLecture < ActiveRecord::Migration[5.2]
def change
add_column :lectures, :absolute_numbering, :boolean # rubocop:todo Rails/ThreeStateBooleanColumn
add_column :lectures, :absolute_numbering, :boolean
end
end
# rubocop:enable Rails/
4 changes: 3 additions & 1 deletion db/migrate/20180830121324_remove_numbers_from_section.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# rubocop:disable Rails/
class RemoveNumbersFromSection < ActiveRecord::Migration[5.2]
def change
remove_column :sections, :number, :integer # rubocop:todo Rails/BulkChangeTable
remove_column :sections, :number, :integer
remove_column :sections, :number_alt, :string
end
end
# rubocop:enable Rails/
4 changes: 3 additions & 1 deletion db/migrate/20180905085400_add_shrine_columns_to_media.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# rubocop:disable Rails/
class AddShrineColumnsToMedia < ActiveRecord::Migration[5.2]
def change
add_column :media, :video_data, :text # rubocop:todo Rails/BulkChangeTable
add_column :media, :video_data, :text
add_column :media, :screenshot_data, :text
add_column :media, :manuscript_data, :text
end
end
# rubocop:enable Rails/
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# rubocop:disable Rails/
class RemoveALotOfColumnsFromMedium < ActiveRecord::Migration[5.2]
def change
remove_column :media, :width, :integer # rubocop:todo Rails/BulkChangeTable
remove_column :media, :width, :integer
remove_column :media, :height, :integer
remove_column :media, :embedded_width, :integer
remove_column :media, :embedded_height, :integer
Expand All @@ -12,3 +13,4 @@ def change
remove_column :media, :video_player, :string
end
end
# rubocop:enable Rails/
4 changes: 3 additions & 1 deletion db/migrate/20180908101213_remove_questions_from_medium.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# rubocop:disable Rails/
class RemoveQuestionsFromMedium < ActiveRecord::Migration[5.2]
def change
remove_column :media, :question_id, :integer # rubocop:todo Rails/BulkChangeTable
remove_column :media, :question_id, :integer
remove_column :media, :question_list, :text
end
end
# rubocop:enable Rails/
6 changes: 4 additions & 2 deletions db/migrate/20180909152728_create_referrals.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# rubocop:disable Rails/
class CreateReferrals < ActiveRecord::Migration[5.2]
def change
create_table :referrals do |t|
t.text :start_time
t.text :end_time
t.boolean :video # rubocop:todo Rails/ThreeStateBooleanColumn
t.boolean :manuscript # rubocop:todo Rails/ThreeStateBooleanColumn
t.boolean :video
t.boolean :manuscript
t.text :explanation
t.references :item, foreign_key: true
t.references :medium, foreign_key: true
Expand All @@ -13,3 +14,4 @@ def change
end
end
end
# rubocop:enable Rails/
4 changes: 3 additions & 1 deletion db/migrate/20180913104612_add_link_to_referral.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# rubocop:disable Rails/
class AddLinkToReferral < ActiveRecord::Migration[5.2]
def change
add_column :referrals, :link, :boolean # rubocop:todo Rails/ThreeStateBooleanColumn
add_column :referrals, :link, :boolean
end
end
# rubocop:enable Rails/
4 changes: 3 additions & 1 deletion db/migrate/20180913110737_add_medium_link_to_referral.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# rubocop:disable Rails/
class AddMediumLinkToReferral < ActiveRecord::Migration[5.2]
def change
add_column :referrals, :medium_link, :boolean # rubocop:todo Rails/ThreeStateBooleanColumn
add_column :referrals, :medium_link, :boolean
end
end
# rubocop:enable Rails/
Loading

0 comments on commit ee50c57

Please sign in to comment.