-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.py
More file actions
22 lines (18 loc) · 697 Bytes
/
Copy pathmodels.py
File metadata and controls
22 lines (18 loc) · 697 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from database import Base
from sqlalchemy import Column, String, Integer, UniqueConstraint, CheckConstraint
class User(Base):
__tablename__ = "UsersTable"
id = Column(Integer, primary_key=True, autoincrement=True)
email = Column(String, nullable=False)
password = Column(String, nullable=False)
role = Column(String, nullable=False)
firstName = Column(String, nullable=False)
lastName = Column(String, nullable=False)
company = Column(String, nullable=True)
designation = Column(String, nullable=True)
__table_args__ = (
UniqueConstraint("email"),
CheckConstraint(
role.in_(["ADMIN", "MEMBER", "TECHNICIAN"])
)
)