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

PostgresError: syntax error at or near "\" #39

Closed
bander-saeed94 opened this issue Jun 1, 2020 · 4 comments · Fixed by #43
Closed

PostgresError: syntax error at or near "\" #39

bander-saeed94 opened this issue Jun 1, 2020 · 4 comments · Fixed by #43
Assignees
Labels
bug Something isn't working

Comments

@bander-saeed94
Copy link
Contributor

bander-saeed94 commented Jun 1, 2020

When Running migrate with a create table that has timestampsTz().

The error:
Error:CREATE OR REPLACE FUNCTION trigger_set_timestamp() RETURNS TRIGGER AS $$ BEGIN NEW.updated_at = now(); RETURN NEW; END; $$ language 'plpgsql';CREATE TABLE tbl_user (id uuid PRIMARY KEY, username varchar (25) not null UNIQUE, email varchar (35) default null UNIQUE, phone_number numeric (12) default null UNIQUE, fullname varchar (40), password varchar (100), email_confirmed boolean default false, phone_number_confirmed boolean default false, created_at timestamptz (0) default current_timestamp, updated_at timestamptz (0) default current_timestamp); DROP TRIGGER IF EXISTS set_timestamp on tbl_user; CREATE TRIGGER set_timestamp BEFORE UPDATE ON tbl_user FOR EACH ROW EXECUTE PROCEDURE trigger_set_timestamp();INSERT INTO nessie_migrations (file_name) VALUES ('1590656398438-create-user-table.ts');
PostgresError: syntax error at or near "\"
at ClientPostgreSQL.query (https://deno.land/x/nessie/clients/ClientPostgreSQL.ts:50:13)
at async ClientPostgreSQL.migrate (https://deno.land/x/nessie/clients/AbstractClient.ts:83:9)
at async ClientPostgreSQL.migrate (https://deno.land/x/nessie/clients/ClientPostgreSQL.ts:62:5)
at async run (https://deno.land/x/nessie/cli.ts:62:11)

@bander-saeed94 bander-saeed94 added the bug Something isn't working label Jun 1, 2020
@halvardssm
Copy link
Owner

Hi! Unfortunately, during the transition from the previous to the new structure, updatedAt and updatedAtTz ended up with a bug. It's currently on the top of my list 👍

@Leonardo-Rocha
Copy link

I'm facing the same problem here. Waiting for a fix.
The other things are working pretty well, thanks @halvardssm !

@halvardssm
Copy link
Owner

@bander-saeed94 @Leonardo-Rocha version 0.5.1 is now released which fixes this issue 👍

@Leonardo-Rocha
Copy link

Working just fine now. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants