-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.py
More file actions
126 lines (93 loc) · 3.27 KB
/
models.py
File metadata and controls
126 lines (93 loc) · 3.27 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
"""SQLAlchemy models for the database.
Author: Kieran Gordon <kieran.gordon28@gmail.com>
"""
from sqlalchemy import BigInteger, Column, Float, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.types import TIMESTAMP
Base = declarative_base()
class Guilds(Base):
"""Database model for guilds.
Args:
----
Base (declarative_base): The base class for the database model.
"""
__tablename__ = "guild"
id = Column(Integer, primary_key=True, autoincrement=True)
guild_id = Column(BigInteger)
name = Column(String)
prefix = Column(String)
film_club_role = Column(BigInteger, nullable=True)
auto_roles = Column(String, nullable=True)
birthday_channel = Column(BigInteger, nullable=True)
forbidden_tags = Column(String, nullable=True)
class WatchList(Base):
"""Database model for the watchlist.
Args:
----
Base (declarative_base): The base class for the database model.
"""
__tablename__ = "watchlist"
id = Column(Integer, primary_key=True, autoincrement=True)
guild_id = Column(BigInteger)
title = Column(String, nullable=True)
year = Column(Integer, nullable=True)
runtime = Column(Integer, nullable=True)
genre = Column(String, nullable=True)
director = Column(String, nullable=True)
rating = Column(Float, nullable=True)
suggested_by = Column(BigInteger)
suggested_on = Column(BigInteger)
url = Column(String)
class WatchedList(Base):
"""Database model for the watched list.
Args:
----
Base (declarative_base): The base class for the database model.
"""
__tablename__ = "watchedlist"
id = Column(Integer, primary_key=True, autoincrement=True)
guild_id = Column(BigInteger)
title = Column(String, nullable=True)
year = Column(Integer, nullable=True)
runtime = Column(Integer, nullable=True)
genre = Column(String, nullable=True)
director = Column(String, nullable=True)
rating = Column(Float, nullable=True)
suggested_by = Column(BigInteger)
suggested_on = Column(BigInteger)
url = Column(String)
class BirthdayList(Base):
"""Database model for the birthday list.
Args:
----
Base (declarative_base): The base class for the database model.
"""
__tablename__ = "birthday"
id = Column(Integer, primary_key=True, autoincrement=True)
guild_id = Column(BigInteger)
user_id = Column(BigInteger)
date = Column(type_=TIMESTAMP(timezone=True))
timezone = Column(String, nullable=True)
class SelfAssignRoles(Base):
"""Database model for self-assignable roles.
Args:
----
Base (declarative_base): The base class for the database model.
"""
__tablename__ = "self_assign_roles"
id = Column(Integer, primary_key=True, autoincrement=True)
guild_id = Column(BigInteger)
role_id = Column(BigInteger)
class TagList(Base):
"""Database model for tags.
Args:
----
Base (declarative_base): The base class for the database model.
"""
__tablename__ = "tag_list"
id = Column(Integer, primary_key=True, autoincrement=True)
guild_id = Column(BigInteger)
tag_name = Column(String)
tag_content = Column(String)
created_by = Column(BigInteger)
created_on = Column(BigInteger)