Skip to content

Commit

Permalink
Merge pull request #37 from profcomff/main
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
Temmmmmo authored Nov 10, 2024
2 parents f0a6fd5 + ec4816d commit 6ae1486
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""delete-user-id-from-lectureruser

Check failure on line 1 in migrations/versions/fee34ac4fcab_delete_user_id_from_lectureruser.py

View workflow job for this annotation

GitHub Actions / linting

Imports are incorrectly sorted and/or formatted.
Revision ID: fee34ac4fcab
Revises: 0fbda260a023
Create Date: 2024-11-10 02:38:49.538788
"""

import sqlalchemy as sa
from alembic import op



revision = 'fee34ac4fcab'
down_revision = '0fbda260a023'
branch_labels = None
depends_on = None


def upgrade():
op.drop_column('lecturer_user_comment', 'user_id')


def downgrade():
op.add_column('lecturer_user_comment', sa.Column('user_id', sa.INTEGER(), autoincrement=False, nullable=False))
1 change: 0 additions & 1 deletion rating_api/models/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,5 @@ class Comment(BaseDbModel):
class LecturerUserComment(BaseDbModel):
id: Mapped[int] = mapped_column(Integer, primary_key=True)
lecturer_id: Mapped[int] = mapped_column(Integer, ForeignKey("lecturer.id"))
user_id: Mapped[int] = mapped_column(Integer, nullable=False)
create_ts: Mapped[datetime.datetime] = mapped_column(DateTime, default=datetime.datetime.utcnow, nullable=False)
update_ts: Mapped[datetime.datetime] = mapped_column(DateTime, default=datetime.datetime.utcnow, nullable=False)
2 changes: 1 addition & 1 deletion rating_api/schemas/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class CommentGet(Base):
uuid: UUID
user_id: int | None
user_id: int | None = None
create_ts: datetime.datetime
update_ts: datetime.datetime
subject: str
Expand Down

0 comments on commit 6ae1486

Please sign in to comment.