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

feat: switch to alembic migrations #540

Merged
merged 7 commits into from Nov 13, 2023
Merged

feat: switch to alembic migrations #540

merged 7 commits into from Nov 13, 2023

Conversation

smotornyuk
Copy link
Member

@amercader , I mentioned this change at the dev meeting

To make this extension compatible with CKAN after merging sqlalchemy-2.0 PR, at least we have to pass engine to all create and exists calls

But, if ckanext-harvest targets only CKAN >= v2.9, we can switch to alembic migrations. When I had done it, I decided to move all table definitions to the top level of the module.

Finally, I created a second migration. It adds PostgreSQL level ON DELETE CASCADE to all the foreign keys. It's not required for sqlalchemy upgrade, but it really simplifies cleaning the tables manually

@pdelboca
Copy link
Member

pdelboca commented Nov 7, 2023

@smotornyuk I like this one.

I have tested it locally agains the SQLAlchemy 2.0 branch and it is working. I executed a ckan_harvester against a public instance and I found no issues.

@pdelboca pdelboca merged commit c2ef796 into master Nov 13, 2023
6 checks passed
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

2 participants