Interesante script que permite dados dos estructuras del MySQL, obtenidas por ejemplo usando un mysqldump, ver que diferencias hay entre ambos y devuelve las queries necesarias para igualar las dos estrucuras.
Por ejemplo, si tenemos la estructura siguiente:
CREATE TABLE IF NOT EXISTS `archive` (
`id` int(11) NOT NULL auto_increment,
`topFile` varchar(255) NOT NULL default '',
`msgId` int(11) NOT NULL default '0',
`time` timestamp NOT NULL default CURRENT_TIMESTAMP,
`topTpl` varchar(255) NOT NULL default '',
`file` varchar(255) NOT NULL default '',
`template` varchar(255) NOT NULL default '',
`instanceKey` varchar(255) NOT NULL default '',
`orderby` varchar(25) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=10256 ;
Y este otro:
CREATE TABLE IF NOT EXISTS `archive` (
`id` int(11) NOT NULL auto_increment,
`topFile` varchar(255) NOT NULL default '',
`msgId` int(11) NOT NULL default '0',
`time` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`topTpl` varchar(255) NOT NULL default '',
`file` varchar(255) NOT NULL default '',
`template` varchar(255) NOT NULL default '',
`instanceKey` varchar(255) NOT NULL default '',
`encoding` varchar(50) NOT NULL default '',
`orderby` varchar(255) NOT NULL default '',
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=10256 ;
Nos devolvería las siguientes sentencias:
ALTER TABLE `archive` ADD `encoding` varchar(50) NOT NULL;
ALTER TABLE `archive` MODIFY `orderby` varchar(255) NOT NULL;
ALTER TABLE `archive` MODIFY `time` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP;
ALTER TABLE `archive` DROP PRIMARY KEY;
Un script bastante útil cuando, debido al despiste, tenemos diferencias entre la base de datos de desarrollo y la de producción y no sabemos qué cambios hemos realizado.
Database structure synchronizer
Dale un ojito a estas (las ultimas 2 llevan poco tiempo de desarrollo aun):
Excel
http://phpexcel.codeplex.com/
Powerpoint
http://phppowerpoint.codeplex.com/
Word
http://phpword.codeplex.com/
Gracias Taufpate, las conocÃa, es más, estoy deseando que finalicen la de Powerpoint 🙂
Saludos