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

fix: delete position type inconnue #496

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fufeck
Copy link
Collaborator

@fufeck fufeck commented Jan 7, 2025

CONTEXT

Le type de position inconnue ne passe pas le validateur
Il faut retirer la possibilité d'utiliser le type de position inconnue dans l'application mes-adresses

FONCTIONNALITE

  • Mettre type position entrée par default a l'import
  • Changer l'enum
  • Ajouter les validateur de position sur les dto
  • Faire une migration de toute les ancienne positions

PR

@fufeck fufeck requested a review from MaGOs92 January 7, 2025 14:09
Copy link
Collaborator

@MaGOs92 MaGOs92 left a comment

Choose a reason for hiding this comment

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

LGTM

`ALTER TABLE "positions" ALTER COLUMN "type" TYPE "public"."positions_type_enum_old" USING "type"::"text"::"public"."positions_type_enum_old"`,
);
await queryRunner.query(
`ALTER TABLE "positions" ALTER COLUMN "type" SET DEFAULT 'entrée'`,
Copy link
Collaborator

Choose a reason for hiding this comment

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

pour le down, il faudrait set le default à "inconnue"

Copy link
Collaborator

Choose a reason for hiding this comment

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

ça me parait compliqué toutes ces manipulations de l'enum... Y'a pas juste moyen de supprimer / ajouter une valeur dans l'enum?

Copy link
Collaborator

Choose a reason for hiding this comment

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

clock: yarn start:cron
Copy link
Collaborator

Choose a reason for hiding this comment

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

On pourrait pas se servir d'une variable d'env pour lancer les migrations en mode auto ou non?
Je vois dans la doc de Scalingo qu'on peut faire ce genre de chose : https://doc.scalingo.com/platform/app/procfile

Le Procfile :
clock: yarn start:cron
postdeploy: bash bin/postdeploy.sh

et le script postdeploy.sh =>
#!/bin/bash

if [ "$LAUNCH_MIGRATION_AT_START" = "true" ] ; then
exec yarn typeorm:migration:run
fi

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