-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschemas.py
More file actions
86 lines (62 loc) · 2.06 KB
/
Copy pathschemas.py
File metadata and controls
86 lines (62 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
"""
This module contains describes database schemas.
"""
from sqlalchemy import (
BigInteger,
Column,
DateTime,
Double,
ForeignKey,
Integer,
Text,
func,
)
from sqlalchemy.orm import DeclarativeBase
class Base(DeclarativeBase):
"""This class is the represent declare base class for all tables"""
pass
class Chat(Base):
"""This class is the represent declare table chats"""
__tablename__ = "chats"
chat_id = Column(BigInteger, primary_key=True)
date = Column(DateTime(timezone=True))
delta = Column(Integer)
class History(Base):
"""This class is the represent declare table history"""
__tablename__ = "history"
id = Column(BigInteger, primary_key=True, autoincrement=True)
chat_id = Column(BigInteger)
hunter = Column(Text)
game = Column(Text)
date = Column(DateTime(timezone=True), server_default=func.now())
platform = Column(Text, default="Playstation")
user_id = Column(BigInteger)
avatar_date = Column(DateTime(timezone=True))
class Platinum(Base):
"""This class is the represent declare table platinum"""
__tablename__ = "platinum"
id = Column(BigInteger, primary_key=True, autoincrement=True)
chat_id = Column(BigInteger)
hunter = Column(Text)
game = Column(Text)
platform = Column(Text, default="Playstation")
photo_id = Column(Text)
user_id = Column(BigInteger)
class Scores(Base):
"""This class is the represent declare table scores"""
__tablename__ = "scores"
id = Column(BigInteger, primary_key=True, autoincrement=True)
trophy_id = Column(BigInteger, ForeignKey(History.id), nullable=False)
user_id = Column(BigInteger)
picture = Column(Integer)
game = Column(Integer)
difficulty = Column(Integer)
class Surveys(Base):
"""This class is the represent declare table surveys"""
__tablename__ = "surveys"
trophy_id = Column(
BigInteger, ForeignKey(History.id), nullable=False, primary_key=True
)
picture = Column(Double)
game = Column(Double)
difficulty = Column(Double)