starter icon indicating copy to clipboard operation
starter copied to clipboard

Move install-db-schema from afterReset to beforeAllMigrations

Open zacherkkila opened this issue 4 years ago • 1 comments

I believe this was handled by the wipe-if-demo script in the demo but I needed to manually run it in production since I removed that script from the Procfile. Not a huge deal but figured I would at least document it here to save someone else some time as it threw me for a little loop when I got the Postgres error.

Got the following error when I tried to register since the worker schema wasn't there

Registration failed (Error code: ERR_3F000)

Once I got the postgres logs running right on RDS it was fairly obvious, just had to run

yarn workspace @app/worker install-db-schema

and everything worked as intended

zacherkkila avatar Jun 29 '20 20:06 zacherkkila

You raise a good point; we currently use afterReset to install the schema; but that'll only do it on the first version and won't install updates until the worker itself runs properly. We should instead use the beforeAllMigrations hook (which is newer than the configuration file, I think).

https://github.com/graphile/starter/blob/7ebee843e3d0d4dc827fd1f8902f10d16b014b45/%40app/db/.gmrc#L71

PR welcome :+1:

benjie avatar Jun 30 '20 09:06 benjie