title: Heroku database error on production: PG::UndefinedTable Error
body: <p>Every time I run the app on Heroku, this is what comes out of the logs:</p>
  
  <pre><code>2018-04-15T22:51:12.806576+00:00 app[web.1]: I, [2018-04-15T22:51:12.806420 #4]  INFO -- : [cd1ed367-c720-4568-ac03-a3b1bec4fc1b] Started GET "/patients" for 112.205.217.139 at 2018-04-15 22:51:12 +0000
  2018-04-15T22:51:12.808307+00:00 app[web.1]: I, [2018-04-15T22:51:12.808235 #4]  INFO -- : [cd1ed367-c720-4568-ac03-a3b1bec4fc1b] Processing by PatientsController#index as HTML
  2018-04-15T22:51:12.811835+00:00 app[web.1]: I, [2018-04-15T22:51:12.811756 #4]  INFO -- : [cd1ed367-c720-4568-ac03-a3b1bec4fc1b]   Rendering patients/index.html.erb within layouts/application
  2018-04-15T22:51:15.563600+00:00 heroku[router]: at=info method=GET path="/patients" host=jdent-patrec.herokuapp.com request_id=cd1ed367-c720-4568-ac03-a3b1bec4fc1b fwd="112.205.217.139" dyno=web.1 connect=0ms service=2757ms status=500 bytes=1827 protocol=https
  2018-04-15T22:51:15.557887+00:00 app[web.1]: D, [2018-04-15T22:51:15.557726 #4] DEBUG -- : [cd1ed367-c720-4568-ac03-a3b1bec4fc1b]   [1m[36mPatient Load (2.7ms)[0m  [1m[34mSELECT "patients".* FROM "patients"[0m
  2018-04-15T22:51:15.558988+00:00 app[web.1]: I, [2018-04-15T22:51:15.558899 #4]  INFO -- : [cd1ed367-c720-4568-ac03-a3b1bec4fc1b]   Rendered patients/index.html.erb within layouts/application (2747.0ms)
  2018-04-15T22:51:15.559386+00:00 app[web.1]: I, [2018-04-15T22:51:15.559271 #4]  INFO -- : [cd1ed367-c720-4568-ac03-a3b1bec4fc1b] Completed 500 Internal Server Error in 2751ms (ActiveRecord: 2589.2ms)
  2018-04-15T22:51:15.560650+00:00 app[web.1]: F, [2018-04-15T22:51:15.560581 #4] FATAL -- : [cd1ed367-c720-4568-ac03-a3b1bec4fc1b]   
  2018-04-15T22:51:15.560736+00:00 app[web.1]: F, [2018-04-15T22:51:15.560661 #4] FATAL -- : [cd1ed367-c720-4568-ac03-a3b1bec4fc1b] ActionView::Template::Error (PG::UndefinedTable: ERROR:  relation "patients" does not exist
  2018-04-15T22:51:15.560739+00:00 app[web.1]: LINE 1: SELECT "patients".* FROM "patients"
  2018-04-15T22:51:15.560741+00:00 app[web.1]:                                  ^
  2018-04-15T22:51:15.560742+00:00 app[web.1]: : SELECT "patients".* FROM "patients"):
  2018-04-15T22:51:15.561063+00:00 app[web.1]: F, [2018-04-15T22:51:15.560972 #4] FATAL -- : [cd1ed367-c720-4568-ac03-a3b1bec4fc1b]     22:     &lt;/thead&gt;
  2018-04-15T22:51:15.561066+00:00 app[web.1]: [cd1ed367-c720-4568-ac03-a3b1bec4fc1b]     23:   
  2018-04-15T22:51:15.561067+00:00 app[web.1]: [cd1ed367-c720-4568-ac03-a3b1bec4fc1b]     24:     &lt;tbody&gt;
  2018-04-15T22:51:15.561069+00:00 app[web.1]: [cd1ed367-c720-4568-ac03-a3b1bec4fc1b]     25:       &lt;% @patients.each do |patient| %&gt;
  2018-04-15T22:51:15.561071+00:00 app[web.1]: [cd1ed367-c720-4568-ac03-a3b1bec4fc1b]     26:         &lt;tr&gt;
  2018-04-15T22:51:15.561072+00:00 app[web.1]: [cd1ed367-c720-4568-ac03-a3b1bec4fc1b]     27:           &lt;td&gt;&lt;%= patient.id %&gt;&lt;/td&gt;
  2018-04-15T22:51:15.561074+00:00 app[web.1]: [cd1ed367-c720-4568-ac03-a3b1bec4fc1b]     28:           &lt;td&gt;&lt;%= patient.first_name %&gt;&lt;/td&gt;
  2018-04-15T22:51:15.561133+00:00 app[web.1]: F, [2018-04-15T22:51:15.561061 #4] FATAL -- : [cd1ed367-c720-4568-ac03-a3b1bec4fc1b]   
  2018-04-15T22:51:15.561200+00:00 app[web.1]: F, [2018-04-15T22:51:15.561139 #4] FATAL -- : [cd1ed367-c720-4568-ac03-a3b1bec4fc1b] app/views/patients/index.html.erb:25:in `_app_views_patients_index_html_erb___2618543925626266733_38249580'
  </code></pre>
  
  <p>Error pic:</p>
  
  <p><a href="https://i.stack.imgur.com/Kn0lS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Kn0lS.png" alt="enter image description here"></a></p>
  
  <p>I've been trying to look for the problem for days but to no avail.</p>