Error when trying to push to supabase

I just set up a new supabase project and was trying to set up some schema, but I found I can't push more than once. The first push works fine, after that I keep getting this error on drizzle-kit push:
[⢿] Pulling schema from database...
/Users/myuser/test-project/node_modules/drizzle-kit/bin.cjs:19334
if (column7.column_default.endsWith("[]")) {
^
TypeError: Cannot read properties of undefined (reading 'endsWith')
[⢿] Pulling schema from database...
/Users/myuser/test-project/node_modules/drizzle-kit/bin.cjs:19334
if (column7.column_default.endsWith("[]")) {
^
TypeError: Cannot read properties of undefined (reading 'endsWith')
This is my entire schema:
export const users = pgTable("users", {
id: serial("id").primaryKey(),
username: text("username").notNull(),
});

export const books = pgTable("books", {
id: serial("id").primaryKey(),
title: text("title").notNull(),
});
export const users = pgTable("users", {
id: serial("id").primaryKey(),
username: text("username").notNull(),
});

export const books = pgTable("books", {
id: serial("id").primaryKey(),
title: text("title").notNull(),
});
Any ideas what I can try to debug the issue? I found that if I only have 1 table, pushing is fine and I can keep updating the schema for that table and pushing it, but with more than one table in the db/schema, I get the above error.
9 Replies
rajat.abcx
rajat.abcx2w ago
hey I am also facing the same issue, did you managed to fix it? if not any idea how to do it?
Firee
Firee2w ago
Same issue, was this solved by anyone Bump
theBarracuda
theBarracuda2w ago
same issue here. I've not changed anything in codebase or supabase dashboard since yday. So might be supabase issue
Firee
Firee2w ago
The problem is in the drizzle bin.cjs file @the.barracuda . Are you sure it is on supabase?
theBarracuda
theBarracuda2w ago
no, I'm not
Dezii
Dezii2w ago
Getting the same issue when pulling. My first pull worked, but then it gave me this error after adding a new table
Firee
Firee2w ago
Hi @rajat.abcx @the.barracuda @Dezii I tried using neon db instead of supabase. It is working fine now. So in short, this might really be a supabase problem
Dezii
Dezii2w ago
Appreciate the update man
theBarracuda
theBarracuda2w ago
i knew it was kinda related to supabase thanks for your feedback
Want results from more Discord servers?
Add your server