Commit 703ba51f authored by doctrine's avatar doctrine

Sqlite datadict: composite primary key support

parent ff504050
...@@ -40,7 +40,8 @@ class Doctrine_DataDict { ...@@ -40,7 +40,8 @@ class Doctrine_DataDict {
try { try {
$this->dbh->query($sql); $this->dbh->query($sql);
} catch(PDOException $e) { } catch(PDOException $e) {
$return = false;
$return = $e;
} }
} }
......
...@@ -237,4 +237,4 @@ class Doctrine_Locking_Manager_Pessimistic ...@@ -237,4 +237,4 @@ class Doctrine_Locking_Manager_Pessimistic
} }
?> ?>
\ No newline at end of file
...@@ -56,6 +56,7 @@ class ADODB2_sqlite extends ADODB_DataDict { ...@@ -56,6 +56,7 @@ class ADODB2_sqlite extends ADODB_DataDict {
if ($funsigned) $suffix .= ' UNSIGNED'; if ($funsigned) $suffix .= ' UNSIGNED';
if ($fnotnull) $suffix .= ' NOT NULL'; if ($fnotnull) $suffix .= ' NOT NULL';
if (strlen($fdefault)) $suffix .= " DEFAULT $fdefault"; if (strlen($fdefault)) $suffix .= " DEFAULT $fdefault";
if ($fautoinc) $suffix .= ' PRIMARY KEY AUTOINCREMENT'; if ($fautoinc) $suffix .= ' PRIMARY KEY AUTOINCREMENT';
if ($fconstraint) $suffix .= ' '.$fconstraint; if ($fconstraint) $suffix .= ' '.$fconstraint;
return $suffix; return $suffix;
...@@ -77,12 +78,12 @@ class ADODB2_sqlite extends ADODB_DataDict { ...@@ -77,12 +78,12 @@ class ADODB2_sqlite extends ADODB_DataDict {
} }
$s = "CREATE TABLE $tabname (\n"; $s = "CREATE TABLE $tabname (\n";
$s .= implode(",\n", $lines); $s .= implode(",\n", $lines);
/**
if (sizeof($pkey)>0) { if (sizeof($pkey)>0 && ! $this->autoIncrement) {
$s .= ",\n PRIMARY KEY ("; $s .= ",\n PRIMARY KEY (";
$s .= implode(", ",$pkey).")"; $s .= implode(", ",$pkey).")";
} }
*/
if (isset($tableoptions['CONSTRAINTS'])) if (isset($tableoptions['CONSTRAINTS']))
$s .= "\n".$tableoptions['CONSTRAINTS']; $s .= "\n".$tableoptions['CONSTRAINTS'];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment