mirror of
https://github.com/xlorepdarkhelm/numinar-coding-project.git
synced 2026-09-08 19:13:11 -04:00
26 lines
578 B
Python
26 lines
578 B
Python
"""Add unique constraint to prevent duplicate invitees for the same booking
|
|
|
|
Revision ID: 0003_add_invitee_unique_constraint
|
|
Revises: 0002_add_booking_exclusion_constraint
|
|
Create Date: 2025-08-26
|
|
"""
|
|
|
|
from alembic import op
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = "0003"
|
|
down_revision = "0002"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
op.create_unique_constraint(
|
|
"uq_invitees_booking_user", "invitees", ["booking_id", "user_email"]
|
|
)
|
|
|
|
|
|
def downgrade():
|
|
op.drop_constraint("uq_invitees_booking_user", "invitees", type_="unique")
|