refactor: Remove unnecessary coments, rename dataset database table
This commit is contained in:
parent
c908aefd80
commit
2383843ec7
3 changed files with 1 additions and 4 deletions
|
|
@ -1,6 +1,5 @@
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
from cognee.api.v1.infrastructure import get_or_create_dataset_database
|
|
||||||
from fastapi import Form, UploadFile, Depends
|
from fastapi import Form, UploadFile, Depends
|
||||||
from fastapi.responses import JSONResponse
|
from fastapi.responses import JSONResponse
|
||||||
from fastapi import APIRouter
|
from fastapi import APIRouter
|
||||||
|
|
@ -65,7 +64,6 @@ def get_add_router() -> APIRouter:
|
||||||
else:
|
else:
|
||||||
await cognee_add(data, datasetName, user=user)
|
await cognee_add(data, datasetName, user=user)
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
raise error
|
|
||||||
return JSONResponse(status_code=409, content={"error": str(error)})
|
return JSONResponse(status_code=409, content={"error": str(error)})
|
||||||
|
|
||||||
return router
|
return router
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@ class Dataset(Base):
|
||||||
|
|
||||||
owner_id = Column(UUID, index=True)
|
owner_id = Column(UUID, index=True)
|
||||||
|
|
||||||
# New relationship for ACLs with cascade deletion
|
|
||||||
acls = relationship("ACL", back_populates="dataset", cascade="all, delete-orphan")
|
acls = relationship("ACL", back_populates="dataset", cascade="all, delete-orphan")
|
||||||
|
|
||||||
data: Mapped[List["Data"]] = relationship(
|
data: Mapped[List["Data"]] = relationship(
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ from cognee.infrastructure.databases.relational import Base
|
||||||
|
|
||||||
|
|
||||||
class DatasetDatabase(Base):
|
class DatasetDatabase(Base):
|
||||||
__tablename__ = "user_database"
|
__tablename__ = "dataset_database"
|
||||||
|
|
||||||
owner_id = Column(UUID, ForeignKey("principals.id", ondelete="CASCADE"), index=True)
|
owner_id = Column(UUID, ForeignKey("principals.id", ondelete="CASCADE"), index=True)
|
||||||
dataset_id = Column(
|
dataset_id = Column(
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue