public function executeSchema($path, $track = true) {
        if (!file_exists($path)) {
            throw new DomainException(sprintf('<error>Schema %s does not exist</error>', basename($path)));
        }

        $contents = file_get_contents($path);
        $contents = String::insert($contents, array('prefix' => $this->tablePrefix), array('before' => '{', 'after' => '}'));
        $contents = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $contents);

        $queries = explode(';', $contents);
        $executed = 0;

        foreach ($queries as $query) {
            $query = trim($query);

            if (!$query) {
                continue;
            }

            if ($this->db->execute($query)) {
                $command = trim(substr($query, 0, strpos($query, ' ')));

                if ($track) {
                    if ($command === 'CREATE' || $command === 'ALTER') {
                        $executed++;
                    }
                } else {
                    $executed++;
                }
            }
        }

        return $executed;
    }