TIMESTAMP(timezone=True) updated

This commit is contained in:
2024-11-26 12:29:01 +03:00
parent 3539a26d77
commit 288a393719
8 changed files with 32 additions and 41 deletions

View File

@@ -37,7 +37,7 @@ class UsersTokens(CrudCollection):
token: Mapped[str] = mapped_column(String, server_default="")
domain: Mapped[str] = mapped_column(String, server_default="")
expires_at: Mapped[TIMESTAMP] = mapped_column(
TIMESTAMP, default=str(system_arrow.shift(date=system_arrow.now(), days=3))
TIMESTAMP(timezone=True), default=str(system_arrow.shift(date=system_arrow.now(), days=3))
)
# users = relationship("Users", back_populates="tokens", foreign_keys=[user_id])
@@ -92,7 +92,7 @@ class Users(CrudCollection, UserLoginModule, SelectAction):
)
password_expiry_begins: Mapped[TIMESTAMP] = mapped_column(
"expiry_begins",
TIMESTAMP,
TIMESTAMP(timezone=True),
server_default=func.now(),
comment="Timestamp when password expiry begins",
)
@@ -321,7 +321,7 @@ class People(CrudCollection, SelectAction):
String, server_default="", comment="Birth place of the person"
)
birth_date: Mapped[TIMESTAMP] = mapped_column(
TIMESTAMP, server_default="1900-01-01", comment="Birth date of the person"
TIMESTAMP(timezone=True), server_default="1900-01-01", comment="Birth date of the person"
)
tax_no: Mapped[str] = mapped_column(
String, server_default="", comment="Tax number of the person"
@@ -982,7 +982,7 @@ class Contracts(CrudCollection):
comment="contract_code is the unique code given by the system.",
)
contract_date: Mapped[TIMESTAMP] = mapped_column(
TIMESTAMP,
TIMESTAMP(timezone=True),
server_default="2099-12-31 23:59:59",
comment="contract date is the date the contract is made. "
"expire start is the start date of the contract, expire en is the end date of the contract.",