File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -618,11 +618,14 @@ export default class ConfigValidator implements IConfigValidator {
618618 errors . push ( `Resource "${ res . resourceId } " column "${ col . name } " isArray is enabled but suggestOnCreate is not an array` ) ;
619619 }
620620 }
621-
621+
622622 if ( col . foreignResource ) {
623623 if ( col . foreignResource . onDelete && ( col . foreignResource . onDelete !== 'cascade' && col . foreignResource . onDelete !== 'setNull' ) ) {
624624 errors . push ( `Resource "${ res . resourceId } " column "${ col . name } " has wrong delete strategy, you can use 'setNull' or 'cascade'` ) ;
625625 }
626+ if ( col . foreignResource . onDelete === 'setNull' && col . required ) {
627+ errors . push ( `Resource "${ res . resourceId } " column "${ col . name } " cannot use onDelete 'setNull' because column is required (non-nullable).` ) ;
628+ }
626629 if ( ! col . foreignResource . resourceId ) {
627630 // resourceId is absent or empty
628631 if ( ! col . foreignResource . polymorphicResources && ! col . foreignResource . polymorphicOn ) {
You can’t perform that action at this time.
0 commit comments