fix data base
This commit is contained in:
16
bd/tables/choice.py
Normal file
16
bd/tables/choice.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from sqlalchemy import Column, String, Integer, ForeignKey
|
||||
from sqlalchemy.dialects.postgresql import UUID
|
||||
from .simple_base import Base
|
||||
import uuid
|
||||
|
||||
|
||||
class Choice(Base):
|
||||
__tablename__ = "choices"
|
||||
|
||||
id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
|
||||
question_id = Column(UUID(as_uuid=True), ForeignKey("questions.id", ondelete="CASCADE"), nullable=False)
|
||||
text = Column(String(500), nullable=False)
|
||||
position = Column(Integer, nullable=True)
|
||||
|
||||
|
||||
__all__ = ["Base", "Choice"]
|
||||
Reference in New Issue
Block a user