Orders Pool - Fix updated_at not null
This commit is contained in:
parent
b194b19a15
commit
84d9d7cfda
2 changed files with 7 additions and 1 deletions
|
|
@ -80,7 +80,7 @@ class OrdersPool(BaseModel):
|
|||
null=True
|
||||
)
|
||||
|
||||
updated_at = DateTimeField()
|
||||
updated_at = DateTimeField(null=False)
|
||||
|
||||
def to_dict(self):
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -37,8 +37,14 @@ with suppress(ImportError):
|
|||
def migrate(migrator: Migrator, database: pw.Database, *, fake=False):
|
||||
"""Write your migrations here."""
|
||||
|
||||
migrator.change_fields('orders_pool', updated_at=pw.DateTimeField())
|
||||
|
||||
migrator.add_not_null('orders_pool', 'updated_at')
|
||||
|
||||
|
||||
def rollback(migrator: Migrator, database: pw.Database, *, fake=False):
|
||||
"""Write your rollback migrations here."""
|
||||
|
||||
migrator.change_fields('orders_pool', updated_at=pw.DateTimeField(null=True))
|
||||
|
||||
migrator.drop_not_null('orders_pool', 'updated_at')
|
||||
|
|
|
|||
Loading…
Reference in a new issue