Should a unique constraint be set both in the model and the database?
<p>I'm building an application using the MVC pattern using ORM, and I'm struggling to understand what the 'best practice' for setting default values and constraints in the models and the migration (database).</p>

<p>Is it recommended to set validations both in the model and the database or just one of them? And if the latter, which one?</p>