:chore: Initialisation du projet
This commit is contained in:
1 parent
75a8c6addd
commit
6278d19618
27 files changed
+4418
-81
No files matched your search
@@ -0,0 +1,31 @@
|
||||
from datetime import datetime
|
||||
|
||||
from sqlalchemy import BigInteger, DateTime, String, Text, UniqueConstraint, func
|
||||
from sqlalchemy.orm import Mapped, mapped_column
|
||||
|
||||
from app.database import Base
|
||||
|
||||
|
||||
class ApplicationSetting(Base):
|
||||
__tablename__ = "application_settings"
|
||||
|
||||
key: Mapped[str] = mapped_column(String(100), primary_key=True)
|
||||
value: Mapped[str] = mapped_column(Text)
|
||||
|
||||
|
||||
class IsoMovie(Base):
|
||||
__tablename__ = "iso_movies"
|
||||
__table_args__ = (UniqueConstraint("radarr_movie_id", "radarr_movie_file_id"),)
|
||||
|
||||
id: Mapped[int] = mapped_column(primary_key=True)
|
||||
radarr_movie_id: Mapped[int] = mapped_column(index=True)
|
||||
radarr_movie_file_id: Mapped[int]
|
||||
title: Mapped[str] = mapped_column(String(500))
|
||||
year: Mapped[int | None]
|
||||
path: Mapped[str] = mapped_column(Text)
|
||||
size: Mapped[int | None] = mapped_column(BigInteger)
|
||||
status: Mapped[str] = mapped_column(String(30), default="detected")
|
||||
last_seen_at: Mapped[datetime] = mapped_column(
|
||||
DateTime(timezone=True), server_default=func.now()
|
||||
)
|
||||
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())
|
||||
Reference in new issue
Block a user