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

🐛(create_demo) fix failing create_demo #520

Closed
wants to merge 1 commit into from

Conversation

AntoLC
Copy link
Collaborator

@AntoLC AntoLC commented Dec 19, 2024

Purpose

When we do create_demo on a database with already dummy data, the script fails because of unicity constraints.

Proposal

This commit fixes this by checking if the data are already present before creating them.

@AntoLC AntoLC added bug Something isn't working backend labels Dec 19, 2024
@AntoLC AntoLC self-assigned this Dec 19, 2024
@AntoLC AntoLC requested a review from sampaccoud December 19, 2024 14:11
When we do create_demo on a database with already
dummy data, the script fails because of unicity
constraints. This commit fixes this by checking
if the data are already present before creating them.
@AntoLC AntoLC force-pushed the fix/create-demo-unflushed branch from 2d49b2e to a036f0d Compare December 19, 2024 14:13
@sampaccoud
Copy link
Member

sampaccoud commented Dec 21, 2024

This is not a good approach. Create demo is designed to test with tens of millions of objects. The proposed modification would make it too slow. Create demo is designed to run on an empty database and make demo makes sure it flushes existing database.

Can you explain your use case for running create_demo on a non empty database?

@sampaccoud
Copy link
Member

sampaccoud commented Dec 30, 2024

Closing this PR as it would slow down the code and break our main use case which is to test our backend application with tens of millions of records in database.

The solution is to flush the database each time you create a demo as it is done in the make demo command.

@sampaccoud sampaccoud closed this Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants