2012-03-29 20:00:44 +01:00
|
|
|
class DeleteCategories < ActiveRecord::Migration
|
|
|
|
def self.up
|
|
|
|
remove_column :projects, :category_id
|
|
|
|
drop_table :categories
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.down
|
2014-01-21 04:51:49 +00:00
|
|
|
create_table :categories, force: true do |t|
|
2012-03-29 20:00:44 +01:00
|
|
|
t.string "name"
|
|
|
|
t.string "ancestry"
|
2014-01-21 04:51:49 +00:00
|
|
|
t.integer "projects_count", default: 0, null: false
|
2012-03-29 20:00:44 +01:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
|
|
|
end
|
|
|
|
add_column :projects, :category_id, :integer
|
|
|
|
end
|
2012-03-29 22:24:57 +01:00
|
|
|
end
|