I am trying to add one column in one table using migration up. I have created migration for that and ran rake db:migrate:up[version]
it added the column in my table but I don't see that attribute in my respective model. Am I missing something here to do? Below is my snippet ...
migration 6, :add_role_users do
up do
execute <<-SQL
ALTER TABLE users
ADD COLUMN role varchar(32) DEFAULT NULL
SQL
end
down do
execute <<-SQL
ALTER TABLE users
DROP COLUMN role
SQL
end
end
After running the above migration I don't see below line in my User model
property :role, , String, :length => 32
Please suggest, I am using Rails 3.0 so I can't use migration Change method.