Skip to content
Browse files

Fix QuickBuilder, QuickGenerator

  • Loading branch information...
1 parent f610ee6 commit 6d31fa6f7b861b3cc0d74761d90c8cb39f60f395 @willdurand willdurand committed Aug 2, 2012
View
6 generator/lib/builder/util/XmlToAppData.php
@@ -61,10 +61,10 @@ class XmlToAppData
*/
public function __construct(PropelPlatformInterface $defaultPlatform = null, $defaultPackage = null, $encoding = 'iso-8859-1')
{
- $this->app = new AppData($defaultPlatform);
+ $this->app = new AppData($defaultPlatform);
$this->defaultPackage = $defaultPackage;
- $this->firstPass = true;
- $this->encoding = $encoding;
+ $this->firstPass = true;
+ $this->encoding = $encoding;
}
/**
View
4 generator/lib/config/QuickGeneratorConfig.php
@@ -10,7 +10,7 @@
require_once dirname(__FILE__) . '/GeneratorConfig.php';
require_once dirname(__FILE__) . '/GeneratorConfigInterface.php';
-require_once dirname(__FILE__) . '/../platform/DefaultPlatform.php';
+require_once dirname(__FILE__) . '/../platform/SqlitePlatform.php';
/**
*
@@ -156,7 +156,7 @@ public function setBuildProperty($name, $value)
*/
public function getConfiguredPlatform(PDO $con = null, $database = null)
{
- return new DefaultPlatform($con);
+ return new SqlitePlatform($con);
}
/**
View
19 generator/lib/platform/DefaultPlatform.php
@@ -322,23 +322,26 @@ public function getAddTableDDL(Table $table)
*/
public function getColumnDDL(Column $col)
{
- $domain = $col->getDomain();
-
- $ddl = array($this->quoteIdentifier($col->getName()));
+ $domain = $col->getDomain();
+ $ddl = array($this->quoteIdentifier($col->getName()));
$sqlType = $domain->getSqlType();
+
if ($this->hasSize($sqlType) && $col->isDefaultSqlType($this)) {
- $ddl []= $sqlType . $domain->printSize();
+ $ddl[] = $sqlType . $domain->printSize();
} else {
- $ddl []= $sqlType;
+ $ddl[] = $sqlType;
}
+
if ($default = $this->getColumnDefaultValueDDL($col)) {
- $ddl []= $default;
+ $ddl[] = $default;
}
+
if ($notNull = $this->getNullString($col->isNotNull())) {
- $ddl []= $notNull;
+ $ddl[] = $notNull;
}
+
if ($autoIncrement = $col->getAutoIncrementString()) {
- $ddl []= $autoIncrement;
+ $ddl[] = $autoIncrement;
}
return implode(' ', $ddl);
View
1 generator/lib/platform/SqlitePlatform.php
@@ -167,5 +167,4 @@ public function supportsMigrations()
{
return false;
}
-
}
View
2 generator/lib/util/PropelQuickBuilder.php
@@ -118,8 +118,6 @@ public function getDatabase()
$xtad->setGeneratorConfig($this->getConfig());
$this->database = $xtad->parseString($this->schema)->getDatabase();
- // force the current platform
- $this->database->setPlatform($this->getPlatform());
}
return $this->database;

0 comments on commit 6d31fa6

Please sign in to comment.
Something went wrong with that request. Please try again.