How to define constraint having two columns with boolean column to be true only once
0
votes
2
answers
638
views
Let the table to be considered is this:
create table users(
email varchar(50) not null,
is_verified boolean default false,
);
Now, how can I define the
exclusion
constraint here so that if the is_verified
column is true once for an email, that email ***cannot*** be inserted anymore?
Asked by Muzib
(103 rep)
Dec 23, 2022, 03:03 PM
Last activity: Dec 24, 2022, 10:10 AM
Last activity: Dec 24, 2022, 10:10 AM