Modify Message structure

This commit is contained in:
hok7z 2022-12-17 14:36:47 +02:00
parent d918b9a25d
commit 507d250d28
1 changed files with 5 additions and 4 deletions

View File

@ -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 playhouse.db_url import connect
from datetime import date, datetime, timedelta from datetime import date, datetime
from config import db_url from config import db_url
db = connect(db_url) db = connect(db_url)
class WebUser(Model): class WebUser(Model):
@ -30,8 +32,7 @@ class Member(Model):
database = db database = db
class Message(Model): class Message(Model):
user_id = BigIntegerField() user = ForeignKeyField(Member,lazy_load=True)
first_name = CharField()
timestamp = DateTimeField(default=datetime.now()) timestamp = DateTimeField(default=datetime.now())
class Meta: class Meta: