-
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add product_insight.bounding_box field
- Loading branch information
1 parent
b7519e2
commit 404d155
Showing
4 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"""Peewee migrations -- 002_add_bounding_box.py.""" | ||
|
||
from contextlib import suppress | ||
|
||
import peewee as pw | ||
from peewee_migrate import Migrator | ||
|
||
with suppress(ImportError): | ||
import playhouse.postgres_ext as pw_pext | ||
|
||
|
||
def migrate(migrator: Migrator, database: pw.Database, *, fake=False): | ||
"""Write your migrations here.""" | ||
|
||
migrator.add_fields( | ||
"product_insight", bounding_box=pw_pext.BinaryJSONField(index=True, null=True) | ||
) | ||
|
||
|
||
def rollback(migrator: Migrator, database: pw.Database, *, fake=False): | ||
"""Write your rollback migrations here.""" | ||
|
||
migrator.remove_fields("product_insight", "bounding_box") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters