Skip to content

Commit

Permalink
reverted nullable to False
Browse files Browse the repository at this point in the history
  • Loading branch information
zipperman1 committed Nov 8, 2024
1 parent f84ed25 commit 0f84b63
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions migrations/versions/0fbda260a023_add_user_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@

def upgrade():
op.add_column('comment', sa.Column('user_id', sa.Integer(), nullable=True))
op.alter_column('lecturer_user_comment', 'user_id', existing_type=sa.INTEGER(), nullable=True)


def downgrade():
op.alter_column('lecturer_user_comment', 'user_id', existing_type=sa.INTEGER(), nullable=False)
op.drop_column('comment', 'user_id')
2 changes: 1 addition & 1 deletion rating_api/models/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ 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=True)
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)

0 comments on commit 0f84b63

Please sign in to comment.