Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migration: postgres #470

Merged
merged 109 commits into from
Sep 10, 2024
Merged

migration: postgres #470

merged 109 commits into from
Sep 10, 2024

Conversation

fufeck
Copy link
Collaborator

@fufeck fufeck commented Jul 9, 2024

Context

Changement de la stack, on remplace mongodb par postgres grace a typeorm

@fufeck fufeck marked this pull request as draft July 9, 2024 08:43
@fufeck fufeck marked this pull request as ready for review August 26, 2024 07:29
@fufeck fufeck changed the title Fufeck migration postgres migration: postgres Aug 28, 2024
@@ -64,7 +66,7 @@ export class SearchQueryPipe implements PipeTransform {

if (query.email) {
if (typeof query.email === 'string' && checkValidEmail(query.email)) {
filters.emails = { $regex: new RegExp(`^${query.email}$`, 'i') };
filters.emails = ArrayContains([query.email]);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'est bien case insensitive?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maintenant oui

keepConnectionAlive: true,
schema: 'public',
migrationsRun: true,
migrations: [Initialization1724762471013],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a besoin de run la migration d'initialisation dans le CRON si elle est déjà faite par l'API? Je pense que ça serait mieux de laisser toutes les migrations côté API

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Négatif, c'est l'appli qui démare en première qui init la DB

@@ -53,36 +44,11 @@ export class CronService {

@Cron(CronExpression.EVERY_DAY_AT_2AM)
async removeSoftDeletedBALsOlderThanOneYear() {
console.debug('Task start : purge old deleted BALs');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On laisse pas les logs? ça peut toujours être util

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pas besoin, normalement il y a deja de console.log dans TaskQueue

libs/shared/src/entities/global.entity.ts Outdated Show resolved Hide resolved
libs/shared/src/entities/global.entity.ts Outdated Show resolved Hide resolved
@@ -74,12 +80,15 @@
"mongodb": "^6.1.0",
Copy link
Collaborator

@MaGOs92 MaGOs92 Aug 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On peut virer mongodb non? et le plugin mongoose lean?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je vais dégager mongoose plutot dont on a pas besoin, mongodb obligatoire pour ObjectId

@MaGOs92
Copy link
Collaborator

MaGOs92 commented Aug 29, 2024

TESTS :

  • J'ai eu cette erreur à la création d'une BAL lors du populate :
Capture d’écran 2024-08-29 à 16 32 56 Les positions des toponymes ont été importés mais pas celles des numéros. Par contre après quand j'en crée dans la BAL, pas de souci. Tu vois d'où ça peut venir?

Même erreur quand j'essaie d'ajouter un numéro sur une voie métrique

  • Problème dans les liens de connexion envoyés par mail : les Ids des bal sont "undefined"
Capture d’écran 2024-08-30 à 15 01 25

@fufeck fufeck requested a review from MaGOs92 September 2, 2024 08:51
@fufeck
Copy link
Collaborator Author

fufeck commented Sep 4, 2024

TESTS :

  • J'ai eu cette erreur à la création d'une BAL lors du populate :

Capture d’écran 2024-08-29 à 16 32 56 Les positions des toponymes ont été importés mais pas celles des numéros. Par contre après quand j'en crée dans la BAL, pas de souci. Tu vois d'où ça peut venir?
Même erreur quand j'essaie d'ajouter un numéro sur une voie métrique

  • Problème dans les liens de connexion envoyés par mail : les Ids des bal sont "undefined"
Capture d’écran 2024-08-30 à 15 01 25

Super bien vu le deuxième, c'est corrigé ;)

@fufeck fufeck merged commit 925ddfb into master Sep 10, 2024
4 of 5 checks passed
@fufeck fufeck deleted the fufeck_migration_postgres branch September 10, 2024 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants