Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixture generator for new table and field level parameters

  • Loading branch information...
commit 86d0a04c8dd69569d7f93882b4e7ba4f4e5bf7b9 1 parent a445a12
@skie skie authored
Showing with 10 additions and 2 deletions.
  1. +10 −2 cake/console/libs/tasks/fixture.php
View
12 cake/console/libs/tasks/fixture.php
@@ -260,16 +260,24 @@ function _generateSchema($tableInfo) {
$out = "array(\n";
foreach ($tableInfo as $field => $fieldInfo) {
if (is_array($fieldInfo)) {
- if ($field != 'indexes') {
+ if (!in_array($field, array('indexes', 'tableParameters'))) {
$col = "\t\t'{$field}' => array('type'=>'" . $fieldInfo['type'] . "', ";
$col .= join(', ', $this->_Schema->__values($fieldInfo));
- } else {
+ } elseif ($field == 'indexes') {
$col = "\t\t'indexes' => array(";
$props = array();
foreach ((array)$fieldInfo as $key => $index) {
$props[] = "'{$key}' => array(".join(', ', $this->_Schema->__values($index)).")";
}
$col .= join(', ', $props);
+ } elseif ($field == 'tableParameters') {
+ //@todo add charset, collate and engine here
+ $col = "\t\t'tableParameters' => array(";
+ $props = array();
+ foreach ((array)$fieldInfo as $key => $param) {
+ $props[] = "'{$key}' => '$param'";
+ }
+ $col .= join(', ', $props);
}
$col .= ")";
$cols[] = $col;
Please sign in to comment.
Something went wrong with that request. Please try again.