Sha256: 3c412706016e18ff0bf236019418149f649267bad6d7d17ef754c3cba1d58fbe

Contents?: true

Size: 410 Bytes

Versions: 3

Compression:

Stored size: 410 Bytes

Contents

class MigrateItemTypesInVersions < ActiveRecord::Migration
  def up
    execute <<-SQL
      UPDATE versions
      SET item_type = 'Peoplefinder::' || item_type
      WHERE item_type NOT LIKE 'Peoplefinder::%';
    SQL
  end

  def down
    execute <<-SQL
      UPDATE versions
      SET item_type = split_part(item_type, '::', 2)
      WHERE split_part(item_type, '::', 1) = 'Peoplefinder';
    SQL
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
peoplefinder-0.1.1 db/migrate/20141010090624_migrate_item_types_in_versions.rb
peoplefinder-0.1.0 db/migrate/20141010090624_migrate_item_types_in_versions.rb
peoplefinder-0.0.2 db/migrate/20141010090624_migrate_item_types_in_versions.rb