Closed sah-comp closed 3 years ago
For now I have dropped the validator hasName, thus allowing a empty contracttype.name in a contract. Once the (empty) name contracttype bean was created one can name it "Empty" and all things are good.
The constant CINNEBAR_MIP was introduced. When not migrating it is set to false, otherwise it is set to true.
This way a model can use something like the following code in its update function without jepardizing the correct column type guessing by RedBeanPHP while migrating. Before this the migrator was not able to have machine become a relation.
if (!CINNEBAR_MIP) {
if (!$this->bean->machine_id) {
unset($this->bean->machine);
}
}
e.g. a contract has no selected contracttype. When updating the machine bean used in that contract the validator hasValue on attribute name of contracttype fails because there is no name set.