mirror of
https://github.com/Paillat-dev/viralfactory.git
synced 2026-01-02 09:16:19 +00:00
Add Setting and Video models
This commit is contained in:
13
src/models/Setting.py
Normal file
13
src/models/Setting.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from . import Base
|
||||
from typing import Optional
|
||||
from sqlalchemy import String, Column, JSON, Integer
|
||||
from sqlalchemy.ext.mutable import MutableDict
|
||||
|
||||
|
||||
class Setting(Base):
|
||||
__tablename__ = "Settings"
|
||||
|
||||
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||
provider: str = Column(String, nullable=False)
|
||||
type: str = Column(String, nullable=True)
|
||||
data: dict = Column(MutableDict.as_mutable(JSON), nullable=False, default={})
|
||||
18
src/models/Video.py
Normal file
18
src/models/Video.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from . import Base
|
||||
from typing import Optional
|
||||
from sqlalchemy import String, Column, JSON, Integer, DateTime
|
||||
from sqlalchemy.ext.mutable import MutableList
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class Video(Base):
|
||||
__tablename__ = "Videos"
|
||||
|
||||
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||
title: str = Column(String, nullable=False)
|
||||
description: str = Column(String, nullable=F
|
||||
alse)
|
||||
script: str = Column(String, nullable=False)
|
||||
timed_script: dict = Column(MutableList.as_mutable(JSON), nullable=False)
|
||||
timestamp: datetime = Column(DateTime, nullable=False, default=datetime.now())
|
||||
path: str = Column(String, nullable=False)
|
||||
@@ -1,3 +1,5 @@
|
||||
from .Base import Base
|
||||
from .DatabaseManager import SessionLocal, init_db
|
||||
from .File import File
|
||||
from .Setting import Setting
|
||||
from .Video import Video
|
||||
|
||||
Reference in New Issue
Block a user