Skip to content

Drop unique index doesn't work for PostgreSQLΒ #2994

@Legend-Master

Description

@Legend-Master

Description

After removing unique constraint on a column and on the next schema sync to Postgres, I get cannot drop index test_user_id_key because constraint test_user_id_key on table orders requires it from sea-orm running DROP INDEX "test_user_id_key"

This works for SQLite though

Steps to Reproduce

  1. Add #[sea_orm(unique)] to a column, and run schema sync
  2. Remove #[sea_orm(unique)] and run again

Expected Behavior

unique constraint removed

Actual Behavior

Schema sync failed

Reproduces How Often

Always

Workarounds

Drop the constraint manually

Versions

2.0.0-rc.37

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions