From 927d8661ef81d3eabe057bc3eaac35ac74059065 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Tue, 11 Jul 2023 09:30:09 +0300 Subject: [PATCH] fix: do not add a default for merchant `time` column --- migrations.py | 2 +- models.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/migrations.py b/migrations.py index 3a861fa..aa2ec04 100644 --- a/migrations.py +++ b/migrations.py @@ -171,5 +171,5 @@ async def m003_update_direct_message_type(db): async def m004_add_merchant_timestamp(db): await db.execute( - f"ALTER TABLE nostrmarket.merchants ADD COLUMN time TIMESTAMP NOT NULL DEFAULT {db.timestamp_now};" + f"ALTER TABLE nostrmarket.merchants ADD COLUMN time TIMESTAMP;" ) \ No newline at end of file diff --git a/models.py b/models.py index 8d29e16..0ea3a78 100644 --- a/models.py +++ b/models.py @@ -54,7 +54,7 @@ class PartialMerchant(BaseModel): class Merchant(PartialMerchant, Nostrable): id: str - time: Optional[int] + time: Optional[int] = 0 def sign_hash(self, hash: bytes) -> str: return sign_message_hash(self.private_key, hash)