Mercurial > hg > soundsoftware-site
view db/migrate/019_add_issue_status_position.rb @ 1600:ed9c467ef922 dockerise
Add hggit extension
author | Chris Cannam |
---|---|
date | Wed, 23 Aug 2017 11:32:50 +0100 |
parents | 261b3d9a4903 |
children |
line wrap: on
line source
class AddIssueStatusPosition < ActiveRecord::Migration def self.up add_column :issue_statuses, :position, :integer, :default => 1 IssueStatus.all.each_with_index {|status, i| status.update_attribute(:position, i+1)} end def self.down remove_column :issue_statuses, :position end end