Our Preview Environments (similar to a Heroku Review Apps) can utilize an initialDeployHook attribute in the render.yaml, to run a script at creation time, unfortunately, this isn’t used on the first/button deployment of a blueprint.
Thinking in terms of workaround than. Would there be a way to use either the cron or the background worker service type to accomplish this?
It feels a bit dirty, but the cron, maybe it could somehow grab the current date and have the longest possible schedule, since the script do CREATE X IF NOT EXISTS so running that say one a month would not be “terrible”, dirty, but not terrible haha.
Any thoughts on that? What would be the easiest way to run psql with the connectionstring env variable of the database section with -f filename.sql?
Instead of another service maybe you could put together a build script that has the condition checks and runs the psql command if required. These checks, however you implement them, would obviously need to be be pretty watertight as to not affect the database adversely on a subsequent deploy.
Jobs can also be useful to run one-off tasks, although these require the service ID and authentication, so would be a little trickier to incorporate into an automated deploy currently.