diff --git a/Doctrine/DataDict.php b/Doctrine/DataDict.php index 95db8b3f4..df6dff607 100644 --- a/Doctrine/DataDict.php +++ b/Doctrine/DataDict.php @@ -40,7 +40,8 @@ class Doctrine_DataDict { try { $this->dbh->query($sql); } catch(PDOException $e) { - $return = false; + + $return = $e; } } diff --git a/Doctrine/Locking/Manager/Pessimistic.php b/Doctrine/Locking/Manager/Pessimistic.php index 22b43185a..fca920a25 100644 --- a/Doctrine/Locking/Manager/Pessimistic.php +++ b/Doctrine/Locking/Manager/Pessimistic.php @@ -237,4 +237,4 @@ class Doctrine_Locking_Manager_Pessimistic } -?> \ No newline at end of file +?> diff --git a/Doctrine/adodb-hack/drivers/datadict-sqlite.inc.php b/Doctrine/adodb-hack/drivers/datadict-sqlite.inc.php index b76af462c..3bb3621b0 100644 --- a/Doctrine/adodb-hack/drivers/datadict-sqlite.inc.php +++ b/Doctrine/adodb-hack/drivers/datadict-sqlite.inc.php @@ -56,6 +56,7 @@ class ADODB2_sqlite extends ADODB_DataDict { if ($funsigned) $suffix .= ' UNSIGNED'; if ($fnotnull) $suffix .= ' NOT NULL'; if (strlen($fdefault)) $suffix .= " DEFAULT $fdefault"; + if ($fautoinc) $suffix .= ' PRIMARY KEY AUTOINCREMENT'; if ($fconstraint) $suffix .= ' '.$fconstraint; return $suffix; @@ -77,12 +78,12 @@ class ADODB2_sqlite extends ADODB_DataDict { } $s = "CREATE TABLE $tabname (\n"; $s .= implode(",\n", $lines); - /** - if (sizeof($pkey)>0) { + + if (sizeof($pkey)>0 && ! $this->autoIncrement) { $s .= ",\n PRIMARY KEY ("; $s .= implode(", ",$pkey).")"; } - */ + if (isset($tableoptions['CONSTRAINTS'])) $s .= "\n".$tableoptions['CONSTRAINTS'];