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

Added super basic Alembic configuration to the alchemy paster template #1625

Closed

Conversation

nek4life
Copy link
Contributor

Created a super basic alembic configuration for the alchemy paster template for issue #1597. I'd like to get feedback on the approach and whether or not this is something to be pursued. If so I'll go ahead and create tests and documentation to go along with the patch. I will likely need help writing tests for the template output as it doesn't seem as straight forward as writing a regular unit test.

@blaflamme
Copy link
Member

@mmerickel BTW should we agree to update the pattern used for SQLA to something similar to this?

https://gist.github.com/blaflamme/0b25c8fed8db0b87b9b6

@nek4life
Copy link
Contributor Author

Back home now...

So I guess there are still a few things to decide.

  • Should the migrations be located inside or outside of the package.
  • Should the folder name be alembic or migrations.
  • Should the sqlalchemy be located in the [DEFAULT] section or remain under the [app:main] section in which case the alembic env.py will need to be modified to support this use case.

And there is the matter of testing. I'm currently unsure how to create the necessary tests for the resulting output of the paster templates. I'll try to dig into the code a bit to see what kind of tests are currently written for the paster templates.

@pauleveritt
Copy link
Member

You could switch to Wichert’s pyramid_sqlalchemy.

—Paul

On Apr 13, 2015, at 1:03 PM, Blaise Laflamme notifications@github.com wrote:

@mmerickel https://github.com/mmerickel BTW should we agree to update the pattern used for SQLA to something similar to this?

https://gist.github.com/blaflamme/0b25c8fed8db0b87b9b6 https://gist.github.com/blaflamme/0b25c8fed8db0b87b9b6

Reply to this email directly or view it on GitHub #1625 (comment).

@nek4life
Copy link
Contributor Author

@pauleveritt I could be mistaken but I didn't see any Alembic support with the pyramid_sqlalchemy package. I also think there was some discussion about setting up the paster template with a non global (or non scoped I think in sqlalchemy lingua.)

BTW is there separate ticket for that?

@pauleveritt
Copy link
Member

Sorry about that, I was responding to Blaise’s ticket about SQLA setup in Pyramid. You’re right that the topic should be in a different ticket.

—Paul

On Apr 14, 2015, at 8:55 AM, Charlie Choiniere notifications@github.com wrote:

@pauleveritt https://github.com/pauleveritt I could be mistaken but I didn't see any Alembic support with the pyramid_sqlalchemy package. I also think there was some discussion about setting up the paster template with a non global (or non scoped I think in sqlalchemy lingua.)

BTW is there separate ticket for that?


Reply to this email directly or view it on GitHub #1625 (comment).

@blaflamme
Copy link
Member

@pauleveritt the discussion we had with @mmerickel and others was about avoiding to use sqla's scoped_session for the better

@marioidival
Copy link

I was hoping someone comment on that issue in which I created, but thank you for making this PR @nek4life

@ergo
Copy link
Member

ergo commented Nov 8, 2015

What's the consensus on the issue right now?
I think all actual features of new scaffold in #2024 are implemented so I could also incorporate alembic into it.

@marioidival
Copy link

@ergo It's nice 👍

@lmctv
Copy link
Contributor

lmctv commented Nov 8, 2015

@ergo 👍 from me, even though documentation is completely missing.

@mmerickel
Copy link
Member

The alchemy scaffolding changes are already massive. I'm pretty afraid to merge this until that dust has settled. In general I'm not particularly excited about merging an alembic setup into pyramid's core scaffold at all but it seems like the idea has a fair amount of support.

Work that needs to be done here to have a hope of merging:

  • Update the src folders in the wiki2 tutorial to contain the migrations as they are derived from the scaffold.
  • Update the wiki2 tutorial to contain an explanation (possibly a new chapter) on how to use and modify the setup to perform migrations.

Chicken-and-the-egg here: these changes will likely be easier to do after waiting until the other scaffold changes are complete in #2024.

@ergo
Copy link
Member

ergo commented Feb 5, 2016

I have also my own solution to alembic - one that integrates with initialize_db script - so no work would be required on tutorials apart changing the location initial model migration.

I'm more concerned about the fact that alembic will not work with sqlite at all - if memory serves me right.

@mmerickel
Copy link
Member

Alembic has grown support for SQLite over the years but it does have a few quirks as can be expected.

so no work would be required on tutorials apart changing the location initial model migration.

I'm saying someone MUST update the tutorial to explain the features. :-)

@hyperknot
Copy link
Contributor

hyperknot commented Jun 13, 2016

I might have a look at this project and try to integrate inklesspen's project and the new 1.7 compatibility changes.

@mmerickel
Copy link
Member

mmerickel commented Mar 30, 2017

This work should be done on https://github.com/Pylons/pyramid-cookiecutter-alchemy. Anyone is welcome to contribute alembic support there.

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.

8 participants