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

add db seed-data check on backend startup #144

Merged
merged 5 commits into from
Dec 29, 2022
Merged

Conversation

andreaskoepf
Copy link
Collaborator

@andreaskoepf andreaskoepf commented Dec 29, 2022

This inserts dummy conversations into the posts table if they are not present during startup. This behavior can be disabled by setting the USE_SEED_DATA config param to False.

Resolves #133

(Turned out to be more struggle than I initially thought with all the ids. Also good way to review current API maybe.)

@andreaskoepf andreaskoepf requested a review from yk as a code owner December 29, 2022 13:07
@@ -33,6 +33,7 @@ def assemble_db_connection(cls, v: Optional[str], values: Dict[str, Any]) -> Any

BACKEND_CORS_ORIGINS: List[AnyHttpUrl] = []
UPDATE_ALEMBIC: bool = True
USE_SEED_DATA: bool = True
Copy link
Collaborator

Choose a reason for hiding this comment

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

could we set this to false, but set to true in the docker-compose?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, is done.

@yk yk linked an issue Dec 29, 2022 that may be closed by this pull request
@andreaskoepf andreaskoepf merged commit 71eb09b into main Dec 29, 2022
@andreaskoepf andreaskoepf deleted the 133_dummy_fill_empty_db branch December 29, 2022 14:58
@AbdBarho
Copy link
Collaborator

Thank you ❤, this was blocking us on the frontend!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants