summaryrefslogtreecommitdiff
path: root/lib/tasks
diff options
context:
space:
mode:
authorPeter Leitzen <pleitzen@gitlab.com>2019-09-11 16:23:42 +0000
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2019-09-11 16:23:42 +0000
commit50c647af51ae733abb96b84a5169d40b3c8c59be (patch)
tree13e059a9af8ddad9d1c5d8e312be17629367c9cb /lib/tasks
parent0abc902576a755355b1daf75e19d1f37c6ffb5ff (diff)
downloadgitlab-ce-50c647af51ae733abb96b84a5169d40b3c8c59be.tar.gz
Add rake task `db:obsolete_ignored_columns`
Show a list of obsolete `ignored_columns`
Diffstat (limited to 'lib/tasks')
-rw-r--r--lib/tasks/db_obsolete_ignored_columns.rake21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/tasks/db_obsolete_ignored_columns.rake b/lib/tasks/db_obsolete_ignored_columns.rake
new file mode 100644
index 00000000000..184e407f28c
--- /dev/null
+++ b/lib/tasks/db_obsolete_ignored_columns.rake
@@ -0,0 +1,21 @@
+desc 'Show a list of obsolete `ignored_columns`'
+task 'db:obsolete_ignored_columns' => :environment do
+ list = Gitlab::Database::ObsoleteIgnoredColumns.new.execute
+
+ if list.empty?
+ puts 'No obsolete `ignored_columns` found.'
+ else
+ puts 'The following `ignored_columns` are obsolete and can be removed:'
+
+ list.each do |name, ignored_columns|
+ puts "- #{name}: #{ignored_columns.join(', ')}"
+ end
+
+ puts <<~TEXT
+
+ WARNING: Removing columns is tricky because running GitLab processes may still be using the columns.
+
+ See also https://docs.gitlab.com/ee/development/what_requires_downtime.html#dropping-columns
+ TEXT
+ end
+end