adding zend project folders into old campcaster.
This commit is contained in:
parent
56abfaf28e
commit
7ef0c18b26
4045 changed files with 1054952 additions and 0 deletions
|
@ -0,0 +1,119 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Propel package.
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
* @license MIT License
|
||||
*/
|
||||
|
||||
require_once 'builder/sql/DDLBuilder.php';
|
||||
|
||||
/**
|
||||
* The SQL DDL-building class for SQLite.
|
||||
*
|
||||
*
|
||||
* @author Hans Lellelid <hans@xmpl.org>
|
||||
* @package propel.generator.builder.sql.pgsql
|
||||
*/
|
||||
class SqliteDDLBuilder extends DDLBuilder
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
* @see parent::addDropStatement()
|
||||
*/
|
||||
protected function addDropStatements(&$script)
|
||||
{
|
||||
$table = $this->getTable();
|
||||
$platform = $this->getPlatform();
|
||||
|
||||
$script .= "
|
||||
DROP TABLE ".$this->quoteIdentifier($table->getName()).";
|
||||
";
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see parent::addColumns()
|
||||
*/
|
||||
protected function addTable(&$script)
|
||||
{
|
||||
$table = $this->getTable();
|
||||
$platform = $this->getPlatform();
|
||||
|
||||
$script .= "
|
||||
-----------------------------------------------------------------------------
|
||||
-- ".$table->getName()."
|
||||
-----------------------------------------------------------------------------
|
||||
";
|
||||
|
||||
$this->addDropStatements($script);
|
||||
|
||||
$script .= "
|
||||
|
||||
CREATE TABLE ".$this->quoteIdentifier($table->getName())."
|
||||
(
|
||||
";
|
||||
|
||||
$lines = array();
|
||||
|
||||
foreach ($table->getColumns() as $col) {
|
||||
$lines[] = $this->getColumnDDL($col);
|
||||
}
|
||||
|
||||
if ($table->hasPrimaryKey() && count($table->getPrimaryKey()) > 1) {
|
||||
$lines[] = "PRIMARY KEY (".$this->getColumnList($table->getPrimaryKey()).")";
|
||||
}
|
||||
|
||||
foreach ($table->getUnices() as $unique ) {
|
||||
$lines[] = "UNIQUE (".$this->getColumnList($unique->getColumns()).")";
|
||||
}
|
||||
|
||||
$sep = ",
|
||||
";
|
||||
$script .= implode($sep, $lines);
|
||||
$script .= "
|
||||
);
|
||||
";
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds CREATE INDEX statements for this table.
|
||||
* @see parent::addIndices()
|
||||
*/
|
||||
protected function addIndices(&$script)
|
||||
{
|
||||
$table = $this->getTable();
|
||||
$platform = $this->getPlatform();
|
||||
|
||||
foreach ($table->getIndices() as $index) {
|
||||
$script .= "
|
||||
CREATE ";
|
||||
if ($index->getIsUnique()) {
|
||||
$script .= "UNIQUE";
|
||||
}
|
||||
$script .= "INDEX ".$this->quoteIdentifier($index->getName())." ON ".$this->quoteIdentifier($table->getName())." (".$this->getColumnList($index->getColumns()).");
|
||||
";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see parent::addForeignKeys()
|
||||
*/
|
||||
protected function addForeignKeys(&$script)
|
||||
{
|
||||
$table = $this->getTable();
|
||||
$platform = $this->getPlatform();
|
||||
|
||||
foreach ($table->getForeignKeys() as $fk) {
|
||||
$script .= "
|
||||
-- SQLite does not support foreign keys; this is just for reference
|
||||
-- FOREIGN KEY (".$this->getColumnList($fk->getLocalColumns()).") REFERENCES ".$fk->getForeignTableName()." (".$this->getColumnList($fk->getForeignColumns()).")
|
||||
";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue