1.表添加条件唯一约束(组合唯一键:满足某种条件下才唯一)
create unique index 用户账号不允许重复 on "SU_User"("account") where "isDel"='0' and "state"!='关闭';
2.添加检查约束(数量必须大于0,单据必须大于0)
alter table "PRO_Work_Plan" add CONSTRAINT "约束名" check ( "count" > 0, "price" > 0 )
1.表添加条件唯一约束(组合唯一键:满足某种条件下才唯一)
create unique index 用户账号不允许重复 on "SU_User"("account") where "isDel"='0' and "state"!='关闭';
2.添加检查约束(数量必须大于0,单据必须大于0)
alter table "PRO_Work_Plan" add CONSTRAINT "约束名" check ( "count" > 0, "price" > 0 )