WIP: created Project and Environment models
This commit is contained in:
18
atst/models/project.py
Normal file
18
atst/models/project.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from sqlalchemy import Column, ForeignKey, String
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
from atst.models import Base
|
||||
from atst.models.types import Id
|
||||
from atst.models.mixins import TimestampsMixin
|
||||
|
||||
|
||||
class Project(Base, TimestampsMixin):
|
||||
__tablename__ = "projects"
|
||||
|
||||
id = Id()
|
||||
name = Column(String, nullable=False)
|
||||
description = Column(String, nullable=False)
|
||||
|
||||
workspace_id = Column(ForeignKey("workspaces.id"), nullable=False)
|
||||
workspace = relationship("Workspace")
|
||||
projects = relationship("Environment", back_populates="project")
|
||||
Reference in New Issue
Block a user