Sha256: 186d27f48ff1af3829ee8f389c1569e9d62b2af204ef872e5de5b449fd2f2012

Contents?: true

Size: 376 Bytes

Versions: 8

Compression:

Stored size: 376 Bytes

Contents

class FixProjectsStates < ActiveRecord::Migration
  def up
    execute "
    UPDATE projects SET state = 'waiting_funds' WHERE state IN ('successful', 'online') AND current_timestamp BETWEEN expires_at and expires_at + '4 day'::interval;
    UPDATE projects SET state = 'online' WHERE state = 'successful' AND current_timestamp < expires_at;
    "
  end

  def down
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
catarse_full-0.1.0 db/migrate/20130121204224_fix_projects_states.rb
catarse_full-0.0.6 db/migrate/20130121204224_fix_projects_states.rb
catarse_full-0.0.5 db/migrate/20130121204224_fix_projects_states.rb
catarse_full-0.0.4 db/migrate/20130121204224_fix_projects_states.rb
catarse_full-0.0.3 db/migrate/20130121204224_fix_projects_states.rb
catarse_full-0.0.2 db/migrate/20130121204224_fix_projects_states.rb
catarse_full-0.0.1 db/migrate/20130121204224_fix_projects_states.rb
catarse_core-1.0.0.beta db/migrate/20130121204224_fix_projects_states.rb