schemaFilter not working as expected
I've got this on my
And this is my
When I run
So, the
This is on the latest
drizzle.config.tsdrizzle.config.ts:schemaFilter: "public",schemaFilter: "public",And this is my
schema.tsschema.ts:import { InferSelectModel } from "drizzle-orm";
import {
bigint,
boolean,
jsonb,
pgSchema,
pgTable,
text,
timestamp,
} from "drizzle-orm/pg-core";
export const todos = pgTable(
"todos",
{
id: bigint("id", { mode: "bigint" })
.primaryKey()
.generatedByDefaultAsIdentity(),
userId: text("user_id")
.notNull(),
task: text("task").notNull(),
isComplete: boolean("is_complete").notNull().default(false),
insertedAt: timestamp("inserted_at", { withTimezone: true })
.defaultNow()
.notNull(),
},
);
// Filter out the neon_identity schema in `drizzle.config.ts` in order to NOT generate the schema for it.
export const neonIdentitySchema = pgSchema("neon_identity");
export const users = neonIdentitySchema.table("users_sync", {
rawJson: jsonb("raw_json").notNull(),
id: text().primaryKey().notNull(),
name: text(),
email: text(),
createdAt: timestamp("created_at", { withTimezone: true, mode: 'string' }),
deletedAt: timestamp("deleted_at", { withTimezone: true, mode: 'string' }),
});
export type Todo = InferSelectModel<typeof todos>;import { InferSelectModel } from "drizzle-orm";
import {
bigint,
boolean,
jsonb,
pgSchema,
pgTable,
text,
timestamp,
} from "drizzle-orm/pg-core";
export const todos = pgTable(
"todos",
{
id: bigint("id", { mode: "bigint" })
.primaryKey()
.generatedByDefaultAsIdentity(),
userId: text("user_id")
.notNull(),
task: text("task").notNull(),
isComplete: boolean("is_complete").notNull().default(false),
insertedAt: timestamp("inserted_at", { withTimezone: true })
.defaultNow()
.notNull(),
},
);
// Filter out the neon_identity schema in `drizzle.config.ts` in order to NOT generate the schema for it.
export const neonIdentitySchema = pgSchema("neon_identity");
export const users = neonIdentitySchema.table("users_sync", {
rawJson: jsonb("raw_json").notNull(),
id: text().primaryKey().notNull(),
name: text(),
email: text(),
createdAt: timestamp("created_at", { withTimezone: true, mode: 'string' }),
deletedAt: timestamp("deleted_at", { withTimezone: true, mode: 'string' }),
});
export type Todo = InferSelectModel<typeof todos>;When I run
drizzle-kit generatedrizzle-kit generate, for some reason I still get:CREATE SCHEMA "neon_identity";
...
CREATE TABLE "neon_identity"."users_sync" (
...CREATE SCHEMA "neon_identity";
...
CREATE TABLE "neon_identity"."users_sync" (
...So, the
schemaFilterschemaFilter is not working... It's still trying to generate the neon_identityneon_identity schema which it should be skipping.This is on the latest
drizzle-kitdrizzle-kit, btw, 0.30.1.