Fix false positives for Migration/SchemaAdditionMethodsNoPost cop
We allow `add_column` and `create_table` methods inside the `down` method in post-deploy migrations. But if these methods were wrapped inside a statement like `if` then the cop was raising an error. For example, in the following, the 2nd example was being incorrectly flagged as an offense: ``` def down add_column(:table, :column) end ``` ``` def down add_column(:table, :column) unless column_exists(:table, :column) end ```
显示
- db/post_migrate/20221027203951_drop_experiment_users_table.rb 1 个添加, 1 个删除...ost_migrate/20221027203951_drop_experiment_users_table.rb
- db/post_migrate/20221114142602_drop_experiment_subjects_table.rb 1 个添加, 1 个删除..._migrate/20221114142602_drop_experiment_subjects_table.rb
- db/post_migrate/20221114142616_drop_experiments_table.rb 1 个添加, 1 个删除db/post_migrate/20221114142616_drop_experiments_table.rb
- db/post_migrate/20221115184525_remove_namespaces_tmp_project_id_column.rb 2 个添加, 2 个删除...20221115184525_remove_namespaces_tmp_project_id_column.rb
- db/post_migrate/20230104103748_remove_new_amount_used_column.rb 2 个添加, 2 个删除...t_migrate/20230104103748_remove_new_amount_used_column.rb
- db/post_migrate/20230105180002_remove_new_amount_used_column_on_ci_namespace_monthly_usages.rb 2 个添加, 2 个删除..._new_amount_used_column_on_ci_namespace_monthly_usages.rb
- db/post_migrate/20230201082038_drop_web_hook_calls_high_column.rb 0 个添加, 2 个删除...migrate/20230201082038_drop_web_hook_calls_high_column.rb
- db/post_migrate/20230316185746_drop_packages_events_table.rb 1 个添加, 1 个删除db/post_migrate/20230316185746_drop_packages_events_table.rb
- db/post_migrate/20230323131521_remove_machine_id_from_builds_metadata.rb 1 个添加, 1 个删除.../20230323131521_remove_machine_id_from_builds_metadata.rb
- db/post_migrate/20230425114355_remove_application_settings_clickhouse_connection_string.rb 0 个添加, 2 个删除...move_application_settings_clickhouse_connection_string.rb
- db/post_migrate/20230501180958_drop_clusters_applications_cert_managers.rb 0 个添加, 2 个删除...0230501180958_drop_clusters_applications_cert_managers.rb
- db/post_migrate/20230502134532_drop_clusters_applications_cilium.rb 0 个添加, 2 个删除...grate/20230502134532_drop_clusters_applications_cilium.rb
- db/post_migrate/20230502182754_drop_clusters_applications_crossplane.rb 0 个添加, 2 个删除...e/20230502182754_drop_clusters_applications_crossplane.rb
- db/post_migrate/20230502193525_drop_clusters_applications_helm.rb 0 个添加, 2 个删除...migrate/20230502193525_drop_clusters_applications_helm.rb
- db/post_migrate/20230502201251_drop_clusters_applications_ingress.rb 0 个添加, 2 个删除...rate/20230502201251_drop_clusters_applications_ingress.rb
- db/post_migrate/20230503115918_drop_clusters_applications_jupyter.rb 0 个添加, 2 个删除...rate/20230503115918_drop_clusters_applications_jupyter.rb
- db/post_migrate/20230503152349_drop_clusters_applications_knative.rb 0 个添加, 2 个删除...rate/20230503152349_drop_clusters_applications_knative.rb
- db/post_migrate/20230503173101_drop_clusters_applications_prometheus.rb 0 个添加, 2 个删除...e/20230503173101_drop_clusters_applications_prometheus.rb
- db/post_migrate/20230503175406_drop_clusters_applications_runners.rb 0 个添加, 2 个删除...rate/20230503175406_drop_clusters_applications_runners.rb
- db/post_migrate/20230503181808_drop_serverless_domain_cluster.rb 0 个添加, 2 个删除..._migrate/20230503181808_drop_serverless_domain_cluster.rb
加载中
想要评论请 注册 或 登录