Fix db creations
This commit is contained in:
parent
af6a581f96
commit
0848116ff8
1 changed files with 5 additions and 6 deletions
11
app/db.py
11
app/db.py
|
@ -4,13 +4,12 @@ from sqlalchemy.orm import DeclarativeBase, MappedAsDataclass
|
||||||
|
|
||||||
db = SQLAlchemy()
|
db = SQLAlchemy()
|
||||||
|
|
||||||
|
class ImagesCache(db.Model):
|
||||||
class Base(DeclarativeBase, MappedAsDataclass):
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class ImagesCache(Base):
|
|
||||||
__tablename__ = "image_cache"
|
__tablename__ = "image_cache"
|
||||||
|
|
||||||
codename: Mapped[str] = mapped_column(primary_key=True)
|
codename: Mapped[str] = mapped_column(primary_key=True)
|
||||||
image: Mapped[str] = mapped_column()
|
image: Mapped[str] = mapped_column()
|
||||||
|
|
||||||
|
def __init__(self, codename, image):
|
||||||
|
self.codename = codename
|
||||||
|
self.image = image
|
||||||
|
|
Loading…
Reference in a new issue