Sqlite datadict: composite primary key support
This commit is contained in:
parent
ff50405000
commit
703ba51fab
@ -40,7 +40,8 @@ class Doctrine_DataDict {
|
||||
try {
|
||||
$this->dbh->query($sql);
|
||||
} catch(PDOException $e) {
|
||||
$return = false;
|
||||
|
||||
$return = $e;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -237,4 +237,4 @@ class Doctrine_Locking_Manager_Pessimistic
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
?>
|
||||
|
@ -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'];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user