Modify Message structure
This commit is contained in:
parent
d918b9a25d
commit
507d250d28
|
@ -1,8 +1,10 @@
|
|||
from peewee import DateTimeField, ForeignKeyField, Model, CharField, BigIntegerField, DateField, TimestampField
|
||||
from peewee import DateTimeField, ForeignKeyField, Model, CharField, BigIntegerField, DateField
|
||||
from playhouse.db_url import connect
|
||||
|
||||
from datetime import date, datetime, timedelta
|
||||
from datetime import date, datetime
|
||||
from config import db_url
|
||||
|
||||
|
||||
db = connect(db_url)
|
||||
|
||||
class WebUser(Model):
|
||||
|
@ -30,8 +32,7 @@ class Member(Model):
|
|||
database = db
|
||||
|
||||
class Message(Model):
|
||||
user_id = BigIntegerField()
|
||||
first_name = CharField()
|
||||
user = ForeignKeyField(Member,lazy_load=True)
|
||||
timestamp = DateTimeField(default=datetime.now())
|
||||
|
||||
class Meta:
|
||||
|
|
Loading…
Reference in New Issue