Skip to content

MigrateDBConfig does not support pre-existing client and ensureDatabaseExists at the same time #74

@Tethik

Description

@Tethik

I noticed the createDb was marked as deprecated, so I moved to refactor my code to support the newer syntax.

In my client I'd like to do the following:

  client = await createPostgresPool(); 
  const config: MigrateDBConfig = {
    client,
    ensureDatabaseExists: true,
    defaultDatabase: databaseName,
  };
  await migrate(config, "src/data/migrations");

However, the type defined for MigrateDBConfig does not allow for ensureDatabaseExists at the same time with an existing client:

export type MigrateDBConfig =
| (ConnectionParams & {
readonly database: string
} & EnsureDatabase)
| ClientParams

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions