-- Flyway migration V2 — fix usr_user username uniqueness to per-tenant scope
-- Generated: 2026-05-08
-- Reason: uk_usr_user_username was globally unique; same username must be allowed across different brands (sBrandsId)
-- New unique constraint: (sUsername, sBrandsId) composite

ALTER TABLE usr_user DROP INDEX uk_usr_user_username;
CREATE UNIQUE INDEX uk_usr_user_username_tenant ON usr_user (sUsername, sBrandsId);
