-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Record whether an archive is the selected one
This tracks who chose it and when.
- Loading branch information
1 parent
42c8ffc
commit b550e08
Showing
5 changed files
with
226 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
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
41 changes: 41 additions & 0 deletions
41
migrations/versions/d4e3b890e3d7_create_choice_history_table.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,41 @@ | ||
"""Create choice history table | ||
Revision ID: d4e3b890e3d7 | ||
Revises: eda5c539028e | ||
Create Date: 2020-07-09 18:07:04.107503 | ||
""" | ||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'd4e3b890e3d7' | ||
down_revision = 'eda5c539028e' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_table( | ||
'choice_history', | ||
sa.Column('id', sa.Integer(), nullable=False), | ||
sa.Column('archive_id', sa.Integer(), nullable=False), | ||
sa.Column('username', sa.String(), nullable=False), | ||
sa.Column( | ||
'created', | ||
sa.DateTime(timezone=True), | ||
server_default=sa.text('(CURRENT_TIMESTAMP)'), | ||
nullable=False, | ||
), | ||
sa.ForeignKeyConstraint(['archive_id'], ['archive.id'], ), | ||
sa.PrimaryKeyConstraint('id') | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_table('choice_history') | ||
# ### 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
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