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

function not created when run from sql file #22

Closed
baverbud opened this issue Aug 29, 2017 · 1 comment
Closed

function not created when run from sql file #22

baverbud opened this issue Aug 29, 2017 · 1 comment

Comments

@baverbud
Copy link

baverbud commented Aug 29, 2017

The following runs fine in postgres, but when part of a migration in a .sql file, I get the error "error: function update_trigger_status() does not exist":

CREATE FUNCTION update_trigger_status()
RETURNS TRIGGER AS $$
BEGIN
  NEW.last_active_flip := CASE WHEN NEW.active <> OLD.active AND NEW.active = 't' THEN now()
                                 ELSE OLD.last_active_flip END;
  NEW.last_inactive_flip := CASE WHEN NEW.active <> OLD.active AND NEW.active = 'f' THEN now()
                                 ELSE OLD.last_inactive_flip END;
  RETURN NEW;
END;
$$ language 'plpgsql';

node-db-migrate version: 0.10.0-beta.23
db-migrate-pg version: 0.2.5

tried other delimiters, didn't work. The plpgsql extension is installed.

@baverbud
Copy link
Author

Arg, this is completely unrelated and an issue elsewhere in the migration script. Closing.

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

1 participant