-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ecc70fc
commit fe5896b
Showing
3 changed files
with
126 additions
and
0 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
40 changes: 40 additions & 0 deletions
40
migrations/versions/e4c982111325_create_user_status_log_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,40 @@ | ||
"""Create user status log table | ||
Revision ID: e4c982111325 | ||
Revises: 99379162619e | ||
Create Date: 2022-09-24 19:04:16.240264 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy import orm | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'e4c982111325' | ||
down_revision = '99379162619e' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_table( | ||
"user_status_log", | ||
sa.Column("id", sa.Integer(), autoincrement=True, nullable=False), | ||
sa.Column("user_id", sa.Integer(), nullable=False), | ||
sa.Column("timestamp", sa.DateTime(), nullable=False), | ||
sa.Column("change_description", sa.String(), nullable=False), | ||
sa.Column("expiry", sa.DateTime(), nullable=True), | ||
sa.ForeignKeyConstraint( | ||
["user_id"], | ||
["users.id"], | ||
), | ||
sa.PrimaryKeyConstraint("id"), | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_table("user_status_log") | ||
# ### 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