2024-06-17 00:32:03 +02:00
|
|
|
from peewee import *
|
2024-06-26 02:02:55 +02:00
|
|
|
from LibWinDog.Types import *
|
2024-06-17 00:32:03 +02:00
|
|
|
|
|
|
|
Db = SqliteDatabase("Database.sqlite")
|
|
|
|
|
|
|
|
class BaseModel(Model):
|
|
|
|
class Meta:
|
|
|
|
database = Db
|
|
|
|
|
2024-06-26 02:02:55 +02:00
|
|
|
class EntitySettings(BaseModel):
|
|
|
|
language = CharField(null=True)
|
|
|
|
|
2024-06-25 02:08:49 +02:00
|
|
|
class Entity(BaseModel):
|
|
|
|
id = CharField(null=True)
|
|
|
|
id_hash = CharField()
|
2024-06-26 02:02:55 +02:00
|
|
|
settings = ForeignKeyField(EntitySettings, backref="entity", null=True)
|
2024-06-25 02:08:49 +02:00
|
|
|
|
|
|
|
class User(Entity):
|
|
|
|
pass
|
|
|
|
|
|
|
|
class Room(Entity):
|
|
|
|
pass
|
|
|
|
|
2024-06-26 02:02:55 +02:00
|
|
|
Db.create_tables([EntitySettings, User, Room], safe=True)
|
2024-06-25 02:08:49 +02:00
|
|
|
|