Skip to content

Commit

Permalink
2.5.10 year of our lord 2023 and postgres capitalization still sux
Browse files Browse the repository at this point in the history
  • Loading branch information
pauljonescodes committed Nov 15, 2023
1 parent 5edf872 commit 851d831
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/database/migrations/1700008096601-EncryptSquareTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class EncryptSquareTokens1700008096601 implements MigrationInterface {
this.logger.verbose(this.up.name);

const merchants: Array<MerchantEntity> = await queryRunner.query(
'SELECT id, squareAccessToken, squareRefreshToken FROM merchant',
`SELECT id, 'squareAccessToken', 'squareRefreshToken' FROM merchant`,
);
const transformer = new EncryptionTransformer(
MoaSquareEncryptionTransformerConfig,
Expand All @@ -22,14 +22,14 @@ export class EncryptSquareTokens1700008096601 implements MigrationInterface {
merchant.squareAccessToken,
);
await queryRunner.query(
`UPDATE merchant SET squareAccessToken = '${encryptedSquareAccessToken}' WHERE id = '${merchant.id}'`,
`UPDATE merchant SET 'squareAccessToken' = '${encryptedSquareAccessToken}' WHERE id = '${merchant.id}'`,
);

const encryptedSquareRefreshToken = transformer.to(
merchant.squareRefreshToken,
);
await queryRunner.query(
`UPDATE merchant SET squareRefreshToken = '${encryptedSquareRefreshToken}' WHERE id = '${merchant.id}'`,
`UPDATE merchant SET 'squareRefreshToken' = '${encryptedSquareRefreshToken}' WHERE id = '${merchant.id}'`,
);
}
}
Expand Down

0 comments on commit 851d831

Please sign in to comment.