cakephp - Multiple databases running different sites - same database structure - how to update all? -
there multiple, ever-increasing number of sites run off single instance of cms (built in cakephp) on single server array. cms has set database structure, need updating regularly - new fields, changing names of fields, new tables ...etc.
i can't wrap head around way 1) keep sites having own databases (seemingly ideal), two, basing them off same, regularly-updated database structure.
so far thought keep single "template" database, , update that, write script compare , update - then, how know if field changed, or if new field, , previous field deleted...etc etc etc. i'm sure haven't thought of problems cause. advice appreciated.
you use migrations tool https://github.com/cakedc/migrations. basic idea behind migrations have kind of version control database schema, each migration representing "commit" describing changes (like add table, rename field, etc.) should applied database schema.
Comments
Post a Comment