Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Create schema as well as knex_migrations table when running migrations for the first time. #5374

@dsluo

Description

@dsluo

Environment

Knex version: 2.3.0
Database + version: Postgres 14.1
OS: Ubuntu 20.04

Feature discussion / request

The Knex config specifies a schemaName to use for the knex_migrations table, but doesn't actually create the specified schema when running migrations for the first time (at least as far as I can tell). It'd be nice if there was an option to have this created during initial setup of the migration tables. Could add something like:

const config: Knex.Config = {
  ...
  migrations: {
    schemaName: '<migration specific table>',
    createSchema: true,
    ...
  }
}

This may already exist, but I'm not finding it. If it does, please point me in the right direction.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions