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

add_trigger inconsistencies #46

Closed
andrewgregory opened this issue Nov 4, 2014 · 2 comments
Closed

add_trigger inconsistencies #46

andrewgregory opened this issue Nov 4, 2014 · 2 comments

Comments

@andrewgregory
Copy link
Contributor

In create_trigger PostgreSQL and DB2 use the trigger action as-is, which matches the documentation for Trigger::action, but SQLite and MySQL wrap the trigger action in BEGIN ... END causing an error if the action already includes BEGIN ... END.

@ilmari
Copy link
Member

ilmari commented Nov 4, 2014

Thanks for the report. That is indeed inconsistent, but for backwards compatibility we can't just change these. But SQLite and MySQL could at least be changed to only add BEGIN/END if they're not already there.

andrewgregory added a commit to andrewgregory/sql-translator that referenced this issue Dec 14, 2014
Update Producer::SQLite and Producer::MySQL to only wrap the trigger
action in "BEGIN...END" when the user has not already done so to bring
them in line with other producers and the trigger documentation.

Fixes dbsrgits#46.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
andrewgregory added a commit to andrewgregory/sql-translator that referenced this issue Dec 14, 2014
Update Producer::SQLite and Producer::MySQL to only wrap the trigger
action in "BEGIN...END" when the user has not already done so, bringing
them in line with other producers and the add_trigger documentation.

Fixes dbsrgits#46.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
@ribasushi
Copy link
Contributor

Solved via e533bcddea

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

Successfully merging a pull request may close this issue.

3 participants