formaptix-server/database/form.py

14 lines
389 B
Python
Raw Normal View History

2024-08-12 16:57:40 +03:00
from sqlalchemy import JSON, ForeignKey
2024-08-10 20:38:54 +03:00
from sqlalchemy.orm import Mapped, mapped_column, relationship
from database import Base, User
class Form(Base):
__tablename__ = "forms"
id: Mapped[int] = mapped_column(primary_key=True)
name: Mapped[str]
2024-08-12 16:57:40 +03:00
owner_id: Mapped[int] = mapped_column(ForeignKey(User.id, ondelete="CASCADE"))
2024-08-10 20:38:54 +03:00
data: Mapped[dict] = mapped_column(JSON)