I created a versionable table and the initial migration worked correctly. I then tried to rename a column on the versionable
table. It did not seem to work work. I thought it was going to work automactially. There may be a command to do
it but I did not see it in the documentation.
**********migration 1*********
class Bugs < ActiveRecord::Migration
def self.up
create_table :apps do |t|
t.column "owner_id", :integer
t.column "name", :string, :limit => 30
t.column "short_name", :string, :limit =>15
t.column "description", :text
end
create_table :bugs do |table|
table.column "app_id", :integer
table.column "company_id", :integer
table.column "module", :string
table.column "summary", :string, :limit => 50
table.column "detail", :text
table.column "report_by", :string
table.column "priority", :string
table.column "severity", :string, :limit =>5
table.column "status", :string
table.column "reported_at", :datetime
table.column "updated_at", :datetime
table.column "closed_at", :datetime
end
Bug.create_versioned_table
end
def self.down
drop_table :bugs
Bug.drop_versioned_table
end
end
***********************migration 2************
class A < ActiveRecord::Migration
def self.up
rename_column("bugs", "module", "subsystem")
end
def self.down
end
end
|