mirror of
https://github.com/liamcottle/reticulum-meshchat.git
synced 2026-04-27 16:10:32 +00:00
move config to database
This commit is contained in:
parent
4958340584
commit
3e9f7d5314
2 changed files with 71 additions and 59 deletions
15
database.py
15
database.py
|
|
@ -10,6 +10,19 @@ class BaseModel(Model):
|
|||
database = database
|
||||
|
||||
|
||||
class Config(BaseModel):
|
||||
|
||||
id = BigAutoField()
|
||||
key = CharField(unique=True)
|
||||
value = TextField()
|
||||
created_at = DateTimeField(default=datetime.now)
|
||||
updated_at = DateTimeField(default=datetime.now)
|
||||
|
||||
# define table name
|
||||
class Meta:
|
||||
table_name = "config"
|
||||
|
||||
|
||||
class LxmfMessage(BaseModel):
|
||||
|
||||
id = BigAutoField()
|
||||
|
|
@ -26,6 +39,6 @@ class LxmfMessage(BaseModel):
|
|||
created_at = DateTimeField(default=datetime.now)
|
||||
updated_at = DateTimeField(default=datetime.now)
|
||||
|
||||
# define database and table name
|
||||
# define table name
|
||||
class Meta:
|
||||
table_name = "lxmf_messages"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue