En-/decryption fixed

This commit is contained in:
Torsten Schulz
2024-07-28 16:12:48 +02:00
parent 4c12303edc
commit 4b6ad3aefe
27 changed files with 3315 additions and 97 deletions

View File

@@ -0,0 +1,40 @@
'use strict';
module.exports = {
up: async (queryInterface, Sequelize) => {
await queryInterface.sequelize.transaction(async (transaction) => {
await queryInterface.addColumn(
'user',
'email_temp',
{
type: Sequelize.BLOB,
},
{ transaction }
);
await queryInterface.sequelize.query(
'UPDATE "community"."user" SET "email_temp" = "email"::bytea',
{ transaction }
);
await queryInterface.removeColumn('user', 'email', { transaction });
await queryInterface.renameColumn('user', 'email_temp', 'email', { transaction });
await queryInterface.changeColumn(
'user',
'email',
{
type: Sequelize.BLOB,
allowNull: false,
unique: true,
},
{ transaction }
);
});
},
down: async (queryInterface, Sequelize) => {
// Rollback code if needed
},
};