goalert icon indicating copy to clipboard operation
goalert copied to clipboard

db: drop pgcrypto requirement for postgres 13+

Open mastercactapus opened this issue 2 years ago • 3 comments

What problem would you like to solve? Please describe: We currently have CREATE EXTENSION pgcrypto in a couple of migrations that require special permissions, which can be a pain point for deployment. This is only required for the gen_random_uuid function, which is standard in Postgres 13+

Describe the solution you'd like: If Postgres 13.0 or higher is detected, filter out the CREATE EXTENSION pgcrypto lines in the initial migration(s).

Describe alternatives you've considered: None, this is just a pain point for new installs.

mastercactapus avatar Nov 29 '22 22:11 mastercactapus

On second thought, we could probably test select gen_random_uuid() and skip the extension line if it works; then, we don't need to do any version magic.

mastercactapus avatar Nov 29 '22 22:11 mastercactapus

I did some testing on this; in addition to the UUID stuff, we also used a digest function for some migrations. We could do a schema-only dump of the DB as an all-in-one migration for new installations to jump ahead (instead of running each individually), but I think that'd be the only option.

mastercactapus avatar Dec 16 '22 19:12 mastercactapus

This issue has been automatically marked as stale because it has not had recent activity.

stale[bot] avatar Aug 12 '23 04:08 stale[bot]