Error validating database
By default, database validation reports and releases only page structures.The cascading foreign key ensures that deleting an organization row will also delete any related user rows, preventing invalid foreign key references.Model validations, by contrast, provide a user interface around errors.However, it’s important to recognize that our schema constraints serve a different purpose than our model validations.
Schema constraints ensure the data persisted to our database, regardless of the source, is consistent and makes sense in the context of our domain.
Once we remove the validation from the model, that same scenario will result in an application error due to the constraint on that column in the database schema.
Error validating database comments