This commit is contained in:
2021-11-21 22:32:25 +03:00
commit 18df7c12f4
23 changed files with 667 additions and 0 deletions

21
src/app/models.py Normal file
View File

@@ -0,0 +1,21 @@
import ormar
from core.db import metadata, database
class BaseMeta(ormar.ModelMeta):
metadata = metadata
database = database
class CachedFile(ormar.Model):
class Meta(BaseMeta):
tablename = "cached_files"
constraints = [
ormar.UniqueColumns('object_id','object_type')
]
id: int = ormar.Integer(primary_key=True) # type: ignore
object_id: int = ormar.Integer() # type: ignore
object_type: str = ormar.String(max_length=8) # type: ignore
data = ormar.JSON()