-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #530 from scidsg/update-migrations
Update models to match alembic migrations
- Loading branch information
Showing
3 changed files
with
56 additions
and
4 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
build | ||
coverage | ||
hushline/static/vendor/* | ||
.pytest_cache |
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
39 changes: 39 additions & 0 deletions
39
migrations/versions/62551ed63cbf_make_boolean_fields_required.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,39 @@ | ||
"""make boolean fields required | ||
Revision ID: 62551ed63cbf | ||
Revises: 166a3402c391 | ||
Create Date: 2024-08-30 09:51:53.990304 | ||
""" | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "62551ed63cbf" | ||
down_revision = "166a3402c391" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table("users", schema=None) as batch_op: | ||
batch_op.alter_column("password_hash", existing_type=sa.VARCHAR(length=512), nullable=False) | ||
batch_op.alter_column("is_verified", existing_type=sa.BOOLEAN(), nullable=False) | ||
batch_op.alter_column("is_admin", existing_type=sa.BOOLEAN(), nullable=False) | ||
batch_op.alter_column("show_in_directory", existing_type=sa.BOOLEAN(), nullable=False) | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table("users", schema=None) as batch_op: | ||
batch_op.alter_column("show_in_directory", existing_type=sa.BOOLEAN(), nullable=True) | ||
batch_op.alter_column("is_admin", existing_type=sa.BOOLEAN(), nullable=True) | ||
batch_op.alter_column("is_verified", existing_type=sa.BOOLEAN(), nullable=True) | ||
batch_op.alter_column("password_hash", existing_type=sa.VARCHAR(length=512), nullable=True) | ||
|
||
# ### end Alembic commands ### |