You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi guys, I've been looking for how to set a constraint on the table schema to prevent a row from having 2 values of a certain value.
As shown in the example below, I am trying to prevent a row from having a account_type set to super_admin and status not set to active at the same time.
The docs explain how to set constraints for things like unique values, but I didn't find anything about not allowing certain values.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi guys, I've been looking for how to set a constraint on the table schema to prevent a row from having 2 values of a certain value.
As shown in the example below, I am trying to prevent a row from having a
account_type
set tosuper_admin
andstatus
not set toactive
at the same time.The docs explain how to set constraints for things like unique values, but I didn't find anything about not allowing certain values.
Beta Was this translation helpful? Give feedback.
All reactions