{"action":"created","comment":{"url":"https://api.github.com/repos/Ada-C4/FarMarRails/pulls/comments/46321491","id":46321491,"diff_hunk":"@@ -3,5 +3,21 @@\n #\n # Examples:\n #\n-#   cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])\n-#   Mayor.create(name: 'Emanuel', city: cities.first)\n+#  cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])\n+#  Mayor.create(name: 'Emanuel', city: cities.first)\n+\n+CSV.read(\"./seed_csvs/markets.csv\").map do |row|\n+  Market.create(id: row[0], name: row[1], address: row[2], city: row[3], county: row[4], state: row[5], zip: row[6])\n+end\n+\n+CSV.read(\"./seed_csvs/vendors.csv\").map do |row|\n+  Vendor.create(id: row[0], name: row[1], num_employees:row[2], market_id:row[3])\n+end\n+\n+CSV.read(\"./seed_csvs/products.csv\").map do |row|\n+  Product.create(id: row[0], name: row[1], vendor_id:row[2])\n+end\n+\n+CSV.read(\"./seed_csvs/sales.csv\").map do |row|\n+  Sale.create(id: row[0], amount: row[1], purchase_time:row[2].to_datetime, vendor_id: row[3], product_id: row[4])\n+end","path":"db/seeds.rb","position":23,"original_position":23,"commit_id":"056e0e70d6a5e1edf7f50c717687043e5f4057ce","original_commit_id":"056e0e70d6a5e1edf7f50c717687043e5f4057ce","user":{"login":"Hamled","id":66355,"avatar_url":"https://avatars.githubusercontent.com/u/66355?v=3","gravatar_id":"","url":"https://api.github.com/users/Hamled","html_url":"https://github.com/Hamled","followers_url":"https://api.github.com/users/Hamled/followers","following_url":"https://api.github.com/users/Hamled/following{/other_user}","gists_url":"https://api.github.com/users/Hamled/gists{/gist_id}","starred_url":"https://api.github.com/users/Hamled/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hamled/subscriptions","organizations_url":"https://api.github.com/users/Hamled/orgs","repos_url":"https://api.github.com/users/Hamled/repos","events_url":"https://api.github.com/users/Hamled/events{/privacy}","received_events_url":"https://api.github.com/users/Hamled/received_events","type":"User","site_admin":false},"body":"Have you tried creating new instances of your model classes after pushing this to Heroku? I know some people had issues with that related to the way the DB was seeded.\r\n\r\nWhen you do, for example `Market.create(id: NUMBER, ...)`, SQLite knows that the next time we call `Market.create` without specifying and ID, it will assign a new ID that is greater than any of the IDs already in the database. However, Postgres is not quite so accommodating.\r\n\r\nFor Postgres you need to explicitly say what the next ID should be, otherwise it will try to give you and ID of 1 when you call `Market.create`, even though we already seeded a Market with that ID. If you have any trouble creating new markets or products, etc. on Heroku, I would recommend adding this to the end of your `seeds.rb` file:\r\n```ruby\r\nbegin\r\n  con = PG::Connection\r\n  Market.connection.execute('SELECT setval(\\'markets_id_seq\\'::regclass, (SELECT MAX(id) FROM markets))')\r\n  Vendor.connection.execute('SELECT setval(\\'vendors_id_seq\\'::regclass, (SELECT MAX(id) FROM vendors))')\r\n  Product.connection.execute('SELECT setval(\\'products_id_seq\\'::regclass, (SELECT MAX(id) FROM products))')\r\n  Sale.connection.execute('SELECT setval(\\'sales_id_seq\\'::regclass, (SELECT MAX(id) FROM sales))')\r\nrescue NameError\r\nend\r\n```","created_at":"2015-12-01T18:57:59Z","updated_at":"2015-12-01T18:57:59Z","html_url":"https://github.com/Ada-C4/FarMarRails/pull/15#discussion_r46321491","pull_request_url":"https://api.github.com/repos/Ada-C4/FarMarRails/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/Ada-C4/FarMarRails/pulls/comments/46321491"},"html":{"href":"https://github.com/Ada-C4/FarMarRails/pull/15#discussion_r46321491"},"pull_request":{"href":"https://api.github.com/repos/Ada-C4/FarMarRails/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/Ada-C4/FarMarRails/pulls/15","id":51422532,"html_url":"https://github.com/Ada-C4/FarMarRails/pull/15","diff_url":"https://github.com/Ada-C4/FarMarRails/pull/15.diff","patch_url":"https://github.com/Ada-C4/FarMarRails/pull/15.patch","issue_url":"https://api.github.com/repos/Ada-C4/FarMarRails/issues/15","number":15,"state":"open","locked":false,"title":"Kdlg/master","user":{"login":"lgranger","id":13182238,"avatar_url":"https://avatars.githubusercontent.com/u/13182238?v=3","gravatar_id":"","url":"https://api.github.com/users/lgranger","html_url":"https://github.com/lgranger","followers_url":"https://api.github.com/users/lgranger/followers","following_url":"https://api.github.com/users/lgranger/following{/other_user}","gists_url":"https://api.github.com/users/lgranger/gists{/gist_id}","starred_url":"https://api.github.com/users/lgranger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lgranger/subscriptions","organizations_url":"https://api.github.com/users/lgranger/orgs","repos_url":"https://api.github.com/users/lgranger/repos","events_url":"https://api.github.com/users/lgranger/events{/privacy}","received_events_url":"https://api.github.com/users/lgranger/received_events","type":"User","site_admin":false},"body":"http://kdlg-farmar-rails.herokuapp.com/","created_at":"2015-11-20T23:35:01Z","updated_at":"2015-12-01T18:57:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0b3b99b7b7fad02c6dd3bec50aa300e1314746bc","assignee":{"login":"Hamled","id":66355,"avatar_url":"https://avatars.githubusercontent.com/u/66355?v=3","gravatar_id":"","url":"https://api.github.com/users/Hamled","html_url":"https://github.com/Hamled","followers_url":"https://api.github.com/users/Hamled/followers","following_url":"https://api.github.com/users/Hamled/following{/other_user}","gists_url":"https://api.github.com/users/Hamled/gists{/gist_id}","starred_url":"https://api.github.com/users/Hamled/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hamled/subscriptions","organizations_url":"https://api.github.com/users/Hamled/orgs","repos_url":"https://api.github.com/users/Hamled/repos","events_url":"https://api.github.com/users/Hamled/events{/privacy}","received_events_url":"https://api.github.com/users/Hamled/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/Ada-C4/FarMarRails/pulls/15/commits","review_comments_url":"https://api.github.com/repos/Ada-C4/FarMarRails/pulls/15/comments","review_comment_url":"https://api.github.com/repos/Ada-C4/FarMarRails/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Ada-C4/FarMarRails/issues/15/comments","statuses_url":"https://api.github.com/repos/Ada-C4/FarMarRails/statuses/056e0e70d6a5e1edf7f50c717687043e5f4057ce","head":{"label":"lgranger:kdlg/master","ref":"kdlg/master","sha":"056e0e70d6a5e1edf7f50c717687043e5f4057ce","user":{"login":"lgranger","id":13182238,"avatar_url":"https://avatars.githubusercontent.com/u/13182238?v=3","gravatar_id":"","url":"https://api.github.com/users/lgranger","html_url":"https://github.com/lgranger","followers_url":"https://api.github.com/users/lgranger/followers","following_url":"https://api.github.com/users/lgranger/following{/other_user}","gists_url":"https://api.github.com/users/lgranger/gists{/gist_id}","starred_url":"https://api.github.com/users/lgranger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lgranger/subscriptions","organizations_url":"https://api.github.com/users/lgranger/orgs","repos_url":"https://api.github.com/users/lgranger/repos","events_url":"https://api.github.com/users/lgranger/events{/privacy}","received_events_url":"https://api.github.com/users/lgranger/received_events","type":"User","site_admin":false},"repo":{"id":46382956,"name":"FarMarRails","full_name":"lgranger/FarMarRails","owner":{"login":"lgranger","id":13182238,"avatar_url":"https://avatars.githubusercontent.com/u/13182238?v=3","gravatar_id":"","url":"https://api.github.com/users/lgranger","html_url":"https://github.com/lgranger","followers_url":"https://api.github.com/users/lgranger/followers","following_url":"https://api.github.com/users/lgranger/following{/other_user}","gists_url":"https://api.github.com/users/lgranger/gists{/gist_id}","starred_url":"https://api.github.com/users/lgranger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lgranger/subscriptions","organizations_url":"https://api.github.com/users/lgranger/orgs","repos_url":"https://api.github.com/users/lgranger/repos","events_url":"https://api.github.com/users/lgranger/events{/privacy}","received_events_url":"https://api.github.com/users/lgranger/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lgranger/FarMarRails","description":"","fork":true,"url":"https://api.github.com/repos/lgranger/FarMarRails","forks_url":"https://api.github.com/repos/lgranger/FarMarRails/forks","keys_url":"https://api.github.com/repos/lgranger/FarMarRails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lgranger/FarMarRails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lgranger/FarMarRails/teams","hooks_url":"https://api.github.com/repos/lgranger/FarMarRails/hooks","issue_events_url":"https://api.github.com/repos/lgranger/FarMarRails/issues/events{/number}","events_url":"https://api.github.com/repos/lgranger/FarMarRails/events","assignees_url":"https://api.github.com/repos/lgranger/FarMarRails/assignees{/user}","branches_url":"https://api.github.com/repos/lgranger/FarMarRails/branches{/branch}","tags_url":"https://api.github.com/repos/lgranger/FarMarRails/tags","blobs_url":"https://api.github.com/repos/lgranger/FarMarRails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lgranger/FarMarRails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lgranger/FarMarRails/git/refs{/sha}","trees_url":"https://api.github.com/repos/lgranger/FarMarRails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lgranger/FarMarRails/statuses/{sha}","languages_url":"https://api.github.com/repos/lgranger/FarMarRails/languages","stargazers_url":"https://api.github.com/repos/lgranger/FarMarRails/stargazers","contributors_url":"https://api.github.com/repos/lgranger/FarMarRails/contributors","subscribers_url":"https://api.github.com/repos/lgranger/FarMarRails/subscribers","subscription_url":"https://api.github.com/repos/lgranger/FarMarRails/subscription","commits_url":"https://api.github.com/repos/lgranger/FarMarRails/commits{/sha}","git_commits_url":"https://api.github.com/repos/lgranger/FarMarRails/git/commits{/sha}","comments_url":"https://api.github.com/repos/lgranger/FarMarRails/comments{/number}","issue_comment_url":"https://api.github.com/repos/lgranger/FarMarRails/issues/comments{/number}","contents_url":"https://api.github.com/repos/lgranger/FarMarRails/contents/{+path}","compare_url":"https://api.github.com/repos/lgranger/FarMarRails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lgranger/FarMarRails/merges","archive_url":"https://api.github.com/repos/lgranger/FarMarRails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lgranger/FarMarRails/downloads","issues_url":"https://api.github.com/repos/lgranger/FarMarRails/issues{/number}","pulls_url":"https://api.github.com/repos/lgranger/FarMarRails/pulls{/number}","milestones_url":"https://api.github.com/repos/lgranger/FarMarRails/milestones{/number}","notifications_url":"https://api.github.com/repos/lgranger/FarMarRails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lgranger/FarMarRails/labels{/name}","releases_url":"https://api.github.com/repos/lgranger/FarMarRails/releases{/id}","created_at":"2015-11-17T23:48:14Z","updated_at":"2015-11-10T20:54:30Z","pushed_at":"2015-11-20T20:30:21Z","git_url":"git://github.com/lgranger/FarMarRails.git","ssh_url":"git@github.com:lgranger/FarMarRails.git","clone_url":"https://github.com/lgranger/FarMarRails.git","svn_url":"https://github.com/lgranger/FarMarRails","homepage":null,"size":1920,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Ada-C4:kdlg/master","ref":"kdlg/master","sha":"04161f114bf8b6fabcde329a22cb901bbc21473b","user":{"login":"Ada-C4","id":14096372,"avatar_url":"https://avatars.githubusercontent.com/u/14096372?v=3","gravatar_id":"","url":"https://api.github.com/users/Ada-C4","html_url":"https://github.com/Ada-C4","followers_url":"https://api.github.com/users/Ada-C4/followers","following_url":"https://api.github.com/users/Ada-C4/following{/other_user}","gists_url":"https://api.github.com/users/Ada-C4/gists{/gist_id}","starred_url":"https://api.github.com/users/Ada-C4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ada-C4/subscriptions","organizations_url":"https://api.github.com/users/Ada-C4/orgs","repos_url":"https://api.github.com/users/Ada-C4/repos","events_url":"https://api.github.com/users/Ada-C4/events{/privacy}","received_events_url":"https://api.github.com/users/Ada-C4/received_events","type":"Organization","site_admin":false},"repo":{"id":46368225,"name":"FarMarRails","full_name":"Ada-C4/FarMarRails","owner":{"login":"Ada-C4","id":14096372,"avatar_url":"https://avatars.githubusercontent.com/u/14096372?v=3","gravatar_id":"","url":"https://api.github.com/users/Ada-C4","html_url":"https://github.com/Ada-C4","followers_url":"https://api.github.com/users/Ada-C4/followers","following_url":"https://api.github.com/users/Ada-C4/following{/other_user}","gists_url":"https://api.github.com/users/Ada-C4/gists{/gist_id}","starred_url":"https://api.github.com/users/Ada-C4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ada-C4/subscriptions","organizations_url":"https://api.github.com/users/Ada-C4/orgs","repos_url":"https://api.github.com/users/Ada-C4/repos","events_url":"https://api.github.com/users/Ada-C4/events{/privacy}","received_events_url":"https://api.github.com/users/Ada-C4/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Ada-C4/FarMarRails","description":"","fork":true,"url":"https://api.github.com/repos/Ada-C4/FarMarRails","forks_url":"https://api.github.com/repos/Ada-C4/FarMarRails/forks","keys_url":"https://api.github.com/repos/Ada-C4/FarMarRails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ada-C4/FarMarRails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ada-C4/FarMarRails/teams","hooks_url":"https://api.github.com/repos/Ada-C4/FarMarRails/hooks","issue_events_url":"https://api.github.com/repos/Ada-C4/FarMarRails/issues/events{/number}","events_url":"https://api.github.com/repos/Ada-C4/FarMarRails/events","assignees_url":"https://api.github.com/repos/Ada-C4/FarMarRails/assignees{/user}","branches_url":"https://api.github.com/repos/Ada-C4/FarMarRails/branches{/branch}","tags_url":"https://api.github.com/repos/Ada-C4/FarMarRails/tags","blobs_url":"https://api.github.com/repos/Ada-C4/FarMarRails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ada-C4/FarMarRails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ada-C4/FarMarRails/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ada-C4/FarMarRails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ada-C4/FarMarRails/statuses/{sha}","languages_url":"https://api.github.com/repos/Ada-C4/FarMarRails/languages","stargazers_url":"https://api.github.com/repos/Ada-C4/FarMarRails/stargazers","contributors_url":"https://api.github.com/repos/Ada-C4/FarMarRails/contributors","subscribers_url":"https://api.github.com/repos/Ada-C4/FarMarRails/subscribers","subscription_url":"https://api.github.com/repos/Ada-C4/FarMarRails/subscription","commits_url":"https://api.github.com/repos/Ada-C4/FarMarRails/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ada-C4/FarMarRails/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ada-C4/FarMarRails/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ada-C4/FarMarRails/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ada-C4/FarMarRails/contents/{+path}","compare_url":"https://api.github.com/repos/Ada-C4/FarMarRails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ada-C4/FarMarRails/merges","archive_url":"https://api.github.com/repos/Ada-C4/FarMarRails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ada-C4/FarMarRails/downloads","issues_url":"https://api.github.com/repos/Ada-C4/FarMarRails/issues{/number}","pulls_url":"https://api.github.com/repos/Ada-C4/FarMarRails/pulls{/number}","milestones_url":"https://api.github.com/repos/Ada-C4/FarMarRails/milestones{/number}","notifications_url":"https://api.github.com/repos/Ada-C4/FarMarRails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ada-C4/FarMarRails/labels{/name}","releases_url":"https://api.github.com/repos/Ada-C4/FarMarRails/releases{/id}","created_at":"2015-11-17T18:54:06Z","updated_at":"2015-11-10T20:54:30Z","pushed_at":"2015-11-24T21:41:36Z","git_url":"git://github.com/Ada-C4/FarMarRails.git","ssh_url":"git@github.com:Ada-C4/FarMarRails.git","clone_url":"https://github.com/Ada-C4/FarMarRails.git","svn_url":"https://github.com/Ada-C4/FarMarRails","homepage":null,"size":835,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":11,"forks":12,"open_issues":11,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Ada-C4/FarMarRails/pulls/15"},"html":{"href":"https://github.com/Ada-C4/FarMarRails/pull/15"},"issue":{"href":"https://api.github.com/repos/Ada-C4/FarMarRails/issues/15"},"comments":{"href":"https://api.github.com/repos/Ada-C4/FarMarRails/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/Ada-C4/FarMarRails/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/Ada-C4/FarMarRails/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Ada-C4/FarMarRails/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/Ada-C4/FarMarRails/statuses/056e0e70d6a5e1edf7f50c717687043e5f4057ce"}}}}