Sha256: cd682be60fd5af587b2c9330d8d2017c49e6f9ab7ea2f9a3624b629161d54b31

Contents?: true

Size: 736 Bytes

Versions: 7

Compression:

Stored size: 736 Bytes

Contents

# frozen_string_literal: true

class AllowNullUrbanAreaCountiesDemographics < ActiveRecord::Migration[5.0]
  def up
    if column_exists?(:us_geo_urban_area_counties, :population)
      change_column_null :us_geo_urban_area_counties, :population, true
    end

    if column_exists?(:us_geo_urban_area_counties, :housing_units)
      change_column_null :us_geo_urban_area_counties, :housing_units, true
    end
  end

  def down
    if column_exists?(:us_geo_urban_area_counties, :population)
      change_column_null :us_geo_urban_area_counties, :population, false
    end

    if column_exists?(:us_geo_urban_area_counties, :housing_units)
      change_column_null :us_geo_urban_area_counties, :housing_units, false
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
us_geo-2.1.1 db/migrate/20230417000400_allow_null_urban_area_counties_demographics.rb
us_geo-2.1.0 db/migrate/20230417000400_allow_null_urban_area_counties_demographics.rb
us_geo-2.0.4 db/migrate/20230417000400_allow_null_urban_area_counties_demographics.rb
us_geo-2.0.3 db/migrate/20230417000400_allow_null_urban_area_counties_demographics.rb
us_geo-2.0.2 db/migrate/20230417000400_allow_null_urban_area_counties_demographics.rb
us_geo-2.0.1 db/migrate/20230417000400_allow_null_urban_area_counties_demographics.rb
us_geo-2.0.0 db/migrate/20230417000400_allow_null_urban_area_counties_demographics.rb