propelorm/Propel

Migration for SQLSRV creates MYSQL Syntax

Closed this issue · 7 comments

Doing a diff command it is making a migration and saying that every table has changed.

Basically for every table, it drops every constraint, then modifys the table structure, and then adds back all constraints.

Figured it out, the diff/migrate process for sqlsrv is actually creating the syntax for mysql so it script wont run. I have checked which reverse parser is being used, and it is using the sqlsrv parser, but I am not sure which class actually creates the migration script.

I dont mind looking into it and providing a fix if you should choose to assign it to me.

marcj commented

Unfortunately I dont have access to Microsoft SQL Server, so it would be very appreciated if you could fix it and send a pull request.

It should use anything from MySQL. MssqlPlatform extends DefaultPlatform. If you don't get MssqlPlatform as platform, maybe the Propel can't detect the platform based on your configuraiton: src/Propel/Generator/Command/MigrationDiffCommand.php:122

Alright marc I'll see what I can do when I have some time :) Im not the biggest expert with Git (Im a Mercurial guy) so I might get you to help me when I have a fix so I dont break the repo haha.

marcj commented

Ah, and please do it with https://github.com/propelorm/Propel2, v1 is not maintained anymore. :P

Been open for a long time. Will close and open new issues if not fixed in latest.