-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also force fix_com and fix_orientation to be true
- Loading branch information
Showing
2 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
...ctal/alembic/versions/2024-01-06-49cfda6eb87e_remove_explicit_fix__columns_in_molecule.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
"""remove explicit fix_ columns in molecule | ||
Revision ID: 49cfda6eb87e | ||
Revises: de44b1b34097 | ||
Create Date: 2024-01-06 19:18:04.534992 | ||
""" | ||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "49cfda6eb87e" | ||
down_revision = "de44b1b34097" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_column("molecule", "fix_orientation") | ||
op.drop_column("molecule", "fix_com") | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column("molecule", sa.Column("fix_com", sa.BOOLEAN(), autoincrement=False, nullable=True)) | ||
op.add_column("molecule", sa.Column("fix_orientation", sa.BOOLEAN(), autoincrement=False, nullable=True)) | ||
op.execute(sa.text("UPDATE molecule SET fix_com = True, fix_orientation = True")) | ||
op.alter_column("molecule", "fix_com", nullable=False) | ||
op.alter_column("molecule", "fix_orientation", nullable=False) | ||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters