-
Notifications
You must be signed in to change notification settings - Fork 333
Description
Try adding this formula constraint to a table: !(name==="roderick" && phone==null)
(both of these are String fields). The constraint is not added, no error message appears.
Two things are broken:
-
it's normal that some formulae cannot be translated to SQL. Constraints are checked in javascript as well. what is meant to happen is that if the constraint is created with an untranslatable formula, the SQL errors on the
ALTER TABLE
... ADD CONSTRAINT` statement, and this error is ignored. but this has probably been broken since the introduction of transactions, so now the row in _sc_table_constraints is not created at all. -
This formula is translated as:
not (((first_name)==(roderick))and(phone is null))
- this is close but invalid SQL. Make sure string literals are in single quotes, and single=
instead of==