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

intial schema migrations setup for sqlalchemy models #8532

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

auvipy
Copy link
Member

@auvipy auvipy commented Sep 21, 2023

using alembic

@codecov
Copy link

codecov bot commented Sep 21, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (65ac2ac) 87.45% compared to head (3760587) 87.45%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8532   +/-   ##
=======================================
  Coverage   87.45%   87.45%           
=======================================
  Files         148      148           
  Lines       18499    18499           
  Branches     3158     3158           
=======================================
  Hits        16179    16179           
  Misses       2032     2032           
  Partials      288      288           
Flag Coverage Δ
unittests 87.42% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Nusnus
Copy link
Member

Nusnus commented Sep 21, 2023

👑

@auvipy
Copy link
Member Author

auvipy commented Sep 21, 2023

I need to get my hands dirty with this for a few more days to make it fully ready.

@auvipy auvipy mentioned this pull request Oct 30, 2023
16 tasks
@ThiefMaster
Copy link
Contributor

Is this really something that should be on the celery side?

  • If I do not use alembic and just use create_all() to create my database tables, then I just need to make my SA aware of the models (ie by calling a function from celery that creates them using my application's declarative base)
  • If I use alembic, I'm already maintaining my own revisions, so I would do the same as above, and use alembic to autogenerate the revision to create the celery-related models (if that's even needed: It's only needed when adding celery at a later stage, or when using alembic to create the initial database instead of letting SA's create_all() do this)

@auvipy
Copy link
Member Author

auvipy commented Nov 5, 2023

I will share more context here.

@auvipy
Copy link
Member Author

auvipy commented Nov 7, 2023

Is this really something that should be on the celery side?

* If I do not use alembic and just use `create_all()` to create my database tables, then I just need to make my SA aware of the models (ie by calling a function from celery that creates them using my application's declarative base)

* If I use alembic, I'm already maintaining my own revisions, so I would do the same as above, and use alembic to autogenerate the revision to create the celery-related models (if that's even needed: It's only needed when adding celery at a later stage, or when using alembic to create the initial database instead of letting SA's `create_all()` do this)

we got a regression report and had to revert #8475 (comment) so thought that adding migration is the safer bet. what do you think?

@ThiefMaster
Copy link
Contributor

I think DB changes should be clearly documented in the changelog. But executing them extremely dependent on the environment.

Note: This is assuming that you do not maintain your completely separate sqlalchemy environment. If you do, then migrations in celery make sense (because it's completely independent of the application's database usage). But if you defer this to the application's sqlalchemy environment, then IMHO what I mentioned in my previous comment applies.

@auvipy
Copy link
Member Author

auvipy commented Nov 7, 2023

is using multi db schema migrations a feasible option?

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.

None yet

3 participants