changed default for delete field in users model

This commit is contained in:
Анатолий Богомолов 2024-04-12 20:19:32 +10:00
parent 66178acebe
commit 16dc839a1f
1 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,4 @@
from sqlalchemy import Integer, null from sqlalchemy import Integer, false, null
from sqlalchemy.schema import ( from sqlalchemy.schema import (
Column, Column,
ForeignKey, ForeignKey,
@ -16,7 +16,7 @@ class User(db.Model):
username: Mapped[str] = mapped_column(nullable=True) username: Mapped[str] = mapped_column(nullable=True)
description: Mapped[str] = mapped_column(nullable=True) description: Mapped[str] = mapped_column(nullable=True)
delete: Mapped[bool] = mapped_column(default="false") delete: Mapped[bool] = mapped_column(default=false)
collection_id = Column(Integer, ForeignKey("collection.id")) collection_id = Column(Integer, ForeignKey("collection.id"))
collection: Mapped["Collection"] = relationship("Collection", back_populates="users") collection: Mapped["Collection"] = relationship("Collection", back_populates="users")