public function createTable()
    {
        if ($this->tableExists() === true) {
            return true;
        }

        $dbh      = $this->db();
        $driver   = $dbh->getAttribute(PDO::ATTR_DRIVER_NAME);
        $model    = $this->model();
        $metadata = $model->metadata();

        $table   = $this->table();
        $fields  = $this->getModelFields($model);
        $columns = [];
        foreach ($fields as $field) {
            $columns[] = $field->sql();
        }

        $query  = 'CREATE TABLE  `'.$table.'` ('."\n";
        $query .= implode(',', $columns);

        $key = $model->key();
        if ($key) {
            $query .= ', PRIMARY KEY (`'.$key.'`) '."\n";
        }

        /** @todo Add indexes for all defined list constraints (yea... tough job...) */
        if ($driver === self::MYSQL_DRIVER_NAME) {
            $engine = 'InnoDB';
            $query .= ') ENGINE='.$engine.' DEFAULT CHARSET=utf8 COMMENT="'.addslashes($metadata['name']).'";';
        } else {
            $query .= ');';
        }

        $this->logger->debug($query);
        $dbh->query($query);

        return true;
    }