Initial commit: svg backend

This commit is contained in:
adminko
2026-03-19 13:39:32 +03:00
commit 85fb2f4bb9
78 changed files with 6161 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
from datetime import datetime
from sqlalchemy import BigInteger, DateTime, ForeignKey, String, Text, func
from sqlalchemy.orm import Mapped, mapped_column
from app.db.base import Base
class SchemeGroupRecord(Base):
__tablename__ = "scheme_groups"
id: Mapped[int] = mapped_column(BigInteger, primary_key=True, autoincrement=True)
group_record_id: Mapped[str] = mapped_column(String(32), unique=True, index=True, nullable=False)
scheme_id: Mapped[str] = mapped_column(
String(32),
ForeignKey("schemes.scheme_id", ondelete="RESTRICT"),
nullable=False,
index=True,
)
scheme_version_id: Mapped[str] = mapped_column(
String(32),
ForeignKey("scheme_versions.scheme_version_id", ondelete="RESTRICT"),
nullable=False,
index=True,
)
element_id: Mapped[str | None] = mapped_column(String(512), nullable=True)
group_id: Mapped[str | None] = mapped_column(String(255), nullable=True)
name: Mapped[str] = mapped_column(String(512), nullable=False)
classes_raw: Mapped[str | None] = mapped_column(Text, nullable=True)
created_at: Mapped[datetime] = mapped_column(
DateTime(timezone=True),
nullable=False,
server_default=func.now(),
)