DEV: Restore default_list_filter column migration

DEV: Restore default_list_filter column migration

This migration was added to master temporarily, then removed. This resulted in some sites being in an inconsistent state. Adding the migration back for now. If we decide the column is unneeded, then we should add a second migration to remove the column.

This reverts part of commit e1af91f5aeaf5d19837544adab416b6ae3559e0f.

diff --git a/db/migrate/20200524181959_add_default_list_filter_to_categories.rb b/db/migrate/20200524181959_add_default_list_filter_to_categories.rb
new file mode 100644
index 0000000..4c43b5c
--- /dev/null
+++ b/db/migrate/20200524181959_add_default_list_filter_to_categories.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class AddDefaultListFilterToCategories < ActiveRecord::Migration[6.0]
+  def change
+    add_column :categories, :default_list_filter, :string, limit: 20, default: 'all'
+  end
+end

GitHub sha: 7b9d2071

1 Like

@tshenry reported some backup/restore issues because this migration was added to master, then removed. Some sites have run the migration already, so reverting caused an inconsistent state.

@vinothkannans not sure if we should keep this column, or add another migration to remove it?

1 Like

Oh, my bad! We can keep the column.