classes/Peyote/Create.php
public function compile()
	{
		$query = array("CREATE", $this->getType());

		if ($this->getIfExists() === true)
		{
			$query[] = "IF NOT EXISTS";
		}

		$query[] = $this->getTable();
		$query[] = "(";

		$columns = array();
		foreach ($this->getColumns() as $column)
		{
			if ($column instanceof \Peyote\Column)
			{
				if ($column->isPrimaryKey())
				{
					$this->addPrimaryKey($column->getName());
				}

				$column = $column->compile();
			}

			$columns[] = $column;
		}

		if ( ! empty($this->primary_key))
		{
			$columns[] = "PRIMARY KEY (".join(', ', $this->primary_key).')';
		}

		$query[] = join(', ', $columns);
		$query[] = ")";

		$query[] = 'ENGINE='.$this->getEngine();
		$query[] = 'DEFAULT CHARSET='.$this->getCharset();

		return join(' ', $query);
	}
public function compile()
	{
		$query = array("CREATE", $this->getType());

		if ($this->getIfExists() === true)
		{
			$query[] = "IF NOT EXISTS";
		}

		$query[] = $this->getTable();
		$query[] = "(";

		$columns = array();
		foreach ($this->getColumns() as $column)
		{
			if ($column instanceof \Peyote\Column)
			{
				if ($column->isPrimaryKey())
				{
					$this->addPrimaryKey($column->getName());
				}

				$column = $column->compile();
			}

			$columns[] = $column;
		}

		if ( ! empty($this->primary_key))
		{
			$columns[] = "PRIMARY KEY (".join(', ', $this->primary_key).')';
		}

		$query[] = join(', ', $columns);
		$query[] = ")";

		$query[] = 'ENGINE='.$this->getEngine();
		$query[] = 'DEFAULT CHARSET='.$this->getCharset();

		return join(' ', $query);
	}
{@inheritDoc}