Nov 19 01:33:20 PM Caused by:
Nov 19 01:33:20 PM ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR: relation “schedules” does not exist (ActiveRecord::StatementInvalid)
I connected my database to my service using the internal database URL in the environment variables, which matches my render.yaml with DATABSE_URL. Is there somewhere else I need to check the connection? Both the service and the database are in the same region, Ohio (US East).
It looks like you updated your build script just to have bundle exec rake db:migrate. Did this help? This is what I would recommend to have in your build script. You for sure don’t need bundle exec rake db:create as your database already exists. bundle exec rake db:schema:load you don’t want to be running every build.
Just curious how you fixed the issue? cc @Keith
I’m also getting the same issue. I checked locally and it works locally when I run bundle exec db:create then db:migrate command and I can see the table from my local db
But when I use the example render-build.sh script, I get PG::UndefinedTable: ERROR: relation "payola_subscriptions" does not exist
I suspect your migrations don’t include every migration required to create your database schema, so the migration you are running is trying to migrate something that doesn’t exist.
For your very first build, you may need to add bundle exec rake db:schema:load before bundle exec rake db:migrate. Once your build is successful you will need to remove this line and just have bundle exec rake db:migrate.