CREATE TABLE employee (
id varchar(40) NOT NULL,
legacy_id varchar(40) NOT NULL,
short_name varchar(255) NULL,
is_deleted bool NOT NULL DEFAULT false,
CONSTRAINT employee_pkey PRIMARY KEY (id)
)
I want to plan for unique constraint like this
The table must have these constraint
1. Unique constraint is required on column 'legacy_id' and 'is_deleted = false'. Its okay to have multiple values with legacy_id and is_deleted = true.
Is there any way to achieve this