Sha256: fa59a846b4720c2915a920eb9e26d579489a903e366f3164b9b46d78d580299f

Contents?: true

Size: 373 Bytes

Versions: 8

Compression:

Stored size: 373 Bytes

Contents

Sequel.migration do
  up do
    [:resources, :resources_versions].each do |name|
      alter_table(name) { add_column(:primary_key_type, String) }
      self[name].update(:primary_key_type => 'integer')
    end
  end

  down do
    alter_table(:resources) { drop_column(:primary_key_type) }
    alter_table(:resources_versions) { drop_column(:primary_key_type) }
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
coupler-0.0.9-java db/migrate/011_add_primary_key_type.rb
coupler-0.0.8-java db/migrate/011_add_primary_key_type.rb
coupler-0.0.7-java db/migrate/011_add_primary_key_type.rb
coupler-0.0.6-java db/migrate/011_add_primary_key_type.rb
coupler-0.0.4-java db/migrate/011_add_primary_key_type.rb
coupler-0.0.3-java db/migrate/011_add_primary_key_type.rb
coupler-0.0.2-java db/migrate/011_add_primary_key_type.rb
coupler-0.0.1-java db/migrate/011_add_primary_key_type.rb