Skip to content

Commit

Permalink
field type changes to work with postgresql
Browse files Browse the repository at this point in the history
  • Loading branch information
nahuelhds committed May 25, 2020
1 parent 032ad34 commit 6cdc5b6
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions diffengine/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
ForeignKeyField,
Model,
SqliteDatabase,
TextField,
)
from playhouse.db_url import connect
from playhouse.migrate import SqliteMigrator, migrate
Expand All @@ -60,8 +61,8 @@ class Meta:


class Feed(BaseModel):
url = CharField(primary_key=True)
name = CharField()
url = TextField(primary_key=True)
name = TextField()
created = DateTimeField(default=datetime.utcnow)

@property
Expand Down Expand Up @@ -105,7 +106,7 @@ def get_latest(self):


class Entry(BaseModel):
url = CharField()
url = TextField()
created = DateTimeField(default=datetime.utcnow)
checked = DateTimeField(default=datetime.utcnow)
tweet_status_id_str = CharField(null=False, default="")
Expand Down Expand Up @@ -236,11 +237,11 @@ class FeedEntry(BaseModel):


class EntryVersion(BaseModel):
title = CharField()
url = CharField(index=True)
summary = CharField()
title = TextField()
url = TextField(index=True)
summary = TextField()
created = DateTimeField(default=datetime.utcnow)
archive_url = CharField(null=True)
archive_url = TextField(null=True)
entry = ForeignKeyField(Entry, backref="versions")
tweet_status_id_str = CharField(null=False, default="")

Expand Down

0 comments on commit 6cdc5b6

Please sign in to comment.