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 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: