inheritance - sequelizejs, update attributes in inherit model -
i have model like:
---------------------- id | parent_id | sum 1 | nil | 100 2 | 1 | 30 3 | 1 | 70 ---------------------
if instance 3 changed sum 60, instance 1 's sum change 90 too.
currently, use afterupdate hook change parent's sum, may cause lot of sql find parent's instance.
any other suggestion??
Comments
Post a Comment