#11784·sequelize

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'

javascript
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);
});
sql
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")
);