Adding a computed column will result in a script like this:
ALTER TABLE [xxx].dbo.Contact ADD Address1Composite AS COALESCE(Address1Line1 + ' ', '') + COALESCE(Address1Line2 + ' ', '') + COALESCE(Address1Line3 + ' ', '') + COALESCE(Address1City + ' ', '') + COALESCE(Address1Province + ' ', '') + COALESCE(Address1PostalCode, '') NULL
Causing the error:
Only UNIQUE or PRIMARY KEY constraints can be created on computed columns, while CHECK, FOREIGN KEY, and NOT NULL constraints require that computed columns be persisted.
Thank you for writing about this issue.
A fix will be available tomorrow under: https://dbschema.com/beta.php
The version number will be the same, the build number will increase.
DbSchema 9.1.3 build 221114
Adding a computed column will result in a script like this: ALTER TABLE [xxx].dbo.Contact ADD Address1Composite AS COALESCE(Address1Line1 + ' ', '') + COALESCE(Address1Line2 + ' ', '') + COALESCE(Address1Line3 + ' ', '') + COALESCE(Address1City + ' ', '') + COALESCE(Address1Province + ' ', '') + COALESCE(Address1PostalCode, '') NULL
Causing the error: Only UNIQUE or PRIMARY KEY constraints can be created on computed columns, while CHECK, FOREIGN KEY, and NOT NULL constraints require that computed columns be persisted.
Dropping the NULL solves the issue. See last post of https://stackoverflow.com/questions/45727140/sql-only-unique-or-primary-key-constraints-can-be-created-on-computed-columns