Here’s another one of my somewhat great, possibly ridiculous ideas. But first, the scenario:
I have my live site and development site, use TVs extensively (45 total). I often found it difficult to synchronize the live and development sites because of this. Here’s the reason why:
The Primary Key of the [tt]site_tmplvar_contentvalues[/tt] is an arbitrary column: [tt]id[/tt]. So if, for instance changes have been made to the live site, new TV contents have been added, and an id tag added to each, but I then also have made changes/additions of a different nature to other TV contents on my development site, those will possibly receive the same id tag. So when synchronization time comes, there’s a conflict.
I’m using Navicat to synchronize the two databases.
This problem still exists in 0.9.7, unless the plan for MODx is to create processors that check for this kind of conflict. In which case I will shut up
What I propose is that we drop the ’id’ column in the table, and have [tt]tmplvarid[/tt] & [tt]contentid[/tt] form the Primary key, I have somewhat tested this in xPDO and it appears to work fine.
-- An example of what I mean (don't actually execute this)
ALTER TABLE `modx_site_tmplvar_contentvalues` DROP `id`;
ALTER TABLE `modx_site_tmplvar_contentvalues` ADD PRIMARY KEY ( `tmplvarid` , `contentid` );
I have no idea how this will affect MODx in the long run, nor do I know how difficult it would be to implement in the next release of MODx (0.9.7). What do you think?