<div dir="ltr">I noticed that there is no enforcement at the DB level to require certain fields to be present on a model.<div><br></div><div>I haven't checked all the field types but at least for TextField it's seems to be true.</div><div>Even though `null` is False by default (`blank` as well), I can save a model instance without most of fields set.</div><div><br></div><div>As an example, for UpdateRecord [0] in RPM plugin, plugin writer can do UpdateRecord().save() and it will be fine, all the fields are set to empty string :/ It wouldn't be possible to save it twice but it's due to the uniqueness constraints.</div><div><br></div><div>In case plugin writer doesn't set properly all the required fields, bad/corrupted model instances will be silently saved in the DB and plugin can potentially have data migration issues later.</div><div><br></div><div>Any suggestions how to handle that? Or do I miss anything?</div><div><br></div><div>Tanya</div><div><br></div><div>[0] <a href="https://github.com/pulp/pulp_rpm/blob/master/pulp_rpm/app/models.py#L440-L463">https://github.com/pulp/pulp_rpm/blob/master/pulp_rpm/app/models.py#L440-L463</a></div></div>