Skip to content

Commit

Permalink
M2-4180 firebase_token_id field name updated based on comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-g-scnt committed Dec 11, 2023
1 parent cf8427b commit ef7401b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/apps/logs/db/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class UserActivityLogSchema(Base):
nullable=False,
index=True,
)
device_id = Column(String(), nullable=True)
firebase_token_id = Column(String(), nullable=True)
event_type = Column(String(), nullable=False)
event = Column(String(), nullable=False)
user_agent = Column(String(), nullable=True)
Expand All @@ -35,5 +35,5 @@ class UserActivityLogSchema(Base):
def __repr__(self):
return (
f"UserActivityLogSchema(id='{self.id}', user_id='{self.user_id}',"
f" target='{self.target}', action='{self.action}')"
f" event_type='{self.event_type}', event='{self.event}')"
)
2 changes: 1 addition & 1 deletion src/apps/logs/user_activity_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async def user_activity_login_log(

schema = UserActivityLogSchema(
user_id=user.id,
device_id=user_login_schema.device_id,
firebase_token_id=user_login_schema.device_id,
event_type=UserActivityEventType.LOGIN,
event=UserActivityEvent.LOGIN,
user_agent=request.headers.get("user-agent"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
"""add-user-activity-logs
Revision ID: bc2fcc0b0cd1
Revises: 75c9ca1f506b
Create Date: 2023-11-30 10:41:15.308713
Revision ID: c4e7691b4fc4
Revises: 186481f0c0cc
Create Date: 2023-12-11 13:28:43.125626
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = "bc2fcc0b0cd1"
down_revision = "75c9ca1f506b"
revision = "c4e7691b4fc4"
down_revision = "186481f0c0cc"
branch_labels = None
depends_on = None

Expand Down Expand Up @@ -42,7 +42,7 @@ def upgrade() -> None:
sa.Column("migrated_updated", sa.DateTime(), nullable=True),
sa.Column("is_deleted", sa.Boolean(), nullable=True),
sa.Column("user_id", postgresql.UUID(as_uuid=True), nullable=False),
sa.Column("device_id", sa.String(), nullable=True),
sa.Column("firebase_token_id", sa.String(), nullable=True),
sa.Column("event_type", sa.String(), nullable=False),
sa.Column("event", sa.String(), nullable=False),
sa.Column("user_agent", sa.String(), nullable=True),
Expand Down

0 comments on commit ef7401b

Please sign in to comment.