searchPath problem
Author: tomasguerreiroCreated Jan 2, 2020Updated Sep 2, 2026
Labelsdocs
I am setting searchPath to method sync but it is still applying to 'public'
const schemaName = req.headers['x-tenant'];
conn.createSchema(schemaName).then((data) => {
console.log('> Schema criado com sucesso')
const options = {
schema: schemaName,
searchPath: schemaName
};
conn.sync(options);
});SET search_path to cliente_0010;
CREATE TABLE IF NOT EXISTS "public"."post" (
"id" SERIAL,
"title" VARCHAR(255),
"content" TEXT NOT NULL,
PRIMARY KEY ("id")
);Source: sequelize/sequelize