Add a default False to the user model email_confirmed field to avoid violation errors if the value is not explicitly set

This commit is contained in:
Campbell Alden 2026-09-03 23:00:07 +09:00
parent 32e3fe04a2
commit 6c46a1df3a

View file

@ -18,7 +18,7 @@ class UserModel(Base):
__tablename__ = 'user'
id: Mapped[int] = mapped_column(primary_key=True)
email: Mapped[str] = mapped_column(String(254), unique=True)
email_confirmed: Mapped[bool] = mapped_column()
email_confirmed: Mapped[bool] = mapped_column(default=False)
password_hash: Mapped[str] = mapped_column(VARCHAR(255))
subscriptions: Mapped[list['SubscriptionModel']] = relationship(back_populates='user')