# DB synchro suspect behavior

**URL:** https://discuss.tryton.org/t/db-synchro-suspect-behavior/7052
**Category:** Developer
**Created:** [March 5, 2024, 10:05am UTC](https://discuss.tryton.org/t/db-synchro-suspect-behavior/7052 "2024-03-05T10:05:06Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![lb1975](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/l/d6d6ee/32.png) [@lb1975](https://discuss.tryton.org/u/lb1975)
#### Post date: [March 5, 2024, 10:05am UTC](https://discuss.tryton.org/t/db-synchro-suspect-behavior/7052/1 "2024-03-05T10:05:06Z")

</div>

Hi,

Sometimes after a lot of new dev, the system asks me for required fields when I try to save but these fields are filled and the only way I can solve the problem is to restore a dump of the version of the db before the new dev (“trytond-admin -d tradon --all” has no effect).  
So my question is what can I do to force the synchro between code and db without restoring all the db ?  
Is there certain table to drop or cache somewhere to delete ?  
The problem is on db side cause each time I restore it works without changing code.

KR,  
Laurent

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [March 5, 2024, 10:43am UTC](https://discuss.tryton.org/t/db-synchro-suspect-behavior/7052/2 "2024-03-05T10:43:09Z")

</div>

Some database schema changes must be handled by the developer like removing a required on a field.  
So such case must be managed explicitly in ` __register__ ` method using `TableHandler`.

---

<div class="post-metadata">

### Author: ![lb1975](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/l/d6d6ee/32.png) [@lb1975](https://discuss.tryton.org/u/lb1975)
#### Post date: [March 5, 2024, 1:35pm UTC](https://discuss.tryton.org/t/db-synchro-suspect-behavior/7052/3 "2024-03-05T13:35:04Z")

</div>

We always have the choice between managing the changes in **register** or directly updated the db ?  
I don’t find any required column in ir\_model\_field, where is it managed ?

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [March 5, 2024, 1:57pm UTC](https://discuss.tryton.org/t/db-synchro-suspect-behavior/7052/4 "2024-03-05T13:57:22Z")

</div>

A required is transformed in the database schema as `NOT NULL`.

---

<div class="post-metadata">

### Author: ![lb1975](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/l/d6d6ee/32.png) [@lb1975](https://discuss.tryton.org/u/lb1975)
#### Post date: [March 5, 2024, 2:33pm UTC](https://discuss.tryton.org/t/db-synchro-suspect-behavior/7052/5 "2024-03-05T14:33:31Z")

</div>

oh yes sure tks Cédric
