We've found duplicated view name across public schema [But there is not a duplicated view]

After I upgrade the drizzle-kit from: drizzle-kit: ^0.24.0 to drizzle-kit: ^0.31.4 When I ran the command: drizzle-kit generate This error shows:
> dotenv -e ../../.env -- "drizzle-kit" "generate"

No config path provided, using default 'drizzle.config.ts'
Reading config file '......../drizzle.config.ts' (modified to not expose)

Warning We've found duplicated view name across public schema. Please rename your view
 ELIFECYCLE  Command failed with exit code 1.
> dotenv -e ../../.env -- "drizzle-kit" "generate"

No config path provided, using default 'drizzle.config.ts'
Reading config file '......../drizzle.config.ts' (modified to not expose)

Warning We've found duplicated view name across public schema. Please rename your view
 ELIFECYCLE  Command failed with exit code 1.
But after double checking (triple) we have not a duplicated view or materialized view. I dont know what is wrong: look the drizle config file:
import type { Config } from "drizzle-kit"

if (!process.env.POSTGRES_URL) {
throw new Error("Missing POSTGRES_URL")
}

const nonPoolingUrl = process.env.POSTGRES_URL.replace(":6543", ":5432")

export default {
schema: "./src/schema",
dialect: "postgresql",
out: "../../supabase/migrations",
migrations: {
prefix: "supabase"
},
verbose: true,
strict: true,
dbCredentials: { url: nonPoolingUrl }
} satisfies Config
import type { Config } from "drizzle-kit"

if (!process.env.POSTGRES_URL) {
throw new Error("Missing POSTGRES_URL")
}

const nonPoolingUrl = process.env.POSTGRES_URL.replace(":6543", ":5432")

export default {
schema: "./src/schema",
dialect: "postgresql",
out: "../../supabase/migrations",
migrations: {
prefix: "supabase"
},
verbose: true,
strict: true,
dbCredentials: { url: nonPoolingUrl }
} satisfies Config
I really need to figure out!
1 Reply
JustWayne
JustWayne3mo ago
Try adding schema: "public" to your migrations e.g.
migrations: {
prefix: "supabase",
schema: "public",
// table: "__drizzle_migrations", // Default: "__drizzle_migrations"
},
migrations: {
prefix: "supabase",
schema: "public",
// table: "__drizzle_migrations", // Default: "__drizzle_migrations"
},
This fixed some other migration issues for me with Supabase.

Did you find this page helpful?