Sha256: 62247469dfac7e9fa5d3229db05eae03baed75ce9b8768d11254495d9ac27608

Contents?: true

Size: 492 Bytes

Versions: 10

Compression:

Stored size: 492 Bytes

Contents

class PreventHstoreFieldsFromBeingNull < ActiveRecord::Migration
  FIELDS = [
    [:projects,   :extended_attributes],
    [:projects,   :view_options],
    [:projects,   :feature_states],
    [:users,      :view_options]
  ]

  def up
    FIELDS.each do |(table, column)|
      change_column table, column, :hstore, null: false, default: ''
    end
  end

  def down
    FIELDS.each do |(table, column)|
      change_column table, column, :hstore, null: true, default: nil
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
houston-core-0.9.2 db/migrate/20140517012626_prevent_hstore_fields_from_being_null.rb
houston-core-0.9.1 db/migrate/20140517012626_prevent_hstore_fields_from_being_null.rb
houston-core-0.9.0 db/migrate/20140517012626_prevent_hstore_fields_from_being_null.rb
houston-core-0.9.0.rc1 db/migrate/20140517012626_prevent_hstore_fields_from_being_null.rb
houston-core-0.8.4 db/migrate/20140517012626_prevent_hstore_fields_from_being_null.rb
houston-core-0.8.3 db/migrate/20140517012626_prevent_hstore_fields_from_being_null.rb
houston-core-0.8.2 db/migrate/20140517012626_prevent_hstore_fields_from_being_null.rb
houston-core-0.8.1 db/migrate/20140517012626_prevent_hstore_fields_from_being_null.rb
houston-core-0.8.0 db/migrate/20140517012626_prevent_hstore_fields_from_being_null.rb
houston-core-0.8.0.pre2 db/migrate/20140517012626_prevent_hstore_fields_from_being_null.rb