0

I have a postgresql database, schema and username:password.

If i run:

sequelize db:migrate --config=./dist/options/db.options.js --migrations-path=./dist/migrations --env=main

...then i catch error:

CREATE SCHEMA IF NOT EXISTS my_schema;

**ERROR**: permission denied for database my_database

My user cannot create schema, but this schema already exists.

How i can to disable this step on sequelize migrations options?

It is my sequelize config:

const CONNECTION: any = {
    dialect: 'postgres',
    host: process.env.PG_HOST,
    port: parseInt(process.env.PG_PORT, 10),
    database: process.env.PG_DATABASE,
    username: process.env.PG_USERNAME,
    password: process.env.PG_PASSWORD,
    models: [
        ...
    ],
    autoLoadModels: true,
    sync: false,
    migrationStorage: "sequelize",
    migrationStorageTableName: genTableName('migrations'),
    migrationStorageTableSchema: process.env.PG_SCHEMA,
    logging: (...msg) => console.log(msg)
};

Google couldn't help me...

1 Answers1

0

I found answer on my question. In my situation need to remove key migrationStorageTableSchema from config.