feat: add project
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from sqlalchemy import Column, Integer, String, JSON, DateTime, func
|
||||
from sqlalchemy import Column, Integer, String, JSON, DateTime, ForeignKey, func
|
||||
from sqlalchemy.orm import relationship
|
||||
from app.database import Base
|
||||
|
||||
class DataSource(Base):
|
||||
@@ -8,5 +9,8 @@ class DataSource(Base):
|
||||
name = Column(String, nullable=False)
|
||||
type = Column(String, nullable=False)
|
||||
config = Column(JSON, nullable=False)
|
||||
project_id = Column(Integer, ForeignKey("projects.id"), nullable=False)
|
||||
created_at = Column(DateTime, default=func.now())
|
||||
updated_at = Column(DateTime, default=func.now(), onupdate=func.now())
|
||||
|
||||
project = relationship("Project", back_populates="data_sources")
|
||||
|
||||
Reference in New Issue
Block a user