Skip to content

Wrap instance reporting for database schema in an API #30877

@miaulalala

Description

@miaulalala

Problem

Currently, we're checking for the Database Type of an instance something like this:

$schema->getDatabasePlatform() instanceof PostgreSQL94Platform

If we ever change the underlying structure, these checks might break.

Proposed solution

Add a new API method for ISchemaWrapper that will return the database type as a string and a few constants that map to the supported databases to compare the Database string too:

public CONST PostgreSQL94Platform = 'PostgreSQL94Platform';
....

public function getDatabaseType(): string;

Context

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