-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into schedule-updates
- Loading branch information
Showing
93 changed files
with
3,268 additions
and
1,149 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
59 changes: 59 additions & 0 deletions
59
alembic/versions/6f2db268b938_add_checkbox_to_opt_into_art_show_won_.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,59 @@ | ||
"""Add checkbox to opt into art show won bids email | ||
Revision ID: 6f2db268b938 | ||
Revises: df998079da32 | ||
Create Date: 2024-11-11 15:46:11.969424 | ||
""" | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '6f2db268b938' | ||
down_revision = 'df998079da32' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
|
||
try: | ||
is_sqlite = op.get_context().dialect.name == 'sqlite' | ||
except Exception: | ||
is_sqlite = False | ||
|
||
if is_sqlite: | ||
op.get_context().connection.execute('PRAGMA foreign_keys=ON;') | ||
utcnow_server_default = "(datetime('now', 'utc'))" | ||
else: | ||
utcnow_server_default = "timezone('utc', current_timestamp)" | ||
|
||
def sqlite_column_reflect_listener(inspector, table, column_info): | ||
"""Adds parenthesis around SQLite datetime defaults for utcnow.""" | ||
if column_info['default'] == "datetime('now', 'utc')": | ||
column_info['default'] = utcnow_server_default | ||
|
||
sqlite_reflect_kwargs = { | ||
'listeners': [('column_reflect', sqlite_column_reflect_listener)] | ||
} | ||
|
||
# =========================================================================== | ||
# HOWTO: Handle alter statements in SQLite | ||
# | ||
# def upgrade(): | ||
# if is_sqlite: | ||
# with op.batch_alter_table('table_name', reflect_kwargs=sqlite_reflect_kwargs) as batch_op: | ||
# batch_op.alter_column('column_name', type_=sa.Unicode(), server_default='', nullable=False) | ||
# else: | ||
# op.alter_column('table_name', 'column_name', type_=sa.Unicode(), server_default='', nullable=False) | ||
# | ||
# =========================================================================== | ||
|
||
|
||
def upgrade(): | ||
op.add_column('art_show_bidder', sa.Column('email_won_bids', sa.Boolean(), server_default='False', nullable=False)) | ||
|
||
|
||
def downgrade(): | ||
op.drop_column('art_show_bidder', 'email_won_bids') |
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,73 @@ | ||
"""Add badge pickup groups | ||
Revision ID: 8224640bc6cc | ||
Revises: 6f2db268b938 | ||
Create Date: 2024-11-13 04:55:18.730126 | ||
""" | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '8224640bc6cc' | ||
down_revision = '6f2db268b938' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import postgresql | ||
import residue | ||
|
||
|
||
try: | ||
is_sqlite = op.get_context().dialect.name == 'sqlite' | ||
except Exception: | ||
is_sqlite = False | ||
|
||
if is_sqlite: | ||
op.get_context().connection.execute('PRAGMA foreign_keys=ON;') | ||
utcnow_server_default = "(datetime('now', 'utc'))" | ||
else: | ||
utcnow_server_default = "timezone('utc', current_timestamp)" | ||
|
||
def sqlite_column_reflect_listener(inspector, table, column_info): | ||
"""Adds parenthesis around SQLite datetime defaults for utcnow.""" | ||
if column_info['default'] == "datetime('now', 'utc')": | ||
column_info['default'] = utcnow_server_default | ||
|
||
sqlite_reflect_kwargs = { | ||
'listeners': [('column_reflect', sqlite_column_reflect_listener)] | ||
} | ||
|
||
# =========================================================================== | ||
# HOWTO: Handle alter statements in SQLite | ||
# | ||
# def upgrade(): | ||
# if is_sqlite: | ||
# with op.batch_alter_table('table_name', reflect_kwargs=sqlite_reflect_kwargs) as batch_op: | ||
# batch_op.alter_column('column_name', type_=sa.Unicode(), server_default='', nullable=False) | ||
# else: | ||
# op.alter_column('table_name', 'column_name', type_=sa.Unicode(), server_default='', nullable=False) | ||
# | ||
# =========================================================================== | ||
|
||
|
||
def upgrade(): | ||
op.create_table('badge_pickup_group', | ||
sa.Column('id', residue.UUID(), nullable=False), | ||
sa.Column('created', residue.UTCDateTime(), server_default=sa.text("timezone('utc', current_timestamp)"), nullable=False), | ||
sa.Column('last_updated', residue.UTCDateTime(), server_default=sa.text("timezone('utc', current_timestamp)"), nullable=False), | ||
sa.Column('external_id', postgresql.JSONB(astext_type=sa.Text()), server_default='{}', nullable=False), | ||
sa.Column('last_synced', postgresql.JSONB(astext_type=sa.Text()), server_default='{}', nullable=False), | ||
sa.Column('public_id', residue.UUID(), nullable=True), | ||
sa.Column('account_id', sa.Unicode(), server_default='', nullable=False), | ||
sa.PrimaryKeyConstraint('id', name=op.f('pk_badge_pickup_group')) | ||
) | ||
op.add_column('attendee', sa.Column('badge_pickup_group_id', residue.UUID(), nullable=True)) | ||
op.create_foreign_key(op.f('fk_attendee_badge_pickup_group_id_badge_pickup_group'), 'attendee', 'badge_pickup_group', ['badge_pickup_group_id'], ['id'], ondelete='SET NULL') | ||
|
||
|
||
def downgrade(): | ||
op.drop_constraint(op.f('fk_attendee_badge_pickup_group_id_badge_pickup_group'), 'attendee', type_='foreignkey') | ||
op.drop_column('attendee', 'badge_pickup_group_id') | ||
op.drop_table('badge_pickup_group') |
63 changes: 63 additions & 0 deletions
63
alembic/versions/9c23621e5e12_add_list_of_refund_txns_to_receipt_txns.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,63 @@ | ||
"""Add list of refund txns to receipt txns | ||
Revision ID: 9c23621e5e12 | ||
Revises: f01a2ad10d79 | ||
Create Date: 2024-11-06 17:59:12.695586 | ||
""" | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '9c23621e5e12' | ||
down_revision = 'f01a2ad10d79' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
import residue | ||
|
||
|
||
try: | ||
is_sqlite = op.get_context().dialect.name == 'sqlite' | ||
except Exception: | ||
is_sqlite = False | ||
|
||
if is_sqlite: | ||
op.get_context().connection.execute('PRAGMA foreign_keys=ON;') | ||
utcnow_server_default = "(datetime('now', 'utc'))" | ||
else: | ||
utcnow_server_default = "timezone('utc', current_timestamp)" | ||
|
||
def sqlite_column_reflect_listener(inspector, table, column_info): | ||
"""Adds parenthesis around SQLite datetime defaults for utcnow.""" | ||
if column_info['default'] == "datetime('now', 'utc')": | ||
column_info['default'] = utcnow_server_default | ||
|
||
sqlite_reflect_kwargs = { | ||
'listeners': [('column_reflect', sqlite_column_reflect_listener)] | ||
} | ||
|
||
# =========================================================================== | ||
# HOWTO: Handle alter statements in SQLite | ||
# | ||
# def upgrade(): | ||
# if is_sqlite: | ||
# with op.batch_alter_table('table_name', reflect_kwargs=sqlite_reflect_kwargs) as batch_op: | ||
# batch_op.alter_column('column_name', type_=sa.Unicode(), server_default='', nullable=False) | ||
# else: | ||
# op.alter_column('table_name', 'column_name', type_=sa.Unicode(), server_default='', nullable=False) | ||
# | ||
# =========================================================================== | ||
|
||
|
||
def upgrade(): | ||
#op.create_index(op.f('ix_receipt_item_fk_id'), 'receipt_item', ['fk_id'], unique=False) | ||
op.add_column('receipt_transaction', sa.Column('refunded_txn_id', residue.UUID(), nullable=True)) | ||
op.create_foreign_key(op.f('fk_receipt_transaction_refunded_txn_id_receipt_transaction'), 'receipt_transaction', 'receipt_transaction', ['refunded_txn_id'], ['id'], ondelete='SET NULL') | ||
|
||
|
||
def downgrade(): | ||
op.drop_constraint(op.f('fk_receipt_transaction_refunded_txn_id_receipt_transaction'), 'receipt_transaction', type_='foreignkey') | ||
op.drop_column('receipt_transaction', 'refunded_txn_id') | ||
op.drop_index(op.f('ix_receipt_item_fk_id'), table_name='receipt_item') |
59 changes: 59 additions & 0 deletions
59
alembic/versions/df998079da32_add_admin_notes_to_receipt_items.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,59 @@ | ||
"""Add admin notes to receipt items | ||
Revision ID: df998079da32 | ||
Revises: 9c23621e5e12 | ||
Create Date: 2024-11-11 00:27:15.421118 | ||
""" | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'df998079da32' | ||
down_revision = '9c23621e5e12' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
|
||
try: | ||
is_sqlite = op.get_context().dialect.name == 'sqlite' | ||
except Exception: | ||
is_sqlite = False | ||
|
||
if is_sqlite: | ||
op.get_context().connection.execute('PRAGMA foreign_keys=ON;') | ||
utcnow_server_default = "(datetime('now', 'utc'))" | ||
else: | ||
utcnow_server_default = "timezone('utc', current_timestamp)" | ||
|
||
def sqlite_column_reflect_listener(inspector, table, column_info): | ||
"""Adds parenthesis around SQLite datetime defaults for utcnow.""" | ||
if column_info['default'] == "datetime('now', 'utc')": | ||
column_info['default'] = utcnow_server_default | ||
|
||
sqlite_reflect_kwargs = { | ||
'listeners': [('column_reflect', sqlite_column_reflect_listener)] | ||
} | ||
|
||
# =========================================================================== | ||
# HOWTO: Handle alter statements in SQLite | ||
# | ||
# def upgrade(): | ||
# if is_sqlite: | ||
# with op.batch_alter_table('table_name', reflect_kwargs=sqlite_reflect_kwargs) as batch_op: | ||
# batch_op.alter_column('column_name', type_=sa.Unicode(), server_default='', nullable=False) | ||
# else: | ||
# op.alter_column('table_name', 'column_name', type_=sa.Unicode(), server_default='', nullable=False) | ||
# | ||
# =========================================================================== | ||
|
||
|
||
def upgrade(): | ||
op.add_column('receipt_item', sa.Column('admin_notes', sa.Unicode(), server_default='', nullable=False)) | ||
|
||
|
||
def downgrade(): | ||
op.drop_column('receipt_item', 'admin_notes') |
87 changes: 87 additions & 0 deletions
87
alembic/versions/ecb1983d7dfd_add_escalation_tickets_for_attendee_.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,87 @@ | ||
"""Add escalation tickets for attendee check-in | ||
Revision ID: ecb1983d7dfd | ||
Revises: 8224640bc6cc | ||
Create Date: 2024-11-15 22:59:42.134196 | ||
""" | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'ecb1983d7dfd' | ||
down_revision = '8224640bc6cc' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import postgresql | ||
from sqlalchemy.schema import Sequence, CreateSequence, DropSequence | ||
import residue | ||
|
||
|
||
try: | ||
is_sqlite = op.get_context().dialect.name == 'sqlite' | ||
except Exception: | ||
is_sqlite = False | ||
|
||
if is_sqlite: | ||
op.get_context().connection.execute('PRAGMA foreign_keys=ON;') | ||
utcnow_server_default = "(datetime('now', 'utc'))" | ||
else: | ||
utcnow_server_default = "timezone('utc', current_timestamp)" | ||
|
||
def sqlite_column_reflect_listener(inspector, table, column_info): | ||
"""Adds parenthesis around SQLite datetime defaults for utcnow.""" | ||
if column_info['default'] == "datetime('now', 'utc')": | ||
column_info['default'] = utcnow_server_default | ||
|
||
sqlite_reflect_kwargs = { | ||
'listeners': [('column_reflect', sqlite_column_reflect_listener)] | ||
} | ||
|
||
# =========================================================================== | ||
# HOWTO: Handle alter statements in SQLite | ||
# | ||
# def upgrade(): | ||
# if is_sqlite: | ||
# with op.batch_alter_table('table_name', reflect_kwargs=sqlite_reflect_kwargs) as batch_op: | ||
# batch_op.alter_column('column_name', type_=sa.Unicode(), server_default='', nullable=False) | ||
# else: | ||
# op.alter_column('table_name', 'column_name', type_=sa.Unicode(), server_default='', nullable=False) | ||
# | ||
# =========================================================================== | ||
|
||
|
||
def upgrade(): | ||
op.execute(CreateSequence(Sequence('escalation_ticket_ticket_id_seq'))) | ||
op.create_table('escalation_ticket', | ||
sa.Column('id', residue.UUID(), nullable=False), | ||
sa.Column('created', residue.UTCDateTime(), server_default=sa.text("timezone('utc', current_timestamp)"), nullable=False), | ||
sa.Column('last_updated', residue.UTCDateTime(), server_default=sa.text("timezone('utc', current_timestamp)"), nullable=False), | ||
sa.Column('external_id', postgresql.JSONB(astext_type=sa.Text()), server_default='{}', nullable=False), | ||
sa.Column('last_synced', postgresql.JSONB(astext_type=sa.Text()), server_default='{}', nullable=False), | ||
sa.Column('ticket_id', sa.Integer(), server_default=sa.text("nextval('escalation_ticket_ticket_id_seq')"), nullable=False), | ||
sa.Column('description', sa.Unicode(), server_default='', nullable=False), | ||
sa.Column('admin_notes', sa.Unicode(), server_default='', nullable=False), | ||
sa.Column('resolved', residue.UTCDateTime(), nullable=True), | ||
sa.PrimaryKeyConstraint('id', name=op.f('pk_escalation_ticket')), | ||
sa.UniqueConstraint('ticket_id', name=op.f('uq_escalation_ticket_ticket_id')) | ||
) | ||
op.create_table('attendee_escalation_ticket', | ||
sa.Column('attendee_id', residue.UUID(), nullable=False), | ||
sa.Column('escalation_ticket_id', residue.UUID(), nullable=False), | ||
sa.ForeignKeyConstraint(['attendee_id'], ['attendee.id'], name=op.f('fk_attendee_escalation_ticket_attendee_id_attendee')), | ||
sa.ForeignKeyConstraint(['escalation_ticket_id'], ['escalation_ticket.id'], name=op.f('fk_attendee_escalation_ticket_escalation_ticket_id_escalation_ticket')), | ||
sa.UniqueConstraint('attendee_id', 'escalation_ticket_id', name=op.f('uq_attendee_escalation_ticket_attendee_id')) | ||
) | ||
op.create_index('ix_attendee_escalation_ticket_attendee_id', 'attendee_escalation_ticket', ['attendee_id'], unique=False) | ||
op.create_index('ix_attendee_escalation_ticket_escalation_ticket_id', 'attendee_escalation_ticket', ['escalation_ticket_id'], unique=False) | ||
|
||
|
||
def downgrade(): | ||
op.drop_index('ix_attendee_escalation_ticket_escalation_ticket_id', table_name='attendee_escalation_ticket') | ||
op.drop_index('ix_attendee_escalation_ticket_attendee_id', table_name='attendee_escalation_ticket') | ||
op.drop_table('attendee_escalation_ticket') | ||
op.drop_table('escalation_ticket') | ||
op.execute(DropSequence(Sequence('escalation_ticket_ticket_id_seq'))) |
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
Oops, something went wrong.