diff options
Diffstat (limited to 'db/migrate')
| -rw-r--r-- | db/migrate/20180202170009_set_stop_areas_kind_to_commercial_on_existing_records.rb | 11 | 
1 files changed, 11 insertions, 0 deletions
| diff --git a/db/migrate/20180202170009_set_stop_areas_kind_to_commercial_on_existing_records.rb b/db/migrate/20180202170009_set_stop_areas_kind_to_commercial_on_existing_records.rb new file mode 100644 index 000000000..6c6f6370e --- /dev/null +++ b/db/migrate/20180202170009_set_stop_areas_kind_to_commercial_on_existing_records.rb @@ -0,0 +1,11 @@ +class SetStopAreasKindToCommercialOnExistingRecords < ActiveRecord::Migration +  def up +    Chouette::StopArea +      .where('kind != ? or kind is null', :non_commercial) +      .update_all(kind: :commercial) +  end + +  def down +    raise ActiveRecord::IrreversibleMigration +  end +end | 
