Fork me on GitHub

Should I just skip using these clojure libraries and just resort to using a mixture of sql + bash scripts?


I suspect you need a --;; between each statement


I haven't used ragtime, but I've used similar things and if I recall this has to do with jdbc


jdbc isn't the same as pasting sql statements in to a command line client (mysql, or psql), have to execute each statement as an individual thing, and in order to know how to split a .sql file into statements, a common convention is --;;


I forget exactly what the issue is with splitting on ';', I vaguely recall there is one (although our home grown migration library where I work now does split on ';' and it hasn't been a problem)


I think the issue with splitting on ';' is it breaks stored procedure definitions


@hiredman Does putting --;; between each line work when there are local vars? (i.e. SET @ins_id1 = LAST_INSERT_ID();) I tried this and it seems that the local var is null


my guess for that is you are running into a transaction issue


ragtime maybe executing each statement one by one effectively each in their own transaction, but I never use set like that, so I am not sure what the scope for those values is

hiredman17:04:47 and I guess there are issues running migrations in a transaction in the general case


Yeah I have this issue also. Rollback doesn't work properly 😞


Ok, I think I will try another migration lib then


actually, I bet that isn't a transaction thing, I bet ragtime isn't creating a single jdbc connection and running each statement, I bet it is creating a new sql connection for every statement