Sha256: 31c7e1f503409bfcea98b86d163ab6a450bfa8e73effc91ad6686080bef959cf

Contents?: true

Size: 657 Bytes

Versions: 33

Compression:

Stored size: 657 Bytes

Contents

class BricksMergerModel < ActiveRecord::Base
  set_table_name Zena::Migrator.old_bricks_info_table_name
end

class MergeBricksMigrationsWithStdMigrations < ActiveRecord::Migration
  def self.up
    if ActiveRecord::Base.connection.tables.include?(Zena::Migrator.old_bricks_info_table_name)
      # merge content from 'bricks_info' in
      schema_table_name = ActiveRecord::Migrator.schema_migrations_table_name
      BricksMergerModel.find(:all).each do |r|
        execute "INSERT INTO #{schema_table_name} (brick,version) VALUES (#{r.brick.inspect}, #{r.version.inspect})"
      end
      drop_table :bricks_info
    end
  end

  def self.down
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
zena-1.2.8 db/fix/old_migrations/20090825201200_merge_bricks_migrations_with_std_migrations.rb
zena-1.2.7 db/fix/old_migrations/20090825201200_merge_bricks_migrations_with_std_migrations.rb
zena-1.2.6 db/fix/old_migrations/20090825201200_merge_bricks_migrations_with_std_migrations.rb
zena-1.2.5 db/fix/old_migrations/20090825201200_merge_bricks_migrations_with_std_migrations.rb
zena-1.2.4 db/fix/old_migrations/20090825201200_merge_bricks_migrations_with_std_migrations.rb
zena-1.2.3 db/fix/old_migrations/20090825201200_merge_bricks_migrations_with_std_migrations.rb
zena-1.2.2 db/fix/old_migrations/20090825201200_merge_bricks_migrations_with_std_migrations.rb
zena-1.2.1 db/fix/old_migrations/20090825201200_merge_bricks_migrations_with_std_migrations.rb
zena-1.2.0 db/fix/old_migrations/20090825201200_merge_bricks_migrations_with_std_migrations.rb
zena-1.1.3 db/fix/old_migrations/20090825201200_merge_bricks_migrations_with_std_migrations.rb
zena-1.1.2 db/fix/old_migrations/20090825201200_merge_bricks_migrations_with_std_migrations.rb
zena-1.1.1 db/fix/old_migrations/20090825201200_merge_bricks_migrations_with_std_migrations.rb
zena-1.1.0 db/fix/old_migrations/20090825201200_merge_bricks_migrations_with_std_migrations.rb
zena-1.0.0 db/fix/old_migrations/20090825201200_merge_bricks_migrations_with_std_migrations.rb
zena-1.0.0.rc3 db/fix/old_migrations/20090825201200_merge_bricks_migrations_with_std_migrations.rb
zena-1.0.0.rc2 db/fix/old_migrations/20090825201200_merge_bricks_migrations_with_std_migrations.rb
zena-1.0.0.rc1 db/fix/old_migrations/20090825201200_merge_bricks_migrations_with_std_migrations.rb
zena-0.16.9 db/migrate/20090825201200_merge_bricks_migrations_with_std_migrations.rb
zena-1.0.0.beta3 db/migrate/20090825201200_merge_bricks_migrations_with_std_migrations.rb
zena-0.16.8 db/migrate/20090825201200_merge_bricks_migrations_with_std_migrations.rb