Exclude table from migration

I have an existing table from another schema from supabase's auth.
const authSchema = pgSchema("auth");

export const users = authSchema.table("users", {
id: uuid("id").primaryKey(),
email: varchar("email", { length: 255 }),
raw_user_meta_data: jsonb("raw_user_meta_data").$type<RawUserMetaData>(),
});
const authSchema = pgSchema("auth");

export const users = authSchema.table("users", {
id: uuid("id").primaryKey(),
email: varchar("email", { length: 255 }),
raw_user_meta_data: jsonb("raw_user_meta_data").$type<RawUserMetaData>(),
});
I use this to access the data from the raw_user_meta_data of supabase. How do I exclude this users table from migrating?
2 Replies
rphlmr ⚡
rphlmr ⚡5d ago
You can exclude the authSchema in your drizzle config: https://orm.drizzle.team/kit-docs/config-reference#schemafilter
Drizzle ORM - Config Reference
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
rphlmr ⚡
rphlmr ⚡5d ago
Not sure the conf is used for migrations. If it is not the case, you could extract your auth schema related code in a separate file