Skip to content

Commit 603e784

Browse files
authored
Add OIDCPublisherProjectAssociation constraint (#18380)
1 parent 6699172 commit 603e784

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

warehouse/oidc/models/_core.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import rfc3986
99
import sentry_sdk
1010

11-
from sqlalchemy import ForeignKey, Index, String, func, orm
11+
from sqlalchemy import ForeignKey, Index, String, UniqueConstraint, func, orm
1212
from sqlalchemy.dialects.postgresql import UUID
1313
from sqlalchemy.orm import Mapped, mapped_column
1414

@@ -97,6 +97,7 @@ def check_existing_jti(
9797

9898
class OIDCPublisherProjectAssociation(db.Model):
9999
__tablename__ = "oidc_publisher_project_association"
100+
__table_args__ = (UniqueConstraint("oidc_publisher_id", "project_id"),)
100101

101102
oidc_publisher_id = mapped_column(
102103
UUID(as_uuid=True),

0 commit comments

Comments
 (0)