Rails setups postgresql database without primary key -
i messed around bit database , because screwed things figured start scratch , setup postgresql database again.
rake db:setup rake db:migrate however, got kinds of errors in app. when comparing pg_dump of broken database working 1 still have on heroku, can see biggest differences of id columns don't defined primary key on local database (so not null part missing when defining id column on local database). , there no sequences made these id's on local database
comparing schema.rb on local machine , heroku see difference on local machine column id defined these tables , on heroku not.  example on local machine get
  create_table "pictures", id: false, force: :cascade |t|      t.integer  "id",                 limit: 8     t.datetime "created_at"     t.datetime "updated_at"     t.text     "image"     t.text     "image_content_type"     t.integer  "image_file_size",    limit: 8     t.datetime "image_updated_at"     t.integer  "post_id",            limit: 8   end and on heroku first line t.integer id     limit:8 missing. 
now 2 questions are,
- would difference cause differences in databases?
- if so, why heroku have different schema.rb when both applications have same migrations?
 
 
  
Comments
Post a Comment