Closed brettshearer closed 2 years ago
I don't really understand the workflow of these rules. But we have the automation scripts ( see Help / Automation Scripts ), which you can use to implement custom code in DbSchema, with direct access to the API. Is this something that could help? Please send more details about these rules, just to understand the workflow.
These are schema design rules that guide the addition of indexes or constraints. An example would be that the majority of numeric values in a system actually should be constrained to disallow negative values (especially physical attributes such as height, length etc). I currently use a combination of automation (adding the constraint when the attribute is added) and unit tests (run before the Pull request is accepted).
What I was wondering is whether these sorts of rules could be run from within DBSchema, rather than outside.
Yes, the automation scripts I wrote about should cover these cases. Please evaluate them.
Best regards, Dragos Pruteanu
Example : it is unlikely that adding extra key fields after a date/time column in a non-unique index will ever be used as part of the seek (they may end up being a predicate lookup though).
I currently have about 100 of these rules that I run on the SQL schema as part of an automated suite. If this can be done earlier (with codified rules in DBSchema) then an entire development iteration could be avoided. Override could be recorded in the designer.