Skip to content
This repository has been archived by the owner on Jul 24, 2018. It is now read-only.

Write alembic script to update current models to schema in branch pkg_table #40

Closed
wants to merge 4 commits into from

Conversation

charulagrl
Copy link
Contributor

#39

@pypingou
Copy link
Member

Couple of things about this pull-request, I normally do not use alembic to create table because then createdb.py works just fine, but that's not important.

What is more important is that with that third alembic script, all the data in the database is lost. After running it, there will be no way of knowing to which package(s) belong a file.
So the migration is not just about dropping the column but it will be first about moving it from the one table we made to the new tables, then dropping the columns.

@charulagrl
Copy link
Contributor Author

@pypingou That makes sense. Can you tell me how can I do that ?

@pypingou
Copy link
Member

I guess you will have to do some select and insert queries in the script :)

@ralphbean
Copy link
Contributor

@charulagrl, here's an example of another upgrade script that doesn't do exactly what you need it to, but it does show how to do queries: https://github.com/fedora-infra/datanommer/blob/develop/datanommer.models/alembic/versions/a4f74590bcf_determine_category.py#L37-L67

@ralphbean
Copy link
Contributor

@charulagrl any progress on this? Anything I can help with?

@charulagrl
Copy link
Contributor Author

@ralphbean Thanks for asking. I had done some other small fixes in the code and didn't look much into it. Will try doing it this weekend.

@ralphbean
Copy link
Contributor

OK, we haven't heard back on this so I'm going to close it. Please resubmit if there's ongoing work.

@ralphbean ralphbean closed this May 7, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants