-
Notifications
You must be signed in to change notification settings - Fork 592
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(admin): admin usage log (#1448)
* admin usage log * users_usage in admin model
- Loading branch information
1 parent
4b49352
commit e157895
Showing
4 changed files
with
57 additions
and
1 deletion.
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
35 changes: 35 additions & 0 deletions
35
app/db/migrations/versions/d0a3960f5dad_usagelog_table_for_admin.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,35 @@ | ||
"""UsageLog table for Admin | ||
Revision ID: d0a3960f5dad | ||
Revises: b25e7e6be241 | ||
Create Date: 2024-11-22 19:56:53.185624 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'd0a3960f5dad' | ||
down_revision = 'b25e7e6be241' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_table('admin_usage_logs', | ||
sa.Column('id', sa.Integer(), nullable=False), | ||
sa.Column('admin_id', sa.Integer(), nullable=True), | ||
sa.Column('used_traffic_at_reset', sa.BigInteger(), nullable=False), | ||
sa.Column('reset_at', sa.DateTime(), nullable=True), | ||
sa.ForeignKeyConstraint(['admin_id'], ['admins.id'], ), | ||
sa.PrimaryKeyConstraint('id') | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_table('admin_usage_logs') | ||
# ### 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