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

Change the SqlAlchemy migration of code hidden attribute to use raw SQL #1291

Merged

Conversation

sphuber
Copy link
Contributor

@sphuber sphuber commented Mar 17, 2018

Fixes #1290

The original migration was using the SqlAlchemy models to perform the
migration of the 'hidden' attribute of Code nodes to the extras field.
However, this is problematic, because that will break if the model is
ever going to change in the future. Instead we should use raw SQL
statements that are independent on the current model and will always
work.

The original migration was using the SqlAlchemy models to perform the
migration of the 'hidden' attribute of Code nodes to the extras field.
However, this is problematic, because that will break if the model is
ever going to change in the future. Instead we should use raw SQL
statements that are independent on the current model and will always
work.
Copy link
Member

@giovannipizzi giovannipizzi left a comment

Choose a reason for hiding this comment

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

As a note - I don't know how the SQLA migrations manage this, but in Django the migration gets a 'models' class as a parameter that represents the state of the models at a specific time, before the migration. Maybe there's something similar in SQLA/Alembic

@giovannipizzi giovannipizzi merged commit 274e761 into aiidateam:develop Mar 17, 2018
@sphuber sphuber deleted the fix_1290_sqla_code_hidden_migration branch March 18, 2018 19:04
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.

2 participants