| 700 | |
| 701 | |
| 702 | class StorageProject(Base): |
| 703 | __tablename__: str = "storage_project" |
| 704 | |
| 705 | id: Mapped[str] = mapped_column( |
| 706 | String(32), primary_key=True, default=lambda: token_hex(16) |
| 707 | ) |
| 708 | storage_id: Mapped[str] = mapped_column(ForeignKey("storage.id"), index=True) |
| 709 | project_id: Mapped[str] = mapped_column(ForeignKey("project.id"), index=True) |
| 710 | environment_ids: Mapped[list[str] | None] = mapped_column(JSONB, nullable=True) |
| 711 | secrets: Mapped[dict[str, object]] = mapped_column( |
| 712 | JSONB, nullable=False, default=dict |
| 713 | ) |
| 714 | created_at: Mapped[datetime] = mapped_column(default=utc_now) |
| 715 | updated_at: Mapped[datetime] = mapped_column( |
| 716 | nullable=False, default=utc_now, onupdate=utc_now |
| 717 | ) |
| 718 | |
| 719 | # Relationships |
| 720 | project: Mapped["Project"] = relationship(back_populates="storage_links") |
| 721 | storage: Mapped["Storage"] = relationship(back_populates="project_links") |
| 722 | |
| 723 | __table_args__ = ( |
| 724 | UniqueConstraint( |
| 725 | "storage_id", |
| 726 | "project_id", |
| 727 | name="uq_storage_project", |
| 728 | ), |
| 729 | ) |
| 730 | |
| 731 | |
| 732 | class Deployment(Base): |
no outgoing calls
no test coverage detected