This repository has been archived by the owner on Nov 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a canonical entity field so that we can dedupe
- Loading branch information
1 parent
fbdef0b
commit cb44a00
Showing
3 changed files
with
21 additions
and
1 deletion.
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
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,19 @@ | ||
import models | ||
|
||
from playhouse.migrate import * | ||
|
||
""" | ||
http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#schema-migrations | ||
""" | ||
|
||
migrator = SqliteMigrator(models.database) | ||
migrations = { | ||
"Add canonical entity field to entity.": migrator.add_column('entity', 'canonical_entity', CharField(null=True)), | ||
} | ||
|
||
for desc, m in migrations.items(): | ||
try: | ||
print(desc) | ||
migrate(m) | ||
except Exception as e: | ||
print("\tError: %s" % e) |
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