-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.py
More file actions
26 lines (20 loc) · 922 Bytes
/
Copy pathmodels.py
File metadata and controls
26 lines (20 loc) · 922 Bytes
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
from database import Base
from sqlalchemy import Column, String
from fastapi_utils.guid_type import GUID, GUID_DEFAULT_SQLITE
class ModelEmployee(Base):
"""
Represents an Employee in the database.
This model defines the structure of the 'employee' table in the database,
including the id, name, and department fields.
Attributes:
id (GUID): The unique identifier for the employee, automatically generated.
name (str): The name of the employee.
department (str): The department to which the employee belongs.
Note:
The 'id' field is a GUID (Globally Unique Identifier) column with a default
value generated using GUID_DEFAULT_SQLITE for SQLite databases.
"""
__tablename__ = 'employee'
id = Column(GUID, primary_key=True, default=GUID_DEFAULT_SQLITE)
name = Column(String, nullable=False)
department = Column(String, nullable=False)