Skip to content

Option to remove database name from migrations #8012

@dotMortis

Description

@dotMortis

Feature Description

Two weeks ago, the name of the database was added to the migration queries.

The Problem

Unfortunately, this does not work for us. We have several systems with different database names (Dev, Staging, Production).
We urgently need an option to disable this behavior.

The Solution

The function needs an option to ignore the database name.

MysqlQueryRunner.ts

  /**
   * Escapes given table or view path.
   */
  protected escapePath(target: Table|View|string): string {
      const { database, tableName } = this.driver.parseTableName(target);

      if (database) {
          return `\`${database}\`.\`${tableName}\``;
      }

      return `\`${tableName}\``;
  }

Relevant Database Driver(s)

Every driver with this behaviour

Are you willing to resolve this issue by submitting a Pull Request?

  • ✖️ Yes, I have the time, and I know how to start.
  • ✖️ Yes, I have the time, but I don't know how to start. I would need guidance.
  • ✖️ No, I don’t have the time, but I can support (using donations) development.
  • ✅ No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions