I have the following migration file which I want to execute using go migrate
on a postgres database.
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE TABLE user
(
id UUID DEFAULT uuid_generate_v4 () PRIMARY KEY,
email TEXT NOT NULL UNIQUE,
password TEXT NOT NULL,
created_at TIMESTAMP without time zone NOT NULL DEFAULT NOW(),
updated_at TIMESTAMP without time zone
);
I get an error
Details: pq: syntax error at or near "user"
I have tried different online SQL syntax validators but couldn't find the issue.
Questions:
- What's the syntax error?
- How can I better debug it myself next time?