jmhobbs / kohana-3-migrations

A simple, SQL based migrations system for Kohana 3.
19 stars 6 forks source link

Enhance SQL query split #5

Closed dubbs closed 12 years ago

dubbs commented 12 years ago

This split will fail if migration has ';' within statement. Eg.

INSERT INTO x VALUES ('>');

jmhobbs commented 12 years ago

Thanks for the patch!

What about Windows boxes that use \r\n though?

jmhobbs commented 12 years ago

Perhaps we should replace the explode with preg_split ?

$queries = preg_split( "/;\r?\n/", $contents );

That could cover both possibilities, leaving aside the DELIMITER command for now :-)

dubbs commented 12 years ago

Good catch, updated accordingly.

jmhobbs commented 12 years ago

Thanks!