vendredi 23 octobre 2015

Doctrine DBAL retrieving schema diff from two different platforms

I'm developing a tool to retrieve the schema differences between two databases that are stored on two different platforms, one in MySQL and the other in SQLite. I'm using the Doctrine DBAL package for this.

The problem is that when there are some differences, like if I add a new column, I get a lot of changes on the other columns:

ALTER TABLE posts DROP FOREIGN KEY posts_user_id_foreign
DROP INDEX posts_user_id_foreign ON posts
ALTER TABLE posts ADD intro VARCHAR(255) NOT NULL COLLATE BINARY, ADD image VARCHAR(255) NOT NULL COLLATE BINARY, CHANGE id id INT AUTO_INCREMENT NOT NULL, CHANGE user_id user_id INT NOT NULL, CHANGE title title VARCHAR(255) NOT NULL COLLATE BINARY, CHANGE body body LONGTEXT NOT NULL COLLATE BINARY, CHANGE created_at created_at DATETIME NOT NULL, CHANGE updated_at updated_at DATETIME NOT NULL

In this example result the only thing that I've really done is add two varchar columns in the posts table of the SQLite database. Any idea on which is the problem? Can't I compare schemas from different platforms?

Thanks in advise.

Aucun commentaire:

Enregistrer un commentaire