Commit 703ba51f authored by doctrine's avatar doctrine

Sqlite datadict: composite primary key support

parent ff504050
......@@ -40,7 +40,8 @@ class Doctrine_DataDict {
try {
$this->dbh->query($sql);
} catch(PDOException $e) {
$return = false;
$return = $e;
}
}
......
......@@ -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'];
......
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