target / goalert

Open source on-call scheduling, automated escalations, and notifications so you never miss a critical alert
https://goalert.me
Apache License 2.0
2.17k stars 230 forks source link

db: drop pgcrypto requirement for postgres 13+ #2710

Open mastercactapus opened 1 year ago

mastercactapus commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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.

stale[bot] commented 11 months ago

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