KamoCRM

Make orgs.alias unique platform-wide

FeatureInitializerService
Shipped
25 ஆகஸ்ட், 2026 அன்று 2:49 PM UTC
Author
Kamo
Commit
72cbd47

The column was never constrained. Survivable while an alias was only resolved as (security_provider_id, alias) behind a host, since two orgs under different providers could share one without ambiguity. Once an org can be named directly by its alias with ?org=, a repeat makes the reference ambiguous — the resolver refuses it rather than guessing, leaving BOTH orgs unreachable by alias. Applied to the live database, after renaming the six rows that collided (four sharing "acme-corp", two sharing "kia-kaha", all seeded the same day) with a numeric suffix. This is what gives a fresh environment the same index; the service has no CI, so pushing it ships nothing on its own. On lower(alias), because the alias is stored verbatim and Postgres equality is not case-insensitive: "Acme-Corp" and "acme-corp" resolve the same reference and must collide. Partial, because NULL or empty means "no alias" rather than a name being claimed, and any number of orgs may have none. Logs and continues if it cannot be created rather than failing the run — that means duplicates exist, and the create/update checks refuse new ones regardless.

All changes

Like what you see shipping?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing