Sha256: de1aa16911388317ce221adbbeadbaef6b53c06773982f83b02abac62f929705

Contents?: true

Size: 683 Bytes

Versions: 7

Compression:

Stored size: 683 Bytes

Contents

# frozen_string_literal: true

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

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

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

    if column_exists?(:us_geo_zcta_counties, :housing_units)
      change_column_null :us_geo_zcta_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/20220722000000_allow_null_zcta_counties_demographics.rb
us_geo-2.1.0 db/migrate/20220722000000_allow_null_zcta_counties_demographics.rb
us_geo-2.0.4 db/migrate/20220722000000_allow_null_zcta_counties_demographics.rb
us_geo-2.0.3 db/migrate/20220722000000_allow_null_zcta_counties_demographics.rb
us_geo-2.0.2 db/migrate/20220722000000_allow_null_zcta_counties_demographics.rb
us_geo-2.0.1 db/migrate/20220722000000_allow_null_zcta_counties_demographics.rb
us_geo-2.0.0 db/migrate/20220722000000_allow_null_zcta_counties_demographics.rb