add files infra docker service for data platform
This commit is contained in:
@@ -32,7 +32,11 @@ class ApiClient(Base):
|
||||
name: Mapped[str] = mapped_column(String(128), unique=True, nullable=False)
|
||||
is_active: Mapped[bool] = mapped_column(Boolean, nullable=False, default=True)
|
||||
|
||||
api_keys: Mapped[list[ApiKey]] = relationship(back_populates="client")
|
||||
api_keys: Mapped[list[ApiKey]] = relationship(
|
||||
back_populates="client",
|
||||
cascade="all, delete-orphan",
|
||||
passive_deletes=True,
|
||||
)
|
||||
|
||||
|
||||
class ApiKey(Base):
|
||||
@@ -40,7 +44,9 @@ class ApiKey(Base):
|
||||
__table_args__ = {"schema": "fastapi"}
|
||||
|
||||
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
|
||||
client_id: Mapped[int] = mapped_column(ForeignKey("fastapi.api_client.id"), nullable=False)
|
||||
client_id: Mapped[int] = mapped_column(
|
||||
ForeignKey("fastapi.api_client.id", ondelete="CASCADE"), nullable=False
|
||||
)
|
||||
name: Mapped[str | None] = mapped_column(String(128), nullable=True)
|
||||
|
||||
key_prefix: Mapped[str] = mapped_column(String(12), nullable=False)
|
||||
|
||||
Reference in New Issue
Block a user