feat: adapt for PostgreSQL
Created by: melanger
- renamed columns idpId and spId (BREAKING CHANGE), because camelCase column names require escaping in postgreSQL
- added postgreSQL specific syntax where needed, or general SQL syntax instead of MySQL-specific
- changed
DELETE
statement in aggregation from inner join to a regular delete with subquery - changed
IFNULL
toCOALESCE
- changed
YEAR()
etc. toEXTRACT(YEAR FROM ...)
etc.
- changed
- fixed JavaScript to handle dates with time zones
- added migrations scripts for altering database tables from v5