-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
There was a problem hiding this 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'`, |
There was a problem hiding this comment.
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"
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alors pour la première remarque, le type par DEFAULT est deja entrée
avant la migration
Ensuite il existe une commande postgres pour ADD VALUE mais pas pour DROP VALUE https://www.postgresql.org/docs/14/sql-altertype.html, j'ai quand même essayé en local (dans le doute) la commande DROP VALUE et ca n'existe pas
Procfile
Outdated
clock: yarn start:cron |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je suis pas très fan de la solution mais c'est peut être mieux que a l'heure actuelle
CONTEXT
Le type de position
inconnue
ne passe pas le validateurIl faut retirer la possibilité d'utiliser le type de position
inconnue
dans l'application mes-adressesFONCTIONNALITE
entrée
par default a l'importPR