diff --git a/cake/libs/model/datasources/dbo/dbo_mysql.php b/cake/libs/model/datasources/dbo/dbo_mysql.php index c4c714cef..14496f34e 100644 --- a/cake/libs/model/datasources/dbo/dbo_mysql.php +++ b/cake/libs/model/datasources/dbo/dbo_mysql.php @@ -185,9 +185,6 @@ class DboMysql extends DboSource { if(!empty($column[0]['Key']) && isset($this->index[$column[0]['Key']])) { $fields[$column[0]['Field']]['key'] = $this->index[$column[0]['Key']]; } - if(!empty($column[0]['Extra'])) { - $fields[$column[0]['Field']]['extra'] = $column[0]['Extra']; - } } } $this->__cacheDescription($this->fullTableName($model, false), $fields); diff --git a/cake/libs/model/datasources/dbo/dbo_postgres.php b/cake/libs/model/datasources/dbo/dbo_postgres.php index 534d9b175..e5d2c84c0 100644 --- a/cake/libs/model/datasources/dbo/dbo_postgres.php +++ b/cake/libs/model/datasources/dbo/dbo_postgres.php @@ -158,46 +158,46 @@ class DboPostgres extends DboSource { * @return array Fields in table. Keys are name and type */ function &describe(&$model) { + $fields = parent::describe($model); + $table = $this->fullTableName($model, false); + $this->_sequenceMap[$table] = array(); + + if ($fields === null) { + $cols = $this->fetchAll("SELECT DISTINCT column_name AS name, data_type AS type, is_nullable AS null, column_default AS default, ordinal_position AS position, character_maximum_length AS char_length, character_octet_length AS oct_length FROM information_schema.columns WHERE table_name =" . $this->value($table) . " ORDER BY position"); + + foreach ($cols as $column) { + $colKey = array_keys($column); + + if (isset($column[$colKey[0]]) && !isset($column[0])) { + $column[0] = $column[$colKey[0]]; + } + + if (isset($column[0])) { + $c = $column[0]; + if (!empty($c['char_length'])) { + $length = intval($c['char_length']); + } elseif (!empty($c['oct_length'])) { + $length = intval($c['oct_length']); + } else { + $length = $this->length($c['type']); + } + $fields[$c['name']] = array( + 'type' => $this->column($c['type']), + 'null' => ($c['null'] == 'NO' ? false : true), + 'default' => preg_replace('/::.*/', '', $c['default']), + 'length' => $length + ); + if (preg_match('/nextval\([\'"]?(\w+)/', $c['default'], $seq)) { + $this->_sequenceMap[$table][$c['name']] = $seq[1]; + $fields[$c['name']]['default'] = null; + } + } + } + $this->__cacheDescription($table, $fields); + } if (isset($model->sequence)) { - $this->_sequenceMap[$this->fullTableName($model, false)] = $model->sequence; + $this->_sequenceMap[$table][$model->primaryKey] = $model->sequence; } - - $cache = parent::describe($model); - if ($cache != null) { - return $cache; - } - - $fields = false; - $cols = $this->fetchAll("SELECT DISTINCT column_name AS name, data_type AS type, is_nullable AS null, column_default AS default, ordinal_position AS position, character_maximum_length AS char_length, character_octet_length AS oct_length FROM information_schema.columns WHERE table_name =" . $this->value($model->tablePrefix . $model->table) . " ORDER BY position"); - - foreach ($cols as $column) { - $colKey = array_keys($column); - - if (isset($column[$colKey[0]]) && !isset($column[0])) { - $column[0] = $column[$colKey[0]]; - } - - if (isset($column[0])) { - $c = $column[0]; - if (strpos($c['default'], 'nextval(') === 0) { - $c['default'] = null; - } - if (!empty($c['char_length'])) { - $length = intval($c['char_length']); - } elseif (!empty($c['oct_length'])) { - $length = intval($c['oct_length']); - } else { - $length = $this->length($c['type']); - } - $fields[$c['name']] = array( - 'type' => $this->column($c['type']), - 'null' => ($c['null'] == 'NO' ? false : true), - 'default' => preg_replace('/::.*/', '', $c['default']), - 'length' => $length - ); - } - } - $this->__cacheDescription($model->tablePrefix . $model->table, $fields); return $fields; } /** @@ -345,24 +345,52 @@ class DboPostgres extends DboSource { * @return integer */ function lastInsertId($source, $field = 'id') { - foreach ($this->__descriptions[$source] as $name => $sourceinfo) { - if (strcasecmp($name, $field) == 0) { - break; - } - } - - if (isset($this->_sequenceMap[$source])) { - $seq = $this->_sequenceMap[$source]; - } elseif (preg_match('/^nextval\(\'(\w+)\'/', $sourceinfo['default'], $matches)) { - $seq = $matches[1]; - } else { - $seq = "{$source}_{$field}_seq"; - } - - $res = $this->rawQuery("SELECT last_value AS max FROM \"{$seq}\""); - $data = $this->fetchRow($res); + $seq = $this->getSequence($source, $field); + $data = $this->fetchRow("SELECT last_value AS max FROM \"{$seq}\""); return $data[0]['max']; } +/** + * Gets the associated sequence for the given table/field + * + * @param mixed $table Either a full table name (with prefix) as a string, or a model object + * @param string $field Name of the ID database field. Defaults to "id" + * @return string The associated sequence name from the sequence map, defaults to "{$table}_{$field}_seq" + */ + function getSequence($table, $field = 'id') { + if (is_object($table)) { + $table = $this->fullTableName($table, false); + } + if (isset($this->_sequenceMap[$table]) && isset($this->_sequenceMap[$table][$field])) { + return $this->_sequenceMap[$table][$field]; + } else { + return "{$source}_{$field}_seq"; + } + } +/** + * Deletes all the records in a table and drops all associated auto-increment sequences + * + * @param mixed $table A string or model class representing the table to be truncated + * @param integer $reset If -1, sequences are dropped, if 0 (default), sequences are reset, + * and if 1, sequences are not modified + * @return boolean SQL TRUNCATE TABLE statement, false if not applicable. + * @access public + */ + function truncate($table, $reset = 0) { + if (parent::truncate($table)) { + $table = $this->fullTableName($table, false); + if (isset($this->_sequenceMap[$table]) && $reset !== 1) { + foreach ($this->_sequenceMap[$table] as $field => $sequence) { + if ($reset === 0) { + $this->execute("ALTER SEQUENCE \"{$sequence}\" RESTART WITH 1"); + } elseif ($reset === -1) { + $this->execute("DROP SEQUENCE IF EXISTS \"{$sequence}\""); + } + } + } + return true; + } + return false; + } /** * Generates and executes an SQL UPDATE statement for given model, fields, and values. * @@ -674,52 +702,8 @@ class DboPostgres extends DboSource { * @return string */ function buildColumn($column) { - $name = $type = null; - $column = array_merge(array('null' => true), $column); - extract($column); - - if (empty($name) || empty($type)) { - trigger_error('Column name or type not defined in schema', E_USER_WARNING); - return null; - } - - if (!isset($this->columns[$type])) { - trigger_error("Column type {$type} does not exist", E_USER_WARNING); - return null; - } - - $real = $this->columns[$type]; - $out = $this->name($name) . ' ' . $real['name']; - - if (isset($real['limit']) || isset($real['length']) || isset($column['limit']) || isset($column['length'])) { - if (isset($column['length'])) { - $length = $column['length']; - } elseif (isset($column['limit'])) { - $length = $column['limit']; - } elseif (isset($real['length'])) { - $length = $real['length']; - } else { - $length = $real['limit']; - } - if (!in_array($type, array('integer', 'binary'))) { - $out .= '(' . $length . ')'; - } - } - if (isset($column['key']) && $column['key'] == 'primary' && (isset($column['extra']) && $column['extra'] == 'auto_increment')) { - preg_match('/("\w+")/', $out, $field); - $out = $field[0] . ' serial NOT NULL'; - } elseif (isset($column['key']) && $column['key'] == 'primary') { - $out .= ' NOT NULL'; - } elseif (isset($column['default']) && isset($column['null']) && $column['null'] == false) { - $out .= ' DEFAULT ' . $this->value($column['default'], $type) . ' NOT NULL'; - } elseif (isset($column['default'])) { - $out .= ' DEFAULT ' . $this->value($column['default'], $type); - } elseif (isset($column['null']) && $column['null'] == true) { - $out .= ' DEFAULT NULL'; - } elseif (isset($column['null']) && $column['null'] == false) { - $out .= ' NOT NULL'; - } - return $out; + $out = str_replace('integer serial', 'serial', parent::buildColumn($column)); + return preg_replace('/integer\([0-9]+\)/', 'integer', $out); } /** * Format indexes for create table diff --git a/cake/libs/model/datasources/dbo/dbo_sqlite.php b/cake/libs/model/datasources/dbo/dbo_sqlite.php index 4791568c5..573405c10 100644 --- a/cake/libs/model/datasources/dbo/dbo_sqlite.php +++ b/cake/libs/model/datasources/dbo/dbo_sqlite.php @@ -172,7 +172,6 @@ class DboSqlite extends DboSource { 'null' => false, 'default' => $column[0]['dflt_value'], 'key' => $this->index['PRI'], - 'extra' => 'auto_increment', 'length' => 11 ); } diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index c13868420..2a47d8287 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -993,26 +993,29 @@ class Model extends Overloadable { * Initializes the model for writing a new record, loading the default values * for those fields that are not defined in $data. * - * @param array $data Optional data to assign to the model after it is created - * @return array The current data of the model + * @param mixed $data Optional data array to assign to the model after it is created. If null or false, + * schema data defaults are not merged. + * @return mixed The current data of the model, or true if $data is empty * @access public */ function create($data = array()) { + $defaults = array(); $this->id = false; $this->data = array(); - $defaults = array(); - $fields = $this->schema(); - foreach ($fields as $field => $properties) { - if ($this->primaryKey !== $field && isset($properties['default'])) { - $defaults[$field] = $properties['default']; - } - } $this->validationErrors = array(); if ($data !== null && $data !== false) { + foreach ($this->schema() as $field => $properties) { + if ($this->primaryKey !== $field && isset($properties['default'])) { + $defaults[$field] = $properties['default']; + } + } $this->set(Set::filter($defaults)); $this->set($data); } + if (empty($this->data)) { + return true; + } return $this->data; } /** @@ -1318,10 +1321,12 @@ class Model extends Overloadable { * Updates the counter cache of belongsTo associations after a save or delete operation * * @param array $keys Optional foreign key data, defaults to the information $this->data + * @param boolean $created True if a new record was created, otherwise only associations with + * 'counterScope' defined get updated * @return void * @access public */ - function updateCounterCache($keys = array()) { + function updateCounterCache($keys = array(), $created = false) { if (empty($keys)) { $keys = $this->data[$this->alias]; } diff --git a/cake/libs/model/schema.php b/cake/libs/model/schema.php index 10b0a08fc..9e92016f4 100644 --- a/cake/libs/model/schema.php +++ b/cake/libs/model/schema.php @@ -469,9 +469,6 @@ class CakeSchema extends Object { if (empty($value['key'])) { unset($value['key']); } - if (empty($value['extra'])) { - unset($value['extra']); - } $columns[$name] = $value; } diff --git a/cake/tests/fixtures/aco_fixture.php b/cake/tests/fixtures/aco_fixture.php index 271a3ce78..4cebadf0b 100644 --- a/cake/tests/fixtures/aco_fixture.php +++ b/cake/tests/fixtures/aco_fixture.php @@ -35,7 +35,7 @@ class AcoFixture extends CakeTestFixture { var $name = 'Aco'; var $fields = array( - 'id' => array('type' => 'integer', 'key' => 'primary', 'extra'=> 'auto_increment'), + 'id' => array('type' => 'integer', 'key' => 'primary'), 'parent_id' => array('type' => 'integer', 'length' => 10, 'null' => true), 'model' => array('type' => 'string', 'default' => ''), 'foreign_key' => array('type' => 'integer', 'length' => 10, 'null' => true), diff --git a/cake/tests/fixtures/advertisement_fixture.php b/cake/tests/fixtures/advertisement_fixture.php index 9f4503130..9bb7c69c6 100644 --- a/cake/tests/fixtures/advertisement_fixture.php +++ b/cake/tests/fixtures/advertisement_fixture.php @@ -35,7 +35,7 @@ class AdvertisementFixture extends CakeTestFixture { var $name = 'Advertisement'; var $fields = array( - 'id' => array('type' => 'integer', 'key' => 'primary', 'extra'=> 'auto_increment'), + 'id' => array('type' => 'integer', 'key' => 'primary'), 'title' => array('type' => 'string', 'null' => false), 'created' => 'datetime', 'updated' => 'datetime' diff --git a/cake/tests/fixtures/another_article_fixture.php b/cake/tests/fixtures/another_article_fixture.php index 6ebaf3d48..64dbf7bc5 100644 --- a/cake/tests/fixtures/another_article_fixture.php +++ b/cake/tests/fixtures/another_article_fixture.php @@ -35,7 +35,7 @@ class AnotherArticleFixture extends CakeTestFixture { var $name = 'AnotherArticle'; var $fields = array( - 'id' => array('type' => 'integer', 'key' => 'primary', 'extra'=> 'auto_increment'), + 'id' => array('type' => 'integer', 'key' => 'primary'), 'title' => array('type' => 'string', 'null' => false), 'created' => 'datetime', 'updated' => 'datetime' diff --git a/cake/tests/fixtures/apple_fixture.php b/cake/tests/fixtures/apple_fixture.php index 5e0461973..0bd0432eb 100644 --- a/cake/tests/fixtures/apple_fixture.php +++ b/cake/tests/fixtures/apple_fixture.php @@ -35,7 +35,7 @@ class AppleFixture extends CakeTestFixture { var $name = 'Apple'; var $fields = array( - 'id' => array('type' => 'integer', 'key' => 'primary', 'extra'=> 'auto_increment'), + 'id' => array('type' => 'integer', 'key' => 'primary'), 'apple_id' => array('type' => 'integer', 'null' => true), 'color' => array('type' => 'string', 'length' => 40, 'null' => false), 'name' => array('type' => 'string', 'length' => 40, 'null' => false), diff --git a/cake/tests/fixtures/aro_fixture.php b/cake/tests/fixtures/aro_fixture.php index 2184455a2..a0aa8ddc2 100644 --- a/cake/tests/fixtures/aro_fixture.php +++ b/cake/tests/fixtures/aro_fixture.php @@ -36,7 +36,7 @@ class AroFixture extends CakeTestFixture { var $name = 'Aro'; var $fields = array( - 'id' => array('type' => 'integer', 'key' => 'primary', 'extra'=> 'auto_increment'), + 'id' => array('type' => 'integer', 'key' => 'primary'), 'parent_id' => array('type' => 'integer', 'length' => 10, 'null' => true), 'model' => array('type' => 'string', 'default' => ''), 'foreign_key' => array('type' => 'integer', 'length' => 10, 'null' => true), diff --git a/cake/tests/fixtures/aros_aco_fixture.php b/cake/tests/fixtures/aros_aco_fixture.php index 31be6c0db..9a9e24b12 100644 --- a/cake/tests/fixtures/aros_aco_fixture.php +++ b/cake/tests/fixtures/aros_aco_fixture.php @@ -35,7 +35,7 @@ class ArosAcoFixture extends CakeTestFixture { var $name = 'ArosAco'; var $fields = array( - 'id' => array('type' => 'integer', 'key' => 'primary', 'extra'=> 'auto_increment'), + 'id' => array('type' => 'integer', 'key' => 'primary'), 'aro_id' => array('type' => 'integer', 'length' => 10, 'null' => false), 'aco_id' => array('type' => 'integer', 'length' => 10, 'null' => false), '_create' => array('type' => 'string', 'length' => 2, 'null' => false, 'default' => '0'), diff --git a/cake/tests/fixtures/article_featured_fixture.php b/cake/tests/fixtures/article_featured_fixture.php index 5a0bd2435..cce632383 100644 --- a/cake/tests/fixtures/article_featured_fixture.php +++ b/cake/tests/fixtures/article_featured_fixture.php @@ -35,7 +35,7 @@ class ArticleFeaturedFixture extends CakeTestFixture { var $name = 'ArticleFeatured'; var $fields = array( - 'id' => array('type' => 'integer', 'key' => 'primary', 'extra'=> 'auto_increment'), + 'id' => array('type' => 'integer', 'key' => 'primary'), 'user_id' => array('type' => 'integer', 'null' => false), 'title' => array('type' => 'string', 'null' => false), 'body' => 'text', diff --git a/cake/tests/fixtures/article_fixture.php b/cake/tests/fixtures/article_fixture.php index ca55912ac..9a0613066 100644 --- a/cake/tests/fixtures/article_fixture.php +++ b/cake/tests/fixtures/article_fixture.php @@ -35,7 +35,7 @@ class ArticleFixture extends CakeTestFixture { var $name = 'Article'; var $fields = array( - 'id' => array('type' => 'integer', 'key' => 'primary', 'extra'=> 'auto_increment'), + 'id' => array('type' => 'integer', 'key' => 'primary'), 'user_id' => array('type' => 'integer', 'null' => false), 'title' => array('type' => 'string', 'null' => false), 'body' => 'text', diff --git a/cake/tests/fixtures/attachment_fixture.php b/cake/tests/fixtures/attachment_fixture.php index 764f44825..36e16cfb9 100644 --- a/cake/tests/fixtures/attachment_fixture.php +++ b/cake/tests/fixtures/attachment_fixture.php @@ -35,7 +35,7 @@ class AttachmentFixture extends CakeTestFixture { var $name = 'Attachment'; var $fields = array( - 'id' => array('type' => 'integer', 'key' => 'primary', 'extra'=> 'auto_increment'), + 'id' => array('type' => 'integer', 'key' => 'primary'), 'comment_id' => array('type' => 'integer', 'null' => false), 'attachment' => array('type' => 'string', 'null' => false), 'created' => 'datetime', diff --git a/cake/tests/fixtures/auth_user_fixture.php b/cake/tests/fixtures/auth_user_fixture.php index d7bc15c37..8e5da1aca 100644 --- a/cake/tests/fixtures/auth_user_fixture.php +++ b/cake/tests/fixtures/auth_user_fixture.php @@ -35,7 +35,7 @@ class AuthUserFixture extends CakeTestFixture { var $name = 'AuthUser'; var $fields = array( - 'id' => array('type' => 'integer', 'key' => 'primary', 'extra'=> 'auto_increment'), + 'id' => array('type' => 'integer', 'key' => 'primary'), 'username' => array('type' => 'string', 'null' => false), 'password' => array('type' => 'string', 'null' => false), 'created' => 'datetime', diff --git a/cake/tests/fixtures/author_fixture.php b/cake/tests/fixtures/author_fixture.php index e3ce87634..ff8b550f2 100644 --- a/cake/tests/fixtures/author_fixture.php +++ b/cake/tests/fixtures/author_fixture.php @@ -35,7 +35,7 @@ class AuthorFixture extends CakeTestFixture { var $name = 'Author'; var $fields = array( - 'id' => array('type' => 'integer', 'key' => 'primary', 'extra' => 'auto_increment'), + 'id' => array('type' => 'integer', 'key' => 'primary'), 'user' => array('type' => 'string', 'null' => false), 'password' => array('type' => 'string', 'null' => false), 'created' => 'datetime', diff --git a/cake/tests/fixtures/bid_fixture.php b/cake/tests/fixtures/bid_fixture.php index 81c7dd835..52f374eec 100644 --- a/cake/tests/fixtures/bid_fixture.php +++ b/cake/tests/fixtures/bid_fixture.php @@ -35,7 +35,7 @@ class BidFixture extends CakeTestFixture { var $name = 'Bid'; var $fields = array( - 'id' => array('type' => 'integer', 'key' => 'primary', 'extra'=> 'auto_increment'), + 'id' => array('type' => 'integer', 'key' => 'primary'), 'message_id' => array('type' => 'integer', 'null' => false), 'name' => array('type' => 'string', 'null' => false) ); diff --git a/cake/tests/fixtures/category_fixture.php b/cake/tests/fixtures/category_fixture.php index 9bf89418d..d4265e50f 100644 --- a/cake/tests/fixtures/category_fixture.php +++ b/cake/tests/fixtures/category_fixture.php @@ -35,7 +35,7 @@ class CategoryFixture extends CakeTestFixture { var $name = 'Category'; var $fields = array( - 'id' => array('type' => 'integer', 'key' => 'primary', 'extra'=> 'auto_increment'), + 'id' => array('type' => 'integer', 'key' => 'primary'), 'parent_id' => array('type' => 'integer', 'null' => false), 'name' => array('type' => 'string', 'null' => false), 'created' => 'datetime', diff --git a/cake/tests/fixtures/category_thread_fixture.php b/cake/tests/fixtures/category_thread_fixture.php index c39760911..e9bb099f3 100644 --- a/cake/tests/fixtures/category_thread_fixture.php +++ b/cake/tests/fixtures/category_thread_fixture.php @@ -35,7 +35,7 @@ class CategoryThreadFixture extends CakeTestFixture { var $name = 'CategoryThread'; var $fields = array( - 'id' => array('type' => 'integer', 'key' => 'primary', 'extra'=> 'auto_increment'), + 'id' => array('type' => 'integer', 'key' => 'primary'), 'parent_id' => array('type' => 'integer', 'null' => false), 'name' => array('type' => 'string', 'null' => false), 'created' => 'datetime', diff --git a/cake/tests/fixtures/comment_fixture.php b/cake/tests/fixtures/comment_fixture.php index b3657f29d..329aa1068 100644 --- a/cake/tests/fixtures/comment_fixture.php +++ b/cake/tests/fixtures/comment_fixture.php @@ -35,7 +35,7 @@ class CommentFixture extends CakeTestFixture { var $name = 'Comment'; var $fields = array( - 'id' => array('type' => 'integer', 'key' => 'primary', 'extra'=> 'auto_increment'), + 'id' => array('type' => 'integer', 'key' => 'primary'), 'article_id' => array('type' => 'integer', 'null'=>false), 'user_id' => array('type' => 'integer', 'null'=>false), 'comment' => 'text', diff --git a/cake/tests/fixtures/device_fixture.php b/cake/tests/fixtures/device_fixture.php index f8f5a5aa2..79c11edb3 100644 --- a/cake/tests/fixtures/device_fixture.php +++ b/cake/tests/fixtures/device_fixture.php @@ -35,7 +35,7 @@ class DeviceFixture extends CakeTestFixture { var $name = 'Device'; var $fields = array( - 'id' => array('type' => 'integer', 'key' => 'primary', 'extra'=> 'auto_increment'), + 'id' => array('type' => 'integer', 'key' => 'primary'), 'device_type_id' => array('type' => 'integer', 'null' => false), 'name' => array('type' => 'string', 'null' => false), 'typ' => array('type' => 'integer', 'null' => false), diff --git a/cake/tests/fixtures/device_type_category_fixture.php b/cake/tests/fixtures/device_type_category_fixture.php index c5fa88c9c..65ea8a07a 100644 --- a/cake/tests/fixtures/device_type_category_fixture.php +++ b/cake/tests/fixtures/device_type_category_fixture.php @@ -35,7 +35,7 @@ class DeviceTypeCategoryFixture extends CakeTestFixture { var $name = 'DeviceTypeCategory'; var $fields = array( - 'id' => array('type' => 'integer', 'key' => 'primary', 'extra'=> 'auto_increment'), + 'id' => array('type' => 'integer', 'key' => 'primary'), 'name' => array('type' => 'string', 'null' => false) ); var $records = array( diff --git a/cake/tests/fixtures/device_type_fixture.php b/cake/tests/fixtures/device_type_fixture.php index c63422ff2..536022313 100644 --- a/cake/tests/fixtures/device_type_fixture.php +++ b/cake/tests/fixtures/device_type_fixture.php @@ -35,7 +35,7 @@ class DeviceTypeFixture extends CakeTestFixture { var $name = 'DeviceType'; var $fields = array( - 'id' => array('type' => 'integer', 'key' => 'primary', 'extra'=> 'auto_increment'), + 'id' => array('type' => 'integer', 'key' => 'primary'), 'device_type_category_id' => array('type' => 'integer', 'null' => false), 'feature_set_id' => array('type' => 'integer', 'null' => false), 'exterior_type_category_id' => array('type' => 'integer', 'null' => false), diff --git a/cake/tests/fixtures/document_directory_fixture.php b/cake/tests/fixtures/document_directory_fixture.php index cc1a08107..f894cffc5 100644 --- a/cake/tests/fixtures/document_directory_fixture.php +++ b/cake/tests/fixtures/document_directory_fixture.php @@ -35,7 +35,7 @@ class DocumentDirectoryFixture extends CakeTestFixture { var $name = 'DocumentDirectory'; var $fields = array( - 'id' => array('type' => 'integer', 'key' => 'primary', 'extra'=> 'auto_increment'), + 'id' => array('type' => 'integer', 'key' => 'primary'), 'name' => array('type' => 'string', 'null' => false) ); var $records = array( diff --git a/cake/tests/fixtures/document_fixture.php b/cake/tests/fixtures/document_fixture.php index 6169079d5..3dd84f3e2 100644 --- a/cake/tests/fixtures/document_fixture.php +++ b/cake/tests/fixtures/document_fixture.php @@ -35,7 +35,7 @@ class DocumentFixture extends CakeTestFixture { var $name = 'Document'; var $fields = array( - 'id' => array('type' => 'integer', 'key' => 'primary', 'extra'=> 'auto_increment'), + 'id' => array('type' => 'integer', 'key' => 'primary'), 'document_directory_id' => array('type' => 'integer', 'null' => false), 'name' => array('type' => 'string', 'null' => false) ); diff --git a/cake/tests/fixtures/exterior_type_category_fixture.php b/cake/tests/fixtures/exterior_type_category_fixture.php index 6e85c23f5..d74b5e33e 100644 --- a/cake/tests/fixtures/exterior_type_category_fixture.php +++ b/cake/tests/fixtures/exterior_type_category_fixture.php @@ -35,7 +35,7 @@ class ExteriorTypeCategoryFixture extends CakeTestFixture { var $name = 'ExteriorTypeCategory'; var $fields = array( - 'id' => array('type' => 'integer', 'key' => 'primary', 'extra'=> 'auto_increment'), + 'id' => array('type' => 'integer', 'key' => 'primary'), 'image_id' => array('type' => 'integer', 'null' => false), 'name' => array('type' => 'string', 'null' => false) ); diff --git a/cake/tests/fixtures/feature_set_fixture.php b/cake/tests/fixtures/feature_set_fixture.php index 7134e2565..ff94d4c0e 100644 --- a/cake/tests/fixtures/feature_set_fixture.php +++ b/cake/tests/fixtures/feature_set_fixture.php @@ -35,7 +35,7 @@ class FeatureSetFixture extends CakeTestFixture { var $name = 'FeatureSet'; var $fields = array( - 'id' => array('type' => 'integer', 'key' => 'primary', 'extra'=> 'auto_increment'), + 'id' => array('type' => 'integer', 'key' => 'primary'), 'name' => array('type' => 'string', 'null' => false) ); var $records = array( diff --git a/cake/tests/fixtures/featured_fixture.php b/cake/tests/fixtures/featured_fixture.php index 3729becd6..8290d9440 100644 --- a/cake/tests/fixtures/featured_fixture.php +++ b/cake/tests/fixtures/featured_fixture.php @@ -35,7 +35,7 @@ class FeaturedFixture extends CakeTestFixture { var $name = 'Featured'; var $fields = array( - 'id' => array('type' => 'integer', 'key' => 'primary', 'extra'=> 'auto_increment'), + 'id' => array('type' => 'integer', 'key' => 'primary'), 'article_featured_id' => array('type' => 'integer', 'null' => false), 'category_id' => array('type' => 'integer', 'null' => false), 'published_date' => 'datetime', diff --git a/cake/tests/fixtures/home_fixture.php b/cake/tests/fixtures/home_fixture.php index 8e7c6f5a8..1d72dd8b3 100644 --- a/cake/tests/fixtures/home_fixture.php +++ b/cake/tests/fixtures/home_fixture.php @@ -35,7 +35,7 @@ class HomeFixture extends CakeTestFixture { var $name = 'Home'; var $fields = array( - 'id' => array('type' => 'integer', 'key' => 'primary', 'extra'=> 'auto_increment'), + 'id' => array('type' => 'integer', 'key' => 'primary'), 'another_article_id' => array('type' => 'integer', 'null' => false), 'advertisement_id' => array('type' => 'integer', 'null' => false), 'title' => array('type' => 'string', 'null' => false), diff --git a/cake/tests/fixtures/image_fixture.php b/cake/tests/fixtures/image_fixture.php index b0ba21a8a..95580a319 100644 --- a/cake/tests/fixtures/image_fixture.php +++ b/cake/tests/fixtures/image_fixture.php @@ -35,7 +35,7 @@ class ImageFixture extends CakeTestFixture { var $name = 'Image'; var $fields = array( - 'id' => array('type' => 'integer', 'key' => 'primary', 'extra'=> 'auto_increment'), + 'id' => array('type' => 'integer', 'key' => 'primary'), 'name' => array('type' => 'string', 'null' => false) ); var $records = array( diff --git a/cake/tests/fixtures/item_fixture.php b/cake/tests/fixtures/item_fixture.php index 7c3042546..5ba6a5628 100644 --- a/cake/tests/fixtures/item_fixture.php +++ b/cake/tests/fixtures/item_fixture.php @@ -35,7 +35,7 @@ class ItemFixture extends CakeTestFixture { var $name = 'Item'; var $fields = array( - 'id' => array('type' => 'integer', 'key' => 'primary', 'extra'=> 'auto_increment'), + 'id' => array('type' => 'integer', 'key' => 'primary'), 'syfile_id' => array('type' => 'integer', 'null' => false), 'name' => array('type' => 'string', 'null' => false) ); diff --git a/cake/tests/fixtures/items_portfolio_fixture.php b/cake/tests/fixtures/items_portfolio_fixture.php index e29726ea3..dfc1eb8b7 100644 --- a/cake/tests/fixtures/items_portfolio_fixture.php +++ b/cake/tests/fixtures/items_portfolio_fixture.php @@ -35,7 +35,7 @@ class ItemsPortfolioFixture extends CakeTestFixture { var $name = 'ItemsPortfolio'; var $fields = array( - 'id' => array('type' => 'integer', 'key' => 'primary', 'extra'=> 'auto_increment'), + 'id' => array('type' => 'integer', 'key' => 'primary'), 'item_id' => array('type' => 'integer', 'null' => false), 'portfolio_id' => array('type' => 'integer', 'null' => false) );