Extending Migrations

Is it possible to have 1 migration inherit from another migration ?



use \dstransfer\migrations\m161220_120101_dstransfer_transfer;





class m161002_132190_dstransfer_freepost_policy_stamp extends m161220_120101_dstransfer_transfer


gives me the error



Error: Cannot declare class m161220_120101_dstransfer_transfer, because the name is already in use


There are a few tables that look very similar, so I though I might as well extend then and do only the differences in the children.

No. Create two migrations

actually it does seem possible… forgot the namespace in the parent migration file

Nice. But why bother?

The main reason is there are about 20 fields that are common and only 1 or 2 that are differnet. This way extending the 20 fields reduces the possiblity of mistakes in updating the other tables

Are you sure of the correctness of your db architecture?

YEs…

The thing is I have a bunch of settings that need to be in the DB. The settings are based on a policy (hence I have a policy table with the settings and a settings table that contain by default the policy settings BUT these are also editable (without changing the policy setting