Show More
Commit Description:
added quick new problem...
Commit Description:
added quick new problem
git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@369 6386c4cd-e34a-4fa8-8920-d93eb39b512e
References:
File last commit:
Show/Diff file:
Action:
db/migrate/015_add_status_to_tasks.rb
| 17 lines
| 376 B
| text/x-ruby
| RubyLexer
|
|
r30 | class AddStatusToTasks < ActiveRecord::Migration | ||
def self.up | ||||
add_column :tasks, :status, :integer | ||||
add_column :tasks, :updated_at, :datetime | ||||
Task.reset_column_information | ||||
Task.find(:all).each do |task| | ||||
task.status_complete | ||||
task.save | ||||
end | ||||
end | ||||
def self.down | ||||
remove_column :tasks, :updated_at | ||||
remove_column :tasks, :status | ||||
end | ||||
end | ||||