We need to run some postgres commands making a table and inserting rows locally, ideally before the first deployment.
You could leverage the release_command
configuration option within your fly.toml file.
If you have already attached the PG to your app, you should be able to call a script via the release_command
to handle the migration/seed process. As long as the script leverages the DATABASE_URL envvar to establish the connection you shouldn’t run into any permissions issues.
With regards to the permission issues, this may help provide some context with whats going on there.
Let me know if you have any questions on this!