Skip to content

Commit

Permalink
remove constraint for lms_url
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytropolityka committed Sep 28, 2024
1 parent 2642254 commit e89b556
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
4 changes: 1 addition & 3 deletions athena/athena/models/db_exercise.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
from sqlalchemy import Column, String, Float, UniqueConstraint, JSON, Enum as SqlEnum
from sqlalchemy import Column, String, Float, JSON, Enum as SqlEnum

from athena.schemas import ExerciseType
from .model import Model
from .big_integer_with_autoincrement import BigIntegerWithAutoincrement


class DBExercise(Model):
__table_args__ = (UniqueConstraint('lms_url'),)

id = Column(BigIntegerWithAutoincrement, primary_key=True, index=True, nullable=False)
lms_url = Column(String, index=True, nullable=False)
title = Column(String, index=True, nullable=False)
Expand Down
2 changes: 1 addition & 1 deletion athena/athena/models/db_feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


class DBFeedback(Model):
__table_args__ = (UniqueConstraint('lms_id', 'lms_url'),)
__table_args__ = (UniqueConstraint('lms_id'),)

id = Column(BigIntegerWithAutoincrement, primary_key=True, index=True, autoincrement=True)
lms_url = Column(String, index=True, nullable=False)
Expand Down
4 changes: 1 addition & 3 deletions athena/athena/models/db_submission.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
from sqlalchemy import Column, JSON, String, UniqueConstraint
from sqlalchemy import Column, JSON, String

from .model import Model
from .big_integer_with_autoincrement import BigIntegerWithAutoincrement


class DBSubmission(Model):
__table_args__ = (UniqueConstraint('lms_url'),)

id = Column(BigIntegerWithAutoincrement, primary_key=True, index=True, autoincrement=True,)
lms_url = Column(String, index=True, nullable=False)
meta = Column(JSON, nullable=False)

0 comments on commit e89b556

Please sign in to comment.