From 55addaa58aff9e1a7ad0b7098bc773264945ba92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Wed, 23 Oct 2019 22:27:29 +0200 Subject: [PATCH] Apply rubocop rules to migration files There are some rules which only affect migration files, and we cannot enable them if we're excluding those files from being inspected. We're also changing migrations related to the Rails/TimeZone rule slightly because these fields were already changed afterwards, so we aren't changing the schema. --- .rubocop_basic.yml | 1 - ...0150717180105_acts_as_votable_migration.rb | 1 - db/migrate/20150910133047_create_locks.rb | 2 +- db/migrate/20150911171301_create_proposal.rb | 2 +- ...0150914181921_add_more_indexes_for_ahoy.rb | 1 - ...929_adds_resilient_locked_until_default.rb | 6 ++---- .../20151028213830_add_unaccent_extension.rb | 4 ++-- .../20151028221647_add_pg_trgm_extension.rb | 4 ++-- ...1111202657_adds_tsvector_update_trigger.rb | 2 -- ...0113_merge_activities_and_notifications.rb | 1 - .../20160204134022_add_tsvector_to_debates.rb | 2 -- ...0106_add_tsvector_to_spending_proposals.rb | 2 -- db/migrate/20160518141543_create_banners.rb | 20 +++++++++---------- ...0160518151245_create_budget_investments.rb | 3 +-- ...61102133838_default_password_changed_at.rb | 2 +- .../20170102080432_adjust_budget_fields.rb | 2 +- ..._poll_id_and_stats_fields_to_poll_voter.rb | 2 +- ...0125114952_add_answer_id_to_poll_voters.rb | 2 +- ...0170212123435_add_polls_related_indexes.rb | 2 -- ...6174351_create_site_customization_pages.rb | 2 +- db/migrate/20170807082243_create_topics.rb | 2 +- ...4154743_fix_password_changed_at_default.rb | 5 ++--- .../20171002122312_create_poll_recount.rb | 6 +++--- ..._rename_poll_question_id_to_question_id.rb | 2 +- ...4152_add_time_zone_to_default_datetimes.rb | 4 ++-- .../20171127171925_create_related_content.rb | 6 +++--- ...20180323190027_add_translate_milestones.rb | 1 - ...ate_proposal_executed_dashboard_actions.rb | 2 +- ...vestment_statuses_to_milestone_statuses.rb | 1 - ...or_task_to_dashboard_administrator_task.rb | 2 +- ...rename_dashboard_action_id_to_action_id.rb | 2 +- .../20180727140800_add_banner_translations.rb | 2 -- ...20800_add_homepage_content_translations.rb | 2 -- .../20180730213824_add_poll_translations.rb | 2 -- ...800_add_admin_notification_translations.rb | 2 -- ...31173147_add_poll_question_translations.rb | 2 -- ...9_add_poll_question_answer_translations.rb | 2 -- ..._collaborative_legislation_translations.rb | 1 - ...104170114_add_active_polls_translations.rb | 2 -- .../20190118135741_add_budget_translations.rb | 2 -- ...119160418_add_budget_phase_translations.rb | 2 -- ...120155819_add_budget_group_translations.rb | 2 -- ...1171237_add_budget_heading_translations.rb | 2 -- ...20406_create_budget_tracker_assignments.rb | 2 +- .../20190513112613_create_votation_types.rb | 1 - ..._add_order_and_positive_in_poll_answers.rb | 1 - ...20190516091051_add_help_link_to_budgets.rb | 4 ++-- ...20190522075912_create_poll_pair_answers.rb | 1 - ...d_hidden_field_to_poll_question_answers.rb | 1 - ...0190524121957_add_value_to_poll_answers.rb | 1 - ...90528134530_create_votation_set_answers.rb | 1 - 51 files changed, 42 insertions(+), 89 deletions(-) diff --git a/.rubocop_basic.yml b/.rubocop_basic.yml index dd02bef99..ef29ae0ef 100644 --- a/.rubocop_basic.yml +++ b/.rubocop_basic.yml @@ -7,7 +7,6 @@ AllCops: DisplayCopNames: true DisplayStyleGuide: true Exclude: - - "db/migrate/**/*" - "db/schema.rb" # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop # to ignore them, so only the ones explicitly set in this file are enabled. diff --git a/db/migrate/20150717180105_acts_as_votable_migration.rb b/db/migrate/20150717180105_acts_as_votable_migration.rb index 2770b4cef..d29f5bc53 100644 --- a/db/migrate/20150717180105_acts_as_votable_migration.rb +++ b/db/migrate/20150717180105_acts_as_votable_migration.rb @@ -1,7 +1,6 @@ class ActsAsVotableMigration < ActiveRecord::Migration[4.2] def self.up create_table :votes do |t| - t.references :votable, polymorphic: true t.references :voter, polymorphic: true diff --git a/db/migrate/20150910133047_create_locks.rb b/db/migrate/20150910133047_create_locks.rb index ae349b9ec..4039bcffb 100644 --- a/db/migrate/20150910133047_create_locks.rb +++ b/db/migrate/20150910133047_create_locks.rb @@ -3,7 +3,7 @@ class CreateLocks < ActiveRecord::Migration[4.2] create_table :locks do |t| t.references :user, index: true, foreign_key: true t.integer :tries, default: 0 - t.datetime :locked_until, null: false, default: Time.now + t.datetime :locked_until, null: false, default: Time.zone.now t.timestamps null: false end diff --git a/db/migrate/20150911171301_create_proposal.rb b/db/migrate/20150911171301_create_proposal.rb index 79bb58eef..efad0e178 100644 --- a/db/migrate/20150911171301_create_proposal.rb +++ b/db/migrate/20150911171301_create_proposal.rb @@ -7,7 +7,7 @@ class CreateProposal < ActiveRecord::Migration[4.2] t.string "external_url" t.integer "author_id" t.datetime "hidden_at" - t.integer "flags_count", default: 0 + t.integer "flags_count", default: 0 t.datetime "ignored_flag_at" t.integer "cached_votes_up", default: 0 t.integer "comments_count", default: 0 diff --git a/db/migrate/20150914181921_add_more_indexes_for_ahoy.rb b/db/migrate/20150914181921_add_more_indexes_for_ahoy.rb index 86924a42d..e9720cea9 100644 --- a/db/migrate/20150914181921_add_more_indexes_for_ahoy.rb +++ b/db/migrate/20150914181921_add_more_indexes_for_ahoy.rb @@ -4,4 +4,3 @@ class AddMoreIndexesForAhoy < ActiveRecord::Migration[4.2] add_index :visits, [:started_at] end end - diff --git a/db/migrate/20150926115929_adds_resilient_locked_until_default.rb b/db/migrate/20150926115929_adds_resilient_locked_until_default.rb index d3fb1f4e5..3cbb167a2 100644 --- a/db/migrate/20150926115929_adds_resilient_locked_until_default.rb +++ b/db/migrate/20150926115929_adds_resilient_locked_until_default.rb @@ -1,11 +1,9 @@ class AddsResilientLockedUntilDefault < ActiveRecord::Migration[4.2] - def up - change_column_default :locks, :locked_until, Time.new(2000, 1, 1, 1, 1, 1) + change_column_default :locks, :locked_until, Time.zone.local(2000, 1, 1, 1, 1, 1) end def down - change_column_default :locks, :locked_until, Time.now + change_column_default :locks, :locked_until, Time.zone.now end - end diff --git a/db/migrate/20151028213830_add_unaccent_extension.rb b/db/migrate/20151028213830_add_unaccent_extension.rb index fa64f7ff6..a7a38fcda 100644 --- a/db/migrate/20151028213830_add_unaccent_extension.rb +++ b/db/migrate/20151028213830_add_unaccent_extension.rb @@ -1,9 +1,9 @@ class AddUnaccentExtension < ActiveRecord::Migration[4.2] def change - return if extension_enabled?('unaccent') + return if extension_enabled?("unaccent") begin - enable_extension 'unaccent' + enable_extension "unaccent" rescue StandardError => e raise "Could not create extension unaccent. Please contact with your system administrator: #{e}" end diff --git a/db/migrate/20151028221647_add_pg_trgm_extension.rb b/db/migrate/20151028221647_add_pg_trgm_extension.rb index 6d596ebe6..98146d4c2 100644 --- a/db/migrate/20151028221647_add_pg_trgm_extension.rb +++ b/db/migrate/20151028221647_add_pg_trgm_extension.rb @@ -1,9 +1,9 @@ class AddPgTrgmExtension < ActiveRecord::Migration[4.2] def change - return if extension_enabled?('pg_trgm') + return if extension_enabled?("pg_trgm") begin - enable_extension 'pg_trgm' + enable_extension "pg_trgm" rescue StandardError => e raise "Could not create extension pg_trgm. Please contact with your system administrator: #{e}" end diff --git a/db/migrate/20151111202657_adds_tsvector_update_trigger.rb b/db/migrate/20151111202657_adds_tsvector_update_trigger.rb index 17ae75c54..eab5a7abd 100644 --- a/db/migrate/20151111202657_adds_tsvector_update_trigger.rb +++ b/db/migrate/20151111202657_adds_tsvector_update_trigger.rb @@ -1,5 +1,4 @@ class AddsTsvectorUpdateTrigger < ActiveRecord::Migration[4.2] - def up add_column :proposals, :tsv, :tsvector add_index :proposals, :tsv, using: "gin" @@ -9,5 +8,4 @@ class AddsTsvectorUpdateTrigger < ActiveRecord::Migration[4.2] remove_index :proposals, :tsv remove_column :proposals, :tsv end - end diff --git a/db/migrate/20160105170113_merge_activities_and_notifications.rb b/db/migrate/20160105170113_merge_activities_and_notifications.rb index 8bf113ea7..d4aa5b522 100644 --- a/db/migrate/20160105170113_merge_activities_and_notifications.rb +++ b/db/migrate/20160105170113_merge_activities_and_notifications.rb @@ -6,5 +6,4 @@ class MergeActivitiesAndNotifications < ActiveRecord::Migration[4.2] t.references :notifiable, polymorphic: true end end - end diff --git a/db/migrate/20160204134022_add_tsvector_to_debates.rb b/db/migrate/20160204134022_add_tsvector_to_debates.rb index 96dfd5e9c..9afe1bfae 100644 --- a/db/migrate/20160204134022_add_tsvector_to_debates.rb +++ b/db/migrate/20160204134022_add_tsvector_to_debates.rb @@ -1,5 +1,4 @@ class AddTsvectorToDebates < ActiveRecord::Migration[4.2] - def up add_column :debates, :tsv, :tsvector add_index :debates, :tsv, using: "gin" @@ -9,5 +8,4 @@ class AddTsvectorToDebates < ActiveRecord::Migration[4.2] remove_index :debates, :tsv remove_column :debates, :tsv end - end diff --git a/db/migrate/20160329160106_add_tsvector_to_spending_proposals.rb b/db/migrate/20160329160106_add_tsvector_to_spending_proposals.rb index ccdb08cc2..a410b3981 100644 --- a/db/migrate/20160329160106_add_tsvector_to_spending_proposals.rb +++ b/db/migrate/20160329160106_add_tsvector_to_spending_proposals.rb @@ -1,8 +1,6 @@ class AddTsvectorToSpendingProposals < ActiveRecord::Migration[4.2] - def change add_column :spending_proposals, :tsv, :tsvector add_index :spending_proposals, :tsv, using: "gin" end - end diff --git a/db/migrate/20160518141543_create_banners.rb b/db/migrate/20160518141543_create_banners.rb index 4199cf5d2..4b4d57242 100644 --- a/db/migrate/20160518141543_create_banners.rb +++ b/db/migrate/20160518141543_create_banners.rb @@ -1,17 +1,17 @@ class CreateBanners < ActiveRecord::Migration[4.2] def change create_table :banners do |t| - t.string :title, limit: 80 - t.string :description - t.string :target_url - t.string :style - t.string :image - t.date :post_started_at - t.date :post_ended_at - t.datetime :hidden_at + t.string :title, limit: 80 + t.string :description + t.string :target_url + t.string :style + t.string :image + t.date :post_started_at + t.date :post_ended_at + t.datetime :hidden_at - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end add_index :banners, :hidden_at diff --git a/db/migrate/20160518151245_create_budget_investments.rb b/db/migrate/20160518151245_create_budget_investments.rb index a33b762ef..2b9a7ef02 100644 --- a/db/migrate/20160518151245_create_budget_investments.rb +++ b/db/migrate/20160518151245_create_budget_investments.rb @@ -1,7 +1,6 @@ class CreateBudgetInvestments < ActiveRecord::Migration[4.2] def change create_table :budget_investments do |t| - t.references "geozone" t.integer "author_id", index: true @@ -24,7 +23,7 @@ class CreateBudgetInvestments < ActiveRecord::Migration[4.2] t.datetime "hidden_at" t.integer "cached_votes_up", default: 0 t.integer "comments_count", default: 0 - t.integer "confidence_score", default: 0, null: false + t.integer "confidence_score", default: 0, null: false t.integer "physical_votes", default: 0 t.tsvector "tsv" diff --git a/db/migrate/20161102133838_default_password_changed_at.rb b/db/migrate/20161102133838_default_password_changed_at.rb index ec58525da..81320d0f2 100644 --- a/db/migrate/20161102133838_default_password_changed_at.rb +++ b/db/migrate/20161102133838_default_password_changed_at.rb @@ -1,5 +1,5 @@ class DefaultPasswordChangedAt < ActiveRecord::Migration[4.2] def change - change_column :users, :password_changed_at, :datetime, null: false, default: Time.now + change_column :users, :password_changed_at, :datetime, null: false, default: Time.zone.now end end diff --git a/db/migrate/20170102080432_adjust_budget_fields.rb b/db/migrate/20170102080432_adjust_budget_fields.rb index c39afe8b1..f2a4427dc 100644 --- a/db/migrate/20170102080432_adjust_budget_fields.rb +++ b/db/migrate/20170102080432_adjust_budget_fields.rb @@ -1,5 +1,5 @@ class AdjustBudgetFields < ActiveRecord::Migration[4.2] def change - change_column :budgets, :phase, :string, limit: 40, default: 'accepting' + change_column :budgets, :phase, :string, limit: 40, default: "accepting" end end diff --git a/db/migrate/20170125104542_add_poll_id_and_stats_fields_to_poll_voter.rb b/db/migrate/20170125104542_add_poll_id_and_stats_fields_to_poll_voter.rb index 6488f099e..960ba1716 100644 --- a/db/migrate/20170125104542_add_poll_id_and_stats_fields_to_poll_voter.rb +++ b/db/migrate/20170125104542_add_poll_id_and_stats_fields_to_poll_voter.rb @@ -1,6 +1,6 @@ class AddPollIdAndStatsFieldsToPollVoter < ActiveRecord::Migration[4.2] def change - add_column :poll_voters, :poll_id, :integer, null: false + add_column :poll_voters, :poll_id, :integer, null: false remove_column :poll_voters, :booth_assignment_id, :integer, null: false add_column :poll_voters, :booth_assignment_id, :integer diff --git a/db/migrate/20170125114952_add_answer_id_to_poll_voters.rb b/db/migrate/20170125114952_add_answer_id_to_poll_voters.rb index 58d8fabc9..097e05047 100644 --- a/db/migrate/20170125114952_add_answer_id_to_poll_voters.rb +++ b/db/migrate/20170125114952_add_answer_id_to_poll_voters.rb @@ -4,6 +4,6 @@ class AddAnswerIdToPollVoters < ActiveRecord::Migration[4.2] add_index :poll_voters, :document_number add_index :poll_voters, :poll_id - add_index :poll_voters, [:poll_id, :document_number, :document_type], name: 'doc_by_poll' + add_index :poll_voters, [:poll_id, :document_number, :document_type], name: "doc_by_poll" end end diff --git a/db/migrate/20170212123435_add_polls_related_indexes.rb b/db/migrate/20170212123435_add_polls_related_indexes.rb index 31f567e89..a50263cee 100644 --- a/db/migrate/20170212123435_add_polls_related_indexes.rb +++ b/db/migrate/20170212123435_add_polls_related_indexes.rb @@ -1,6 +1,5 @@ class AddPollsRelatedIndexes < ActiveRecord::Migration[4.2] def change - add_index :poll_booth_assignments, :booth_id add_index :poll_booth_assignments, :poll_id @@ -17,7 +16,6 @@ class AddPollsRelatedIndexes < ActiveRecord::Migration[4.2] add_index :polls, [:starts_at, :ends_at] - add_foreign_key :poll_answers, :poll_questions, column: :question_id add_foreign_key :poll_booth_assignments, :polls add_foreign_key :poll_final_recounts, :poll_booth_assignments, column: :booth_assignment_id diff --git a/db/migrate/20170316174351_create_site_customization_pages.rb b/db/migrate/20170316174351_create_site_customization_pages.rb index 8489c8263..056231485 100644 --- a/db/migrate/20170316174351_create_site_customization_pages.rb +++ b/db/migrate/20170316174351_create_site_customization_pages.rb @@ -7,7 +7,7 @@ class CreateSiteCustomizationPages < ActiveRecord::Migration[4.2] t.text :content t.boolean :more_info_flag t.boolean :print_content_flag - t.string :status, default: 'draft' + t.string :status, default: "draft" t.timestamps null: false end diff --git a/db/migrate/20170807082243_create_topics.rb b/db/migrate/20170807082243_create_topics.rb index 89aeb2789..db8d2f104 100644 --- a/db/migrate/20170807082243_create_topics.rb +++ b/db/migrate/20170807082243_create_topics.rb @@ -4,7 +4,7 @@ class CreateTopics < ActiveRecord::Migration[4.2] t.string :title, null: false t.text :description t.integer :author_id - t.integer "comments_count", default: 0 + t.integer "comments_count", default: 0 t.references :community, index: true t.datetime :hidden_at, index: true t.timestamps null: false diff --git a/db/migrate/20170914154743_fix_password_changed_at_default.rb b/db/migrate/20170914154743_fix_password_changed_at_default.rb index 4c1fc0107..7decdb3cd 100644 --- a/db/migrate/20170914154743_fix_password_changed_at_default.rb +++ b/db/migrate/20170914154743_fix_password_changed_at_default.rb @@ -1,10 +1,9 @@ class FixPasswordChangedAtDefault < ActiveRecord::Migration[4.2] def up - change_column_default :users, :password_changed_at, Time.new(2015, 1, 1, 1, 1, 1) + change_column_default :users, :password_changed_at, Time.zone.local(2015, 1, 1, 1, 1, 1) end def down - change_column_default :users, :password_changed_at, Time.now + change_column_default :users, :password_changed_at, Time.zone.now end - end diff --git a/db/migrate/20171002122312_create_poll_recount.rb b/db/migrate/20171002122312_create_poll_recount.rb index c104b483f..79508622c 100644 --- a/db/migrate/20171002122312_create_poll_recount.rb +++ b/db/migrate/20171002122312_create_poll_recount.rb @@ -9,11 +9,11 @@ class CreatePollRecount < ActiveRecord::Migration[4.2] t.text :officer_assignment_id_log, default: "" t.text :author_id_log, default: "" t.integer :white_amount - t.text :white_amount_log, default: "" + t.text :white_amount_log, default: "" t.integer :null_amount - t.text :null_amount_log, default: "" + t.text :null_amount_log, default: "" t.integer :total_amount - t.text :total_amount_log, default: "" + t.text :total_amount_log, default: "" end add_index :poll_recounts, :booth_assignment_id diff --git a/db/migrate/20171004151553_rename_poll_question_id_to_question_id.rb b/db/migrate/20171004151553_rename_poll_question_id_to_question_id.rb index abbdb8a6b..f1438e936 100644 --- a/db/migrate/20171004151553_rename_poll_question_id_to_question_id.rb +++ b/db/migrate/20171004151553_rename_poll_question_id_to_question_id.rb @@ -1,5 +1,5 @@ class RenamePollQuestionIdToQuestionId < ActiveRecord::Migration[4.2] def change - rename_column :poll_question_answers, :poll_question_id, :question_id + rename_column :poll_question_answers, :poll_question_id, :question_id end end diff --git a/db/migrate/20171115164152_add_time_zone_to_default_datetimes.rb b/db/migrate/20171115164152_add_time_zone_to_default_datetimes.rb index 895a93ecf..0b658ee7a 100644 --- a/db/migrate/20171115164152_add_time_zone_to_default_datetimes.rb +++ b/db/migrate/20171115164152_add_time_zone_to_default_datetimes.rb @@ -1,6 +1,6 @@ class AddTimeZoneToDefaultDatetimes < ActiveRecord::Migration[4.2] def change - change_column_default :users, :password_changed_at, DateTime.new(2015, 1, 1, 1, 1, 1, '+00:00') - change_column_default :locks, :locked_until, DateTime.new(2000, 1, 1, 1, 1, 1, '+00:00') + change_column_default :users, :password_changed_at, DateTime.new(2015, 1, 1, 1, 1, 1, "+00:00") + change_column_default :locks, :locked_until, DateTime.new(2000, 1, 1, 1, 1, 1, "+00:00") end end diff --git a/db/migrate/20171127171925_create_related_content.rb b/db/migrate/20171127171925_create_related_content.rb index e65dd2e96..380104342 100644 --- a/db/migrate/20171127171925_create_related_content.rb +++ b/db/migrate/20171127171925_create_related_content.rb @@ -1,9 +1,9 @@ class CreateRelatedContent < ActiveRecord::Migration[4.2] def change create_table :related_contents do |t| - t.references :parent_relationable, polymorphic: true, index: { name: 'index_related_contents_on_parent_relationable' } - t.references :child_relationable, polymorphic: true, index: { name: 'index_related_contents_on_child_relationable' } - t.references :related_content, index: { name: 'opposite_related_content' } + t.references :parent_relationable, polymorphic: true, index: { name: "index_related_contents_on_parent_relationable" } + t.references :child_relationable, polymorphic: true, index: { name: "index_related_contents_on_child_relationable" } + t.references :related_content, index: { name: "opposite_related_content" } t.timestamps end diff --git a/db/migrate/20180323190027_add_translate_milestones.rb b/db/migrate/20180323190027_add_translate_milestones.rb index 978d227e7..08823a80a 100644 --- a/db/migrate/20180323190027_add_translate_milestones.rb +++ b/db/migrate/20180323190027_add_translate_milestones.rb @@ -6,7 +6,6 @@ class AddTranslateMilestones < ActiveRecord::Migration[4.2] t.timestamps null: false t.string :title t.text :description - end add_index :budget_investment_milestone_translations, diff --git a/db/migrate/20180614122630_create_proposal_executed_dashboard_actions.rb b/db/migrate/20180614122630_create_proposal_executed_dashboard_actions.rb index b407532d9..8a88d8c6c 100644 --- a/db/migrate/20180614122630_create_proposal_executed_dashboard_actions.rb +++ b/db/migrate/20180614122630_create_proposal_executed_dashboard_actions.rb @@ -2,7 +2,7 @@ class CreateProposalExecutedDashboardActions < ActiveRecord::Migration[4.2] def change create_table :proposal_executed_dashboard_actions do |t| t.references :proposal, index: true, foreign_key: true - t.references :proposal_dashboard_action, index: { name: 'index_proposal_action' }, foreign_key: true + t.references :proposal_dashboard_action, index: { name: "index_proposal_action" }, foreign_key: true t.datetime :executed_at t.text :comments diff --git a/db/migrate/20180713103402_change_budget_investment_statuses_to_milestone_statuses.rb b/db/migrate/20180713103402_change_budget_investment_statuses_to_milestone_statuses.rb index 02dec73bc..7612871fd 100644 --- a/db/migrate/20180713103402_change_budget_investment_statuses_to_milestone_statuses.rb +++ b/db/migrate/20180713103402_change_budget_investment_statuses_to_milestone_statuses.rb @@ -9,4 +9,3 @@ class ChangeBudgetInvestmentStatusesToMilestoneStatuses < ActiveRecord::Migratio end end end - diff --git a/db/migrate/20180723102010_rename_administrator_task_to_dashboard_administrator_task.rb b/db/migrate/20180723102010_rename_administrator_task_to_dashboard_administrator_task.rb index 6fea362bc..59ce79074 100644 --- a/db/migrate/20180723102010_rename_administrator_task_to_dashboard_administrator_task.rb +++ b/db/migrate/20180723102010_rename_administrator_task_to_dashboard_administrator_task.rb @@ -1,6 +1,6 @@ class RenameAdministratorTaskToDashboardAdministratorTask < ActiveRecord::Migration[4.2] def change - rename_index :administrator_tasks, 'index_administrator_tasks_on_source_type_and_source_id', 'index_dashboard_administrator_tasks_on_source' + rename_index :administrator_tasks, "index_administrator_tasks_on_source_type_and_source_id", "index_dashboard_administrator_tasks_on_source" rename_table :administrator_tasks, :dashboard_administrator_tasks end end diff --git a/db/migrate/20180723112930_rename_dashboard_action_id_to_action_id.rb b/db/migrate/20180723112930_rename_dashboard_action_id_to_action_id.rb index 958b567ab..366b37e8a 100644 --- a/db/migrate/20180723112930_rename_dashboard_action_id_to_action_id.rb +++ b/db/migrate/20180723112930_rename_dashboard_action_id_to_action_id.rb @@ -1,5 +1,5 @@ class RenameDashboardActionIdToActionId < ActiveRecord::Migration[4.2] def change - rename_column :dashboard_executed_actions, :dashboard_action_id, :action_id + rename_column :dashboard_executed_actions, :dashboard_action_id, :action_id end end diff --git a/db/migrate/20180727140800_add_banner_translations.rb b/db/migrate/20180727140800_add_banner_translations.rb index e6587deeb..710dc8237 100644 --- a/db/migrate/20180727140800_add_banner_translations.rb +++ b/db/migrate/20180727140800_add_banner_translations.rb @@ -1,5 +1,4 @@ class AddBannerTranslations < ActiveRecord::Migration[4.2] - def self.up Banner.create_translation_table!( { @@ -14,4 +13,3 @@ class AddBannerTranslations < ActiveRecord::Migration[4.2] Banner.drop_translation_table! end end - diff --git a/db/migrate/20180730120800_add_homepage_content_translations.rb b/db/migrate/20180730120800_add_homepage_content_translations.rb index c55e1af3f..b8c8a8e74 100644 --- a/db/migrate/20180730120800_add_homepage_content_translations.rb +++ b/db/migrate/20180730120800_add_homepage_content_translations.rb @@ -1,5 +1,4 @@ class AddHomepageContentTranslations < ActiveRecord::Migration[4.2] - def self.up Widget::Card.create_translation_table!( { @@ -16,4 +15,3 @@ class AddHomepageContentTranslations < ActiveRecord::Migration[4.2] Widget::Card.drop_translation_table! end end - diff --git a/db/migrate/20180730213824_add_poll_translations.rb b/db/migrate/20180730213824_add_poll_translations.rb index 48837c550..c4c9b4bbc 100644 --- a/db/migrate/20180730213824_add_poll_translations.rb +++ b/db/migrate/20180730213824_add_poll_translations.rb @@ -1,5 +1,4 @@ class AddPollTranslations < ActiveRecord::Migration[4.2] - def self.up Poll.create_translation_table!( { @@ -14,5 +13,4 @@ class AddPollTranslations < ActiveRecord::Migration[4.2] def self.down Poll.drop_translation_table! end - end diff --git a/db/migrate/20180731150800_add_admin_notification_translations.rb b/db/migrate/20180731150800_add_admin_notification_translations.rb index 83dfb3cf9..daff4bc5d 100644 --- a/db/migrate/20180731150800_add_admin_notification_translations.rb +++ b/db/migrate/20180731150800_add_admin_notification_translations.rb @@ -1,5 +1,4 @@ class AddAdminNotificationTranslations < ActiveRecord::Migration[4.2] - def self.up AdminNotification.create_translation_table!( { @@ -14,4 +13,3 @@ class AddAdminNotificationTranslations < ActiveRecord::Migration[4.2] AdminNotification.drop_translation_table! end end - diff --git a/db/migrate/20180731173147_add_poll_question_translations.rb b/db/migrate/20180731173147_add_poll_question_translations.rb index f099e49b9..6d5676c40 100644 --- a/db/migrate/20180731173147_add_poll_question_translations.rb +++ b/db/migrate/20180731173147_add_poll_question_translations.rb @@ -1,5 +1,4 @@ class AddPollQuestionTranslations < ActiveRecord::Migration[4.2] - def self.up Poll::Question.create_translation_table!( { title: :string }, @@ -10,5 +9,4 @@ class AddPollQuestionTranslations < ActiveRecord::Migration[4.2] def self.down Poll::Question.drop_translation_table! end - end diff --git a/db/migrate/20180801114529_add_poll_question_answer_translations.rb b/db/migrate/20180801114529_add_poll_question_answer_translations.rb index 5f9a8cada..f9ef730d5 100644 --- a/db/migrate/20180801114529_add_poll_question_answer_translations.rb +++ b/db/migrate/20180801114529_add_poll_question_answer_translations.rb @@ -1,5 +1,4 @@ class AddPollQuestionAnswerTranslations < ActiveRecord::Migration[4.2] - def self.up Poll::Question::Answer.create_translation_table!( { @@ -13,5 +12,4 @@ class AddPollQuestionAnswerTranslations < ActiveRecord::Migration[4.2] def self.down Poll::Question::Answer.drop_translation_table! end - end diff --git a/db/migrate/20180801140800_add_collaborative_legislation_translations.rb b/db/migrate/20180801140800_add_collaborative_legislation_translations.rb index 607801492..50fb8fea4 100644 --- a/db/migrate/20180801140800_add_collaborative_legislation_translations.rb +++ b/db/migrate/20180801140800_add_collaborative_legislation_translations.rb @@ -1,5 +1,4 @@ class AddCollaborativeLegislationTranslations < ActiveRecord::Migration[4.2] - def self.up Legislation::Process.create_translation_table!( { diff --git a/db/migrate/20190104170114_add_active_polls_translations.rb b/db/migrate/20190104170114_add_active_polls_translations.rb index c6158a83e..51f99a0e8 100644 --- a/db/migrate/20190104170114_add_active_polls_translations.rb +++ b/db/migrate/20190104170114_add_active_polls_translations.rb @@ -1,5 +1,4 @@ class AddActivePollsTranslations < ActiveRecord::Migration[4.2] - def self.up ActivePoll.create_translation_table!( { @@ -12,5 +11,4 @@ class AddActivePollsTranslations < ActiveRecord::Migration[4.2] def self.down ActivePollPoll.drop_translation_table! end - end diff --git a/db/migrate/20190118135741_add_budget_translations.rb b/db/migrate/20190118135741_add_budget_translations.rb index 19404d313..a561ebb47 100644 --- a/db/migrate/20190118135741_add_budget_translations.rb +++ b/db/migrate/20190118135741_add_budget_translations.rb @@ -1,5 +1,4 @@ class AddBudgetTranslations < ActiveRecord::Migration[4.2] - def self.up Budget.create_translation_table!( { @@ -12,5 +11,4 @@ class AddBudgetTranslations < ActiveRecord::Migration[4.2] def self.down Budget.drop_translation_table! end - end diff --git a/db/migrate/20190119160418_add_budget_phase_translations.rb b/db/migrate/20190119160418_add_budget_phase_translations.rb index 67e8afdc5..07bbf3c84 100644 --- a/db/migrate/20190119160418_add_budget_phase_translations.rb +++ b/db/migrate/20190119160418_add_budget_phase_translations.rb @@ -1,5 +1,4 @@ class AddBudgetPhaseTranslations < ActiveRecord::Migration[4.2] - def self.up Budget::Phase.create_translation_table!( { @@ -13,5 +12,4 @@ class AddBudgetPhaseTranslations < ActiveRecord::Migration[4.2] def self.down Budget::Phase.drop_translation_table! end - end diff --git a/db/migrate/20190120155819_add_budget_group_translations.rb b/db/migrate/20190120155819_add_budget_group_translations.rb index 869906a35..b7c2e841f 100644 --- a/db/migrate/20190120155819_add_budget_group_translations.rb +++ b/db/migrate/20190120155819_add_budget_group_translations.rb @@ -1,5 +1,4 @@ class AddBudgetGroupTranslations < ActiveRecord::Migration[4.2] - def self.up Budget::Group.create_translation_table!( { @@ -12,5 +11,4 @@ class AddBudgetGroupTranslations < ActiveRecord::Migration[4.2] def self.down Budget::Group.drop_translation_table! end - end diff --git a/db/migrate/20190121171237_add_budget_heading_translations.rb b/db/migrate/20190121171237_add_budget_heading_translations.rb index e0fa70268..f6889422e 100644 --- a/db/migrate/20190121171237_add_budget_heading_translations.rb +++ b/db/migrate/20190121171237_add_budget_heading_translations.rb @@ -1,5 +1,4 @@ class AddBudgetHeadingTranslations < ActiveRecord::Migration[4.2] - def self.up Budget::Heading.create_translation_table!( { @@ -12,5 +11,4 @@ class AddBudgetHeadingTranslations < ActiveRecord::Migration[4.2] def self.down Budget::Heading.drop_translation_table! end - end diff --git a/db/migrate/20190426120406_create_budget_tracker_assignments.rb b/db/migrate/20190426120406_create_budget_tracker_assignments.rb index 6774b3da2..39a2e86d2 100644 --- a/db/migrate/20190426120406_create_budget_tracker_assignments.rb +++ b/db/migrate/20190426120406_create_budget_tracker_assignments.rb @@ -4,7 +4,7 @@ class CreateBudgetTrackerAssignments < ActiveRecord::Migration[5.0] t.references :tracker, foreign_key: true t.integer :investment_id, index: true - t.timestamps null:false + t.timestamps null: false end end end diff --git a/db/migrate/20190513112613_create_votation_types.rb b/db/migrate/20190513112613_create_votation_types.rb index 4ccfa8b55..af527a179 100644 --- a/db/migrate/20190513112613_create_votation_types.rb +++ b/db/migrate/20190513112613_create_votation_types.rb @@ -14,4 +14,3 @@ class CreateVotationTypes < ActiveRecord::Migration[5.0] end end end - diff --git a/db/migrate/20190514153436_add_order_and_positive_in_poll_answers.rb b/db/migrate/20190514153436_add_order_and_positive_in_poll_answers.rb index 10d34e7e9..1b32df8a2 100644 --- a/db/migrate/20190514153436_add_order_and_positive_in_poll_answers.rb +++ b/db/migrate/20190514153436_add_order_and_positive_in_poll_answers.rb @@ -4,4 +4,3 @@ class AddOrderAndPositiveInPollAnswers < ActiveRecord::Migration[5.0] add_column :poll_answers, :order, :integer end end - diff --git a/db/migrate/20190516091051_add_help_link_to_budgets.rb b/db/migrate/20190516091051_add_help_link_to_budgets.rb index a7009cb9c..9a4238093 100644 --- a/db/migrate/20190516091051_add_help_link_to_budgets.rb +++ b/db/migrate/20190516091051_add_help_link_to_budgets.rb @@ -1,7 +1,7 @@ class AddHelpLinkToBudgets < ActiveRecord::Migration[5.0] def change add_column :budgets, :help_link, :string - add_column :budgets, :budget_milestone_tags,:string - add_column :budgets, :budget_valuation_tags,:string + add_column :budgets, :budget_milestone_tags, :string + add_column :budgets, :budget_valuation_tags, :string end end diff --git a/db/migrate/20190522075912_create_poll_pair_answers.rb b/db/migrate/20190522075912_create_poll_pair_answers.rb index d230c7f5b..c38f906ee 100644 --- a/db/migrate/20190522075912_create_poll_pair_answers.rb +++ b/db/migrate/20190522075912_create_poll_pair_answers.rb @@ -10,4 +10,3 @@ class CreatePollPairAnswers < ActiveRecord::Migration[5.0] end end end - diff --git a/db/migrate/20190523113821_add_hidden_field_to_poll_question_answers.rb b/db/migrate/20190523113821_add_hidden_field_to_poll_question_answers.rb index 9c91fd4bc..61a4fb39f 100644 --- a/db/migrate/20190523113821_add_hidden_field_to_poll_question_answers.rb +++ b/db/migrate/20190523113821_add_hidden_field_to_poll_question_answers.rb @@ -3,4 +3,3 @@ class AddHiddenFieldToPollQuestionAnswers < ActiveRecord::Migration[5.0] add_column :poll_question_answers, :hidden, :boolean, default: false end end - diff --git a/db/migrate/20190524121957_add_value_to_poll_answers.rb b/db/migrate/20190524121957_add_value_to_poll_answers.rb index 22a6dcb9b..c3d9c7284 100644 --- a/db/migrate/20190524121957_add_value_to_poll_answers.rb +++ b/db/migrate/20190524121957_add_value_to_poll_answers.rb @@ -3,4 +3,3 @@ class AddValueToPollAnswers < ActiveRecord::Migration[5.0] add_column :poll_answers, :value, :integer end end - diff --git a/db/migrate/20190528134530_create_votation_set_answers.rb b/db/migrate/20190528134530_create_votation_set_answers.rb index 92367e63e..ba94b813b 100644 --- a/db/migrate/20190528134530_create_votation_set_answers.rb +++ b/db/migrate/20190528134530_create_votation_set_answers.rb @@ -9,4 +9,3 @@ class CreateVotationSetAnswers < ActiveRecord::Migration[5.0] end end end -