class CreateDunlopUserFilters < ActiveRecord::Migration[5.2]
  def change
    create_table :dunlop_user_filters do |t|
      t.belongs_to :user
      t.string :scope_key
      t.text :description
      t.boolean :is_default, null: false, default: false
      if Rails.application.config.database_configuration[Rails.env]['adapter'] == 'postgesql'
        t.jsonb :filters, default: {}
      else
        t.text :filters
      end
      t.timestamps
    end
  end
end
