我有两个表在PostgreSQL
authentication_type
<表类>
id
名称
created_at
updated_at
tbody><<tr>c1cc0489 - 4740 - 4 - dca - 9 - d63 - 14 - e4c26093ad 密码 … … 表类>
你把布尔逻辑搞错了。您需要以下其中一个(或两个):
- type_id不是"password-id">
- 密码不为空
CHECK CONSTRAINT (
authentication_type_id != 'c1cc0489-4740-4dca-9d63-14e4c26093ad'
OR
password IS NOT NULL
)