-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove mandatory email requirement from new participant form (#1889)
* Remove mandatory email requirement from new participant form * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Check for field data, add migration name * Optional join of EmailAddress list * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Kiran Jonnalagadda <[email protected]>
- Loading branch information
1 parent
d8ab0b3
commit 1f03eb8
Showing
4 changed files
with
56 additions
and
5 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
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
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
44 changes: 44 additions & 0 deletions
44
migrations/versions/017c60414c03_make_ticket_participant_email_optional.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,44 @@ | ||
"""Make ticket participant email optional. | ||
Revision ID: 017c60414c03 | ||
Revises: 4f9ca10b7b9d | ||
Create Date: 2023-10-05 15:08:34.540672 | ||
""" | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = '017c60414c03' | ||
down_revision: str = '4f9ca10b7b9d' | ||
branch_labels: str | tuple[str, ...] | None = None | ||
depends_on: str | tuple[str, ...] | None = None | ||
|
||
|
||
def upgrade(engine_name: str = '') -> None: | ||
"""Upgrade all databases.""" | ||
# Do not modify. Edit `upgrade_` instead | ||
globals().get(f'upgrade_{engine_name}', lambda: None)() | ||
|
||
|
||
def downgrade(engine_name: str = '') -> None: | ||
"""Downgrade all databases.""" | ||
# Do not modify. Edit `downgrade_` instead | ||
globals().get(f'downgrade_{engine_name}', lambda: None)() | ||
|
||
|
||
def upgrade_() -> None: | ||
"""Upgrade default database.""" | ||
with op.batch_alter_table('ticket_participant', schema=None) as batch_op: | ||
batch_op.alter_column( | ||
'email_address_id', existing_type=sa.INTEGER(), nullable=True | ||
) | ||
|
||
|
||
def downgrade_() -> None: | ||
"""Downgrade default database.""" | ||
with op.batch_alter_table('ticket_participant', schema=None) as batch_op: | ||
batch_op.alter_column( | ||
'email_address_id', existing_type=sa.INTEGER(), nullable=False | ||
) |