Unexpected identifier 'TABLE'

I used drizzle-kit generate:pg to generate this schema
CREATE TABLE IF NOT EXISTS users (
user_id INT PRIMARY KEY,
username VARCHAR(255),
email VARCHAR(255)
);
CREATE TABLE IF NOT EXISTS users (
user_id INT PRIMARY KEY,
username VARCHAR(255),
email VARCHAR(255)
);
I tried to use drizzle-kit push:pg but I get this error
CREATE TABLE IF NOT EXISTS "users" (
^^^^^

SyntaxError: Unexpected identifier 'TABLE'
CREATE TABLE IF NOT EXISTS "users" (
^^^^^

SyntaxError: Unexpected identifier 'TABLE'
6 Replies
MAST
MAST16mo ago
I'm pretty sure drizzle-kit push doesn't use the generated migrations. It is similar to the prisma push command that syncs the database with your corrent schema without using migrations.
MajorAmari
MajorAmariOP16mo ago
That's what I'm trying to do but I get this error
No description
MAST
MAST16mo ago
Hmm, why is drizzle-kit push looking at the migration files. This is weird, I really don't know what's going on here. Have you tried running it with node to see if it's a bun problem?
MajorAmari
MajorAmariOP16mo ago
I tried npx
MAST
MAST16mo ago
OK, then Might be a drizzle-kit bug then.
MajorAmari
MajorAmariOP16mo ago
I felt so
Want results from more Discord servers?
Add your server