Skip to content

Commit

Permalink
feat (backend): add Universional, Versioned, Header & Tags DBA abstra…
Browse files Browse the repository at this point in the history
…ct models
  • Loading branch information
aybruhm committed Dec 3, 2024
1 parent bb15059 commit f584137
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion agenta-backend/agenta_backend/dbs/postgres/shared/dbas.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from sqlalchemy import Column, UUID, TIMESTAMP, func
from sqlalchemy.dialects.postgresql import JSONB
from sqlalchemy import Column, String, UUID, TIMESTAMP, func, Integer


class ProjectScopeDBA:
Expand Down Expand Up @@ -27,3 +28,30 @@ class LifecycleDBA:
UUID(as_uuid=True),
nullable=True,
)


class UniversionalDBA:
__abstract__ = True

slug = Column(String, nullable=False)


class HeaderDBA:
__abstract__ = True

name = Column(String, nullable=True)
description = Column(String, nullable=True)


class VersionedDBA(LifecycleDBA):
__abstract__ = True

slug = Column(String, nullable=False)
version = Column(Integer, nullable=False)
id = Column(UUID(as_uuid=True), nullable=False)


class TagsDBA:
__abstract__ = True

tags = Column(JSONB(none_as_null=True), nullable=True)

0 comments on commit f584137

Please sign in to comment.