-
-
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.
fix: add logo_annotation.server_type field
This is the same as ImageModel.server_type, but we store it here to avoid performing a double join with ImageModel table when we need to filter logos by server_type (LogoAnnotation > ImagePrediction > ImageModel)
- Loading branch information
1 parent
6ba5f7e
commit a21859e
Showing
2 changed files
with
36 additions
and
2 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 @@ | ||
import peewee as pw | ||
from peewee_migrate import Migrator | ||
|
||
|
||
def migrate(migrator: Migrator, database: pw.Database, *, fake=False): | ||
"""Write your migrations here.""" | ||
|
||
migrator.add_fields( | ||
"logo_annotation", | ||
server_type=pw.CharField( | ||
null=True, | ||
max_length=10, | ||
help_text="project associated with the logo annotation, " | ||
"one of 'off', 'obf', 'opff', 'opf', 'off-pro'", | ||
index=False, | ||
), | ||
) | ||
|
||
|
||
def rollback(migrator: Migrator, database: pw.Database, *, fake=False): | ||
"""Write your rollback migrations here.""" | ||
|
||
migrator.remove_fields("logo_annotation", "server_type") |
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