Pluf Framework

Pluf Framework Commit Details


Date:2008-11-05 14:55:31 (16 years 1 month ago)
Author:Loic d'Anterroches
Branch:develop, master
Commit:76f4811b32f569205a023e1a8454704ec82f7501
Parents: 743dc62bcc16c440f3373a032a7693c6d471d63b
Message:Fixed issue 20, Testing with MySQL.

Ok, it should work now, I have not tested it yet but I fixed as per the
provided patches.
Changes:

File differences

src/Pluf/DB/Schema/MySQL.php
3535
3636
3737
38
39
40
41
38
39
40
41
4242
43
44
45
46
43
44
45
46
4747
48
49
48
49
5050
5151
5252
......
9393
9494
9595
96
96
9797
9898
9999
......
113113
114114
115115
116
116
117
117118
118119
119120
......
170171
171172
172173
173
174
174
175
176
177
175178
176179
177180
public $mappings = array(
'varchar' => 'varchar(%s)',
'sequence' => 'mediumint(9) unsigned not null auto_increment',
'boolean' => 'bool not null',
'date' => 'date not null',
'datetime' => 'datetime not null',
'file' => 'varchar(150) not null',
'boolean' => 'bool',
'date' => 'date',
'datetime' => 'datetime',
'file' => 'varchar(150)',
'manytomany' => null,
'foreignkey' => 'mediumint(9) unsigned not null',
'text' => 'longtext not null',
'html' => 'longtext not null',
'time' => 'time not null',
'foreignkey' => 'mediumint(9) unsigned',
'text' => 'longtext',
'html' => 'longtext',
'time' => 'time',
'integer' => 'integer',
'email' => 'varchar(150) not null',
'password' => 'varchar(150) not null',
'email' => 'varchar(150)',
'password' => 'varchar(150)',
'float' => 'numeric(%s, %s)',
);
foreach ($cols as $col => $val) {
$field = new $val['type']();
if ($field->type != 'manytomany') {
$sql .= "\n`".$col.'` ';
$sql .= "\n".$this->con->qn($col).' ';
$_tmp = $this->mappings[$field->type];
if ($field->type == 'varchar') {
if (isset($val['size'])) {
}
$sql .= $_tmp;
if (isset($val['default'])) {
$sql .= ' default '.$this->con->esc($val['default']);
$sql .= ' default ';
$sql .= $model->_toDb($val['default'], $col);
} elseif ($field->type != 'sequence') {
$sql .= ' default '.$this->defaults[$field->type];
}
}
if (isset($val['unique']) and $val['unique'] == true) {
$index[$this->con->pfx.$model->_a['table'].'_'.$col.'_unique'] =
sprintf('CREATE UNIQUE INDEX `%s` ON `%s` (`%s`);',
$col.'_unique_idx', $this->con->pfx.$model->_a['table'], $col);
sprintf('CREATE UNIQUE INDEX `%s` ON `%s` (%s);',
$col.'_unique_idx',
$this->con->pfx.$model->_a['table'],
$col);
}
}
return $index;

Archive Download the corresponding diff file

Branches

Tags

Number of commits:
Page rendered in 0.06218s using 14 queries.