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

Ajuste clés étrangères pour resource_related #3713

Merged
merged 2 commits into from
Jan 10, 2024

Conversation

AntoineAugusti
Copy link
Member

Fixes #3712

Permet de supprimer automatiquement une ligne dans la table resource_related quand une resource est supprimée. Ceci bloquait l'import d'au moins un JDD.

Voir l'issue pour le détail.

Comment on lines +6 to +7
add(:resource_src_id, references(:resource, on_delete: :nothing), null: false)
add(:resource_dst_id, references(:resource, on_delete: :nothing), null: false)
Copy link
Member Author

Choose a reason for hiding this comment

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

L'intention était là mais c'était placé au mauvais endroit 😬 C'est attendu dans references et pas dans add/3

@AntoineAugusti AntoineAugusti marked this pull request as ready for review January 10, 2024 09:36
@AntoineAugusti AntoineAugusti requested a review from a team as a code owner January 10, 2024 09:36
auto-merge was automatically disabled January 10, 2024 14:14

Merge queue setting changed

Copy link
Contributor

@thbar thbar left a comment

Choose a reason for hiding this comment

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

Excellent - j'ai mis un peu de temps à comprendre le changement dans la migration "legacy" mais ça fait parfaitement sens.

Thanks !

@AntoineAugusti
Copy link
Member Author

AntoineAugusti commented Jan 10, 2024

@thbar J'aurais dû mettre une note mais j'ai choisi de changer la migration passée pour éviter une erreur future de copier/coller ! Le contenu n'a pas été changé mais je l'ai mis "au bon endroit" 😅

@AntoineAugusti AntoineAugusti added this pull request to the merge queue Jan 10, 2024
Merged via the queue into master with commit c471d43 Jan 10, 2024
4 checks passed
@AntoineAugusti AntoineAugusti deleted the resource_related_on_delete_migration branch January 10, 2024 14:28
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.

Erreur d'import : clé étrangère sur resource_related empêche la mise à jour
2 participants