Activate pgcrypto extension for digest() function in database initialization and migration scripts

This commit is contained in:
Torsten Schulz (local)
2025-12-18 14:11:15 +01:00
parent ee4b0ee7c2
commit a486292880
4 changed files with 137 additions and 0 deletions

View File

@@ -2,6 +2,11 @@
module.exports = {
up: async (queryInterface, Sequelize) => {
// Aktiviere die pgcrypto Erweiterung, die die digest() Funktion bereitstellt
await queryInterface.sequelize.query(`
CREATE EXTENSION IF NOT EXISTS pgcrypto;
`);
await queryInterface.sequelize.query(`
CREATE OR REPLACE FUNCTION community.update_hashed_id() RETURNS TRIGGER AS $$
BEGIN