Skip to content

Better error message change domain#6462

Open
aerosol wants to merge 3 commits into
masterfrom
better-error-message-change-domain
Open

Better error message change domain#6462
aerosol wants to merge 3 commits into
masterfrom
better-error-message-change-domain

Conversation

@aerosol

@aerosol aerosol commented Jun 25, 2026

Copy link
Copy Markdown
Member

Two UX improvements for domain change:

  1. Owning one.example.com and two.example.com, it's now possible to swap the names via triple rename. This used to be impossible due to domain_changed_from constraint clash.
  2. Better error message if trying to change site's domain to an already owned one
2026-06-25_14-56-45_vice

Migration will be extracted once review is concluded.

BEGIN
IF EXISTS (
SELECT 1 FROM sites
WHERE (NEW.domain = domain_changed_from AND NEW.id != id AND (team_id IS NULL OR NEW.team_id IS NULL OR team_id != NEW.team_id))

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically we take a good care to prevent site.team_id from ever being NULL (wondering if we can now use regular DB constraint to guarantee that), but the additional check here shouldn't hurt.

@aerosol aerosol requested a review from a team June 25, 2026 13:00
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.

1 participant