jmhobbs / kohana-3-migrations

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

Can't create stored procedures in migration script. #4

Open brazzy opened 12 years ago

brazzy commented 12 years ago

Migrations simply splits the script at semicolons to get queries. This fails with stored procedures, which exactly for that reason use the DELIMITER command to temporarily redefine the delimiter.

Here's a Stackoverflow answer where somone solved that problem, maybe you could ask them if you can use the code: http://stackoverflow.com/a/5025730/16883

jmhobbs commented 12 years ago

Thanks for opening an issue. I'm not a stored procedures guy, so I overlooked that. I'll see what I can do.

I've been working on another migration tool, K3-Migrate, which is more of a DSL for migrations rather than raw SQL. No stored procedures support there, but I'd appreciate some input on an API you think would be reasonable.

Thanks!

brazzy commented 12 years ago

Well this may be colored by my experience working with raw SQL, which has me feeling pretty comfortable with it - but I don't see the point in that. SQL is a DSL for database queries, so what problem can you solve by building a complex PHP API around it, that still won't cover everything? Stored procedures are probably the most obvious case: there is no sane way to do them that doesn't involve simply passing a string with the SQL script to the DB.