mercredi 2 décembre 2015

Argument Error in migration in Rails project

I had use sqlite as database for my rails app, then I changed it with Postgresql and after that I started to get an error when I tried to add new migrations.

Error

 $ rake db:migrate
   rake aborted!
   ArgumentError: wrong number of arguments (1 for 4..5)

_create_users.rb

def change
 create_table :users do |t|
  t.string :name
  t.string :email

  t.timestamps null: false
end

_microposts.rb

 def change
create_table :microposts do |t|
  t.text :content
  t.references :user, index: true, foreign_key: true

  t.timestamps null: false
end
add_index :microposts, [:user_id, :created_at]
end

database.yml

 development:
 adapter: postgresql
 encoding: unicode
 database: blog_development
 pool: 5
 username: ******
 password:  

Aucun commentaire:

Enregistrer un commentaire