HomeDevCentral

Check table and view existence

Description

Check table and view existence

Summary:
An example of use is Zed site health check for database views.
This check detect frequent import/export issues with views:

$notExistingViews = Vector::from(self::DOCUMENTED_VIEWS)
    ->filter(fn($view) => !$this->db->isExistingTable(
        $this->config['database']['database'],
        $view
    ));
$viewsAsTables = Vector::from(self::DOCUMENTED_VIEWS)
    ->filter(fn($view) => !$this->db->isView(
        $this->config['database']['database'],
        $view
    ));

Ref T1678.

Reviewers: dereckson

Reviewed By: dereckson

Maniphest Tasks: T1678

Differential Revision: https://devcentral.nasqueron.org/D2511

Details

Provenance
derecksonAuthored on Feb 11 2022, 00:21
derecksonPushed on Feb 11 2022, 00:52
Reviewer
dereckson
Differential Revision
D2511: Check table and view existence
Parents
rKDBe1e0aef48405: Provide small MySQL schema for unit tests
Branches
Unknown
Tags
Unknown
Tasks
T1678: Health check and reporting library