timeoff-management / timeoff-management-application

Simple yet powerful absence management software for small and medium size business (community edition)
https://TimeOff.Management
MIT License
927 stars 577 forks source link

Migrations to be multiple execution tolerant #167

Closed vpp closed 7 years ago

vpp commented 7 years ago

As per #165 there was an issue with migration was executed on DB in state that do not need it.

Regarding migration mess: that needs to be fixed as well, I use mechanism defined here http://docs.sequelizejs.com/manual/tutorial/migrations.html But it is not imoplementted in TOM properly: there is a need to handle cases when repo was cloned after there are some migrations and after some time the db-update is executed (this is what happenned in your case). To eliminate this kind off issues migrations should be designed in a way that they could run more then once or when creating new DB application should seed the migrations table with those that should not be executed after.

Consider implementing one of options from above. Currently I am leaning toward seeding DB at creation point.

vpp commented 7 years ago

Done as part of #148.

Contrary to initial plan of seeding DB (with records in sequelizemeta table) I decided to go with migrations that tolerate multiple execution.

Why? Just being lazy...