0.0
No commit activity in last 3 years
No release in over 3 years
[description]
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

data_migrations Build Status

class CreateBuilds < ActiveRecord::Migration
  def self.up
    create_table :tests do |t|
      # ...
    end

    migrate_table :builds, :to => :tests |t|
      t.where 'parent_id IS NULL'
      t.move :number
      t.copy :parent_id, :to => :build_id
      t.copy :commit, :result, :to => [:hash, :status]
      t.copy :all

      # t.copy :all, :except => :foo
      # t.exec 'UPDATE foo ...'
      # t.set :source, 'github'
    end
  end

  def self.down
    # revert the whole thing. not sure we can derive this automatically?

    migrate_table :builds, :to => :tests |t|
      t.move :number
      t.copy :build_id, :to => :parent_id
      t.copy :hash, :status, :to => [:commit, :result]
    end

    drop_table :tests
  end
end