public function getTablesFromSQL($sql) {
        $p      = '/CREATE\s+TABLE\s+(IF\s+NOT\s+EXISTS\s+)?([^\(]+)/mi';
        $tables = [];
        $views  = [];
        if (preg_match_all($p, $sql, $ms, PREG_SET_ORDER)) {
            foreach ($ms as $m) {
                if (count($m) == 3) {
                    $table = $m [2];
                } else {
                    $table = $m [1];
                }
                if ($table) {
                    $table     = trim(trim($table, '` '));
                    $tables [] = str_replace('{prefix}', $this->tablePrefix, $table);
                }
            }
        }
        $p = '/CREATE\s+VIEW\s+(IF\s+NOT\s+EXISTS\s+)?(.+?)\s+AS/mi';
        if (preg_match_all($p, $sql, $ms, PREG_SET_ORDER)) {
            foreach ($ms as $m) {
                if (count($m) == 3) {
                    $table = $m [2];
                } else {
                    $table = $m [1];
                }
                if ($table) {
                    $table    = trim(trim($table, '` '));
                    $views [] = str_replace('{prefix}', $this->tablePrefix, $table);
                }
            }
        }

        return ['tables' => $tables, 'views' => $views];
    }