-
Notifications
You must be signed in to change notification settings - Fork 44
/
models.py
48 lines (45 loc) · 1.61 KB
/
models.py
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
import sqlalchemy
metadata = sqlalchemy.MetaData()
users = sqlalchemy.Table(
"users",
metadata,
sqlalchemy.Column(
name="id", type_=sqlalchemy.BigInteger, primary_key=True, autoincrement=True
),
sqlalchemy.Column(
name="user_id",
type_=sqlalchemy.BigInteger,
unique=True,
),
sqlalchemy.Column(
name="first_name", type_=sqlalchemy.String(length=255), index=True
),
sqlalchemy.Column(
name="last_name", type_=sqlalchemy.String(length=255), index=True, nullable=True
),
sqlalchemy.Column(
name="username", type_=sqlalchemy.String(length=255), index=True, nullable=True
),
sqlalchemy.Column(name="updated_at", type_=sqlalchemy.DateTime, nullable=True),
sqlalchemy.Column(name="created_at", type_=sqlalchemy.DateTime),
)
videos = sqlalchemy.Table(
"videos",
metadata,
sqlalchemy.Column(
name="id", type_=sqlalchemy.BigInteger, primary_key=True, autoincrement=True
),
sqlalchemy.Column(
name="author_id", type_=sqlalchemy.VARCHAR(length=255), index=True
),
sqlalchemy.Column(
name="author_username", type_=sqlalchemy.VARCHAR(length=255), index=True
),
sqlalchemy.Column(name="video_id", type_=sqlalchemy.BigInteger, unique=True),
sqlalchemy.Column(name="file_id", type_=sqlalchemy.String(length=255), index=True),
sqlalchemy.Column(
name="file_unique_id", type_=sqlalchemy.String(length=255), index=True
),
sqlalchemy.Column(name="updated_at", type_=sqlalchemy.DateTime, nullable=True),
sqlalchemy.Column(name="created_at", type_=sqlalchemy.DateTime),
)