1
0
mirror of synced 2025-01-18 06:21:40 +03:00

Sqlite datadict: composite primary key support

This commit is contained in:
doctrine 2006-07-05 18:59:46 +00:00
parent ff50405000
commit 703ba51fab
3 changed files with 7 additions and 5 deletions

View File

@ -40,7 +40,8 @@ class Doctrine_DataDict {
try {
$this->dbh->query($sql);
} catch(PDOException $e) {
$return = false;
$return = $e;
}
}

View File

@ -237,4 +237,4 @@ class Doctrine_Locking_Manager_Pessimistic
}
?>
?>

View File

@ -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'];