i have a migration but after running it (rake db:migrate),it created
a table "posts" but couldn't create columns.
class CreatePosts < ActiveRecord::Migration
def self.up
create_table :posts do |t|
t.string :name
t.string :title
t.text :content
t.timestamps
end
end
def self.down
drop_table :posts
end
end
What was the output when you ran the migration? Are you sure that the
table did not already exist when you ran the migration, so that it
failed because it could not create the table?
If this is a new database, so there are no other tables in it then I
suggest you delete the whole database, recreate the database (with no
tables) and run the migration again. Note carefully what it says when
you run the migration.