Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_split_sql_chunk doesn't handle CREATE FUNCTION in Pg #26

Closed
osfameron opened this issue Aug 12, 2014 · 2 comments
Closed

_split_sql_chunk doesn't handle CREATE FUNCTION in Pg #26

osfameron opened this issue Aug 12, 2014 · 2 comments

Comments

@osfameron
Copy link

I'm getting an error while trying to move this SQL to a DBIC::Migration

https://github.com/mysociety/fixmystreet/blob/master/db/schema.sql#L21
DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::deploy(): DBI Exception: DBD::Pg::db do failed: ERROR:  unterminated quoted string at or near "' declare today date"
LINE 1: ...ction ms_current_timestamp() returns timestamp as ' declare ...
                                                             ^ at /var/www/fixmystreet.127.0.0.1.xip.io/fixmystreet/local/lib/perl5/x86_64-linux-gnu-thread-multi/Moose/Meta/Method/Delegation.pm line 110

As far as I can tell, the problem seems to be _split_sql_chunk in DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm which chunks by ";" (which are present within the body of the function.)

Presumably this should instead be using something like Text::Balanced?

@frioux
Copy link
Owner

frioux commented Aug 12, 2014

This should be solved by #11. If you find the time to fix that, that would solve this and so many other issues.

@osfameron
Copy link
Author

Closing as per @frioux's comment -- in mean time I've worked around with a wrapped around DBIC::Migration at https://github.com/mysociety/fixmystreet/blob/db-migrations/bin/migrate#L10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants