Search code examples
postgresqlsequelize.jscreate-tabletablespace

create tables in tablespaces sequelize


I was looking around the squelize website, but couldn't find a way to say that I can say that a table should be created in a differnt tablespace. (I am using Postgres as a database)

Is there any way I can do that? Or do I have to write all "Create Table" Statements by myself?


Solution

  • If you by tablespace mean schema, you can pass that as an option when defining your model:

    sequelize.define('model', {
      ...
    }, {
      schema: 'whatever'
    });
    

    https://github.com/sequelize/sequelize/wiki/API-Reference-Sequelize#define