Skip to content

Conversation

@davidfischer
Copy link
Collaborator

I hit this extremely minor bug in production. If you try to add the same user again as an authorized user on an advertiser, you hit a DB constraint (500 error).

That's because the constraint added here exists
in production but not in the model. That is because at first the UserAdvertiserMember model was just an automatic table and then we added a new column to the table via migration.

This adds a secondary check to ensure we don't try to add the same user again and adds the constraint in development. Hopefully there isn't an issue adding that constraint again in prod or we could fake the migration if desired since the constraint already exists.

I hit this extremely minor bug in production. If you try to add the same
user again as an authorized user on an advertiser, you hit a DB
constraint (500 error).

That's because the constraint added here exists
in production but not in the model. That is because at first the
UserAdvertiserMember model was just an automatic table and then we added
a new column to the table via migration.

This adds a secondary check to ensure we don't try to add the same user
again and adds the constraint in development. Hopefully there isn't an
issue adding that constraint again in prod or we could fake the
migration if desired since the constraint already exists.
@davidfischer davidfischer requested a review from a team as a code owner November 1, 2025 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants