Fix schema-sync indexes for non-default PostgreSQL schemas (#3084)
Indexes generated from `#[sea_orm(indexed)]` and `#[sea_orm(unique_key = "...")]` on an entity with a `schema_name` are now created against the schema-qualified table on PostgreSQL (e.g. `ON "sys"."app_user"` instead of `ON "app_user"`), fixing schema-sync failures (`relation "..." does not exist`) and wrong-schema targeting. Entities without a `schema_name` are unaffected. MySQL and SQLite keep using unqualified index targets — SeaQuery's index builders for those backends panic on a schema-qualified reference. Routing both index-generation paths through a shared backend-aware helper also fixes a latent panic when syncing a `#[sea_orm(unique)]` column on a `schema_name` entity against MySQL/SQLite. Closes #3084. Co-authored-by: oywm <2656771275@qq.com>
C
Chris Tsang committed
4b2b075d2d8aec75d1631ac9b682af2dcda3b305
Parent: 16d1433
Committed by GitHub <noreply@github.com>
on 6/16/2026, 12:54:13 PM