Skip to content
This repository
Browse code

Adding support for Model.* syntax, which translates to a list of fiel…

…ds from Model.

Fixing buildColumn for null values.
Fixing small containable merge, it was duplicating values, tests added.

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8265 3807eeeb-6ff5-0310-8944-8be069107fe0
  • Loading branch information...
commit 76e50ef625996da0a593c3671db437b47e6b3579 1 parent 9e1dec3
Renan Gonçalves authored July 31, 2009
4  cake/libs/model/behaviors/containable.php
@@ -48,7 +48,7 @@ class ContainableBehavior extends ModelBehavior {
48 48
 	var $runtime = array();
49 49
 /**
50 50
  * Initiate behavior for the model using specified settings.
51  
- * 
  51
+ *
52 52
  * Available settings:
53 53
  *
54 54
  * - recursive: (boolean, optional) set to true to allow containable to automatically
@@ -313,7 +313,7 @@ function containments(&$Model, $contain, $containments = array(), $throwErrors =
313 313
 						$option = 'conditions';
314 314
 						$val = $Model->{$name}->alias.'.'.$key;
315 315
 					}
316  
-					$children[$option] = isset($children[$option]) ? array_merge((array) $children[$option], (array) $val) : $val;
  316
+					$children[$option] = is_array($val) ? $val : array($val);
317 317
 					$newChildren = null;
318 318
 					if (!empty($name) && !empty($children[$key])) {
319 319
 						$newChildren = $children[$key];
39  cake/libs/model/datasources/dbo/dbo_mssql.php
@@ -296,7 +296,8 @@ function fields(&$model, $alias = null, $fields = array(), $quote = true) {
296 296
 		$fields = parent::fields($model, $alias, $fields, false);
297 297
 		$count = count($fields);
298 298
 
299  
-		if ($count >= 1 && $fields[0] != '*' && strpos($fields[0], 'COUNT(*)') === false) {
  299
+		if ($count >= 1 && strpos($fields[0], 'COUNT(*)') === false) {
  300
+			$result = array();
300 301
 			for ($i = 0; $i < $count; $i++) {
301 302
 				$prepend = '';
302 303
 
@@ -307,6 +308,19 @@ function fields(&$model, $alias = null, $fields = array(), $quote = true) {
307 308
 				$fieldAlias = count($this->__fieldMappings);
308 309
 
309 310
 				if (!preg_match('/\s+AS\s+/i', $fields[$i])) {
  311
+					if (substr($fields[$i], -1) == '*') {
  312
+						if (strpos($fields[$i], '.') !== false && $fields[$i] != $alias . '.*') {
  313
+							$build = explode('.', $fields[$i]);
  314
+							$AssociatedModel = $model->{$build[0]};
  315
+						} else {
  316
+							$AssociatedModel = $model;
  317
+						}
  318
+
  319
+						$_fields = $this->fields($AssociatedModel, $AssociatedModel->alias, array_keys($AssociatedModel->schema()));
  320
+						$result = array_merge($result, $_fields);
  321
+						continue;
  322
+					}
  323
+
310 324
 					if (strpos($fields[$i], '.') === false) {
311 325
 						$this->__fieldMappings[$alias . '__' . $fieldAlias] = $alias . '.' . $fields[$i];
312 326
 						$fieldName  = $this->name($alias . '.' . $fields[$i]);
@@ -322,10 +336,12 @@ function fields(&$model, $alias = null, $fields = array(), $quote = true) {
322 336
 					}
323 337
 					$fields[$i] =  "{$fieldName} AS {$fieldAlias}";
324 338
 				}
325  
-				$fields[$i] = $prepend . $fields[$i];
  339
+				$result[] = $prepend . $fields[$i];
326 340
 			}
  341
+			return $result;
  342
+		} else {
  343
+			return $fields;
327 344
 		}
328  
-		return $fields;
329 345
 	}
330 346
 /**
331 347
  * Generates and executes an SQL INSERT statement for given model, fields, and values.
@@ -374,6 +390,9 @@ function update(&$model, $fields = array(), $values = null, $conditions = null)
374 390
 		if (isset($fields[$model->primaryKey])) {
375 391
 			unset($fields[$model->primaryKey]);
376 392
 		}
  393
+		if (empty($fields)) {
  394
+			return true;
  395
+		}
377 396
 		return parent::update($model, array_keys($fields), array_values($fields), $conditions);
378 397
 	}
379 398
 /**
@@ -461,8 +480,8 @@ function column($real) {
461 480
 			}
462 481
 			return $col;
463 482
 		}
464  
-		$col                = str_replace(')', '', $real);
465  
-		$limit              = null;
  483
+		$col = str_replace(')', '', $real);
  484
+		$limit = null;
466 485
 		if (strpos($col, '(') !== false) {
467 486
 			list($col, $limit) = explode('(', $col);
468 487
 		}
@@ -664,11 +683,13 @@ function insertMulti($table, $fields, $values) {
664 683
  * @return string
665 684
  */
666 685
 	function buildColumn($column) {
667  
-		$column = preg_replace('/(int|integer)\([0-9]+\)/i', '$1', parent::buildColumn($column));
668  
-		if (strpos($column, 'DEFAULT NULL') !== null) {
669  
-			$column = str_replace('DEFAULT NULL', 'NULL', $column);
  686
+		$result = preg_replace('/(int|integer)\([0-9]+\)/i', '$1', parent::buildColumn($column));
  687
+		if (strpos($result, 'DEFAULT NULL') !== false) {
  688
+			$result = str_replace('DEFAULT NULL', 'NULL', $result);
  689
+		} else if (array_keys($column) == array('type', 'name')) {
  690
+			$result .= ' NULL';
670 691
 		}
671  
-		return $column;
  692
+		return $result;
672 693
 	}
673 694
 /**
674 695
  * Format indexes for create table
1  cake/libs/model/datasources/dbo_source.php
@@ -1405,6 +1405,7 @@ function update(&$model, $fields = array(), $values = null, $conditions = null)
1405 1405
 	function _prepareUpdateFields(&$model, $fields, $quoteValues = true, $alias = false) {
1406 1406
 		$quotedAlias = $this->startQuote . $model->alias . $this->endQuote;
1407 1407
 
  1408
+		$updates = array();
1408 1409
 		foreach ($fields as $field => $value) {
1409 1410
 			if ($alias && strpos($field, '.') === false) {
1410 1411
 				$quoted = $model->escapeField($field);
119  cake/tests/cases/libs/model/behaviors/containable.test.php
@@ -1982,70 +1982,76 @@ function testSettingsThirdLevel() {
1982 1982
 		);
1983 1983
 		$this->assertEqual($result, $expected);
1984 1984
 
1985  
-		$result = $this->User->find('all', array('contain' => array(
1986  
-			'ArticleFeatured' => array(
1987  
-				'title', 'order' => 'title DESC',
1988  
-				'Featured' => array(
1989  
-					'category_id',
1990  
-					'Category' => 'name'
1991  
-				)
1992  
-			)
1993  
-		)));
1994  
-		$expected = array(
1995  
-			array(
1996  
-				'User' => array(
1997  
-					'id' => 1, 'user' => 'mariano', 'password' => '5f4dcc3b5aa765d61d8327deb882cf99',
1998  
-					'created' => '2007-03-17 01:16:23', 'updated' => '2007-03-17 01:18:31'
1999  
-				),
  1985
+		$orders = array(
  1986
+			'title DESC', 'title DESC, published DESC',
  1987
+			array('title' => 'DESC'), array('title' => 'DESC', 'published' => 'DESC'),
  1988
+		);
  1989
+		foreach ($orders as $order) {
  1990
+			$result = $this->User->find('all', array('contain' => array(
2000 1991
 				'ArticleFeatured' => array(
2001  
-					array(
2002  
-						'title' => 'Third Article', 'id' => 3, 'user_id' => 1,
2003  
-						'Featured' => array()
  1992
+					'title', 'order' => $order,
  1993
+					'Featured' => array(
  1994
+						'category_id',
  1995
+						'Category' => 'name'
  1996
+					)
  1997
+				)
  1998
+			)));
  1999
+			$expected = array(
  2000
+				array(
  2001
+					'User' => array(
  2002
+						'id' => 1, 'user' => 'mariano', 'password' => '5f4dcc3b5aa765d61d8327deb882cf99',
  2003
+						'created' => '2007-03-17 01:16:23', 'updated' => '2007-03-17 01:18:31'
2004 2004
 					),
2005  
-					array(
2006  
-						'title' => 'First Article', 'id' => 1, 'user_id' => 1,
2007  
-						'Featured' => array(
2008  
-							'category_id' => 1, 'id' => 1,
2009  
-							'Category' => array(
2010  
-								'name' => 'Category 1'
  2005
+					'ArticleFeatured' => array(
  2006
+						array(
  2007
+							'title' => 'Third Article', 'id' => 3, 'user_id' => 1,
  2008
+							'Featured' => array()
  2009
+						),
  2010
+						array(
  2011
+							'title' => 'First Article', 'id' => 1, 'user_id' => 1,
  2012
+							'Featured' => array(
  2013
+								'category_id' => 1, 'id' => 1,
  2014
+								'Category' => array(
  2015
+									'name' => 'Category 1'
  2016
+								)
2011 2017
 							)
2012 2018
 						)
2013 2019
 					)
2014  
-				)
2015  
-			),
2016  
-			array(
2017  
-				'User' => array(
2018  
-					'id' => 2, 'user' => 'nate', 'password' => '5f4dcc3b5aa765d61d8327deb882cf99',
2019  
-					'created' => '2007-03-17 01:18:23', 'updated' => '2007-03-17 01:20:31'
2020 2020
 				),
2021  
-				'ArticleFeatured' => array()
2022  
-			),
2023  
-			array(
2024  
-				'User' => array(
2025  
-					'id' => 3, 'user' => 'larry', 'password' => '5f4dcc3b5aa765d61d8327deb882cf99',
2026  
-					'created' => '2007-03-17 01:20:23', 'updated' => '2007-03-17 01:22:31'
  2021
+				array(
  2022
+					'User' => array(
  2023
+						'id' => 2, 'user' => 'nate', 'password' => '5f4dcc3b5aa765d61d8327deb882cf99',
  2024
+						'created' => '2007-03-17 01:18:23', 'updated' => '2007-03-17 01:20:31'
  2025
+					),
  2026
+					'ArticleFeatured' => array()
2027 2027
 				),
2028  
-				'ArticleFeatured' => array(
2029  
-					array(
2030  
-						'title' => 'Second Article', 'id' => 2, 'user_id' => 3,
2031  
-						'Featured' => array(
2032  
-							'category_id' => 1, 'id' => 2,
2033  
-							'Category' => array(
2034  
-								'name' => 'Category 1'
  2028
+				array(
  2029
+					'User' => array(
  2030
+						'id' => 3, 'user' => 'larry', 'password' => '5f4dcc3b5aa765d61d8327deb882cf99',
  2031
+						'created' => '2007-03-17 01:20:23', 'updated' => '2007-03-17 01:22:31'
  2032
+					),
  2033
+					'ArticleFeatured' => array(
  2034
+						array(
  2035
+							'title' => 'Second Article', 'id' => 2, 'user_id' => 3,
  2036
+							'Featured' => array(
  2037
+								'category_id' => 1, 'id' => 2,
  2038
+								'Category' => array(
  2039
+									'name' => 'Category 1'
  2040
+								)
2035 2041
 							)
2036 2042
 						)
2037 2043
 					)
2038  
-				)
2039  
-			),
2040  
-			array(
2041  
-				'User' => array(
2042  
-					'id' => 4, 'user' => 'garrett', 'password' => '5f4dcc3b5aa765d61d8327deb882cf99',
2043  
-					'created' => '2007-03-17 01:22:23', 'updated' => '2007-03-17 01:24:31'
2044 2044
 				),
2045  
-				'ArticleFeatured' => array()
2046  
-			)
2047  
-		);
2048  
-		$this->assertEqual($result, $expected);
  2045
+				array(
  2046
+					'User' => array(
  2047
+						'id' => 4, 'user' => 'garrett', 'password' => '5f4dcc3b5aa765d61d8327deb882cf99',
  2048
+						'created' => '2007-03-17 01:22:23', 'updated' => '2007-03-17 01:24:31'
  2049
+					),
  2050
+					'ArticleFeatured' => array()
  2051
+				)
  2052
+			);
  2053
+			$this->assertEqual($result, $expected);
  2054
+		}
2049 2055
 	}
2050 2056
 /**
2051 2057
  * testFindThirdLevelNonReset method
@@ -3225,7 +3231,6 @@ function testOriginalAssociations() {
3225 3231
 
3226 3232
 		$options = array(
3227 3233
 			'conditions' => array(
3228  
-				'Comment.comment !=' => 'Crazy',
3229 3234
 				'Comment.published' => 'Y',
3230 3235
 			),
3231 3236
 			'contain' => 'User',
@@ -3236,7 +3241,6 @@ function testOriginalAssociations() {
3236 3241
 
3237 3242
 		$dummyResult = $this->Article->Comment->find('all', array(
3238 3243
 			'conditions' => array(
3239  
-				'Comment.comment !=' => 'Silly',
3240 3244
 				'User.user' => 'mariano'
3241 3245
 			),
3242 3246
 			'fields' => array('User.password'),
@@ -3320,7 +3324,6 @@ function testResetAssociation() {
3320 3324
 
3321 3325
 		$initialOptions = array(
3322 3326
 			'conditions' => array(
3323  
-				'Comment.comment' => '!= Crazy',
3324 3327
 				'Comment.published' => 'Y',
3325 3328
 			),
3326 3329
 			'contain' => 'User',
@@ -3331,7 +3334,6 @@ function testResetAssociation() {
3331 3334
 
3332 3335
 		$findOptions = array(
3333 3336
 			'conditions' => array(
3334  
-				'Comment.comment !=' => 'Silly',
3335 3337
 				'User.user' => 'mariano',
3336 3338
 			),
3337 3339
 			'fields' => array('User.password'),
@@ -3409,7 +3411,8 @@ function testResetMultipleHabtmAssociations() {
3409 3411
 					'joinTable'				=> 'articles_tags',
3410 3412
 					'foreignKey'			=> 'article_id',
3411 3413
 					'associationForeignKey' => 'tag_id',
3412  
-					'conditions' 			=> 'LENGTH(ShortTag.tag) <= 3'
  3414
+					// LENGHT function mysql-only, using LIKE does almost the same
  3415
+					'conditions' 			=> 'ShortTag.tag LIKE "???"'
3413 3416
 				)
3414 3417
 			)
3415 3418
 		);
21  cake/tests/cases/libs/model/behaviors/translate.test.php
@@ -427,15 +427,18 @@ function testTranslatedFindList() {
427 427
 		$expected = array(1 => 'Titel #1', 2 => 'Titel #2', 3 => 'Titel #3');
428 428
 		$this->assertEqual($result, $expected);
429 429
 
430  
-		$debug = Configure::read('debug');
431  
-		Configure::write('debug', 0);
432  
-
433  
-		$result = $TestModel->find('list', array('recursive' => 1, 'callbacks' => false));
434  
-		$this->assertEqual($result, array());
435  
-
436  
-		$result = $TestModel->find('list', array('recursive' => 1, 'callbacks' => 'after'));
437  
-		$this->assertEqual($result, array());
438  
-		Configure::write('debug', $debug);
  430
+		// MSSQL trigger an error and stops the page even if the debug = 0
  431
+		if ($this->db->config['driver'] != 'mssql') {
  432
+			$debug = Configure::read('debug');
  433
+			Configure::write('debug', 0);
  434
+
  435
+			$result = $TestModel->find('list', array('recursive' => 1, 'callbacks' => false));
  436
+			$this->assertEqual($result, array());
  437
+
  438
+			$result = $TestModel->find('list', array('recursive' => 1, 'callbacks' => 'after'));
  439
+			$this->assertEqual($result, array());
  440
+			Configure::write('debug', $debug);
  441
+		}
439 442
 
440 443
 		$result = $TestModel->find('list', array('recursive' => 1, 'callbacks' => 'before'));
441 444
 		$expected = array(1 => null, 2 => null, 3 => null);
115  cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php
@@ -115,6 +115,15 @@ function getLastQuery() {
115 115
 	function getPrimaryKey($model) {
116 116
 		return parent::_getPrimaryKey($model);
117 117
 	}
  118
+/**
  119
+ * clearFieldMappings method
  120
+ *
  121
+ * @access public
  122
+ * @return void
  123
+ */
  124
+	function clearFieldMappings() {
  125
+		$this->__fieldMappings = array();
  126
+	}
118 127
 }
119 128
 /**
120 129
  * MssqlTestModel class
@@ -164,6 +173,17 @@ class MssqlTestModel extends Model {
164 173
 		'updated'	=> array('type' => 'datetime', 'null' => '1', 'default' => '', 'length' => null)
165 174
 	);
166 175
 /**
  176
+ * belongsTo property
  177
+ *
  178
+ * @var array
  179
+ * @access public
  180
+ */
  181
+	var $belongsTo = array(
  182
+		'MssqlClientTestModel' => array(
  183
+			'foreignKey' => 'client_id'
  184
+		)
  185
+	);
  186
+/**
167 187
  * find method
168 188
  *
169 189
  * @param mixed $conditions
@@ -201,6 +221,41 @@ function setSchema($schema) {
201 221
 	}
202 222
 }
203 223
 /**
  224
+ * MssqlClientTestModel class
  225
+ *
  226
+ * @package       cake
  227
+ * @subpackage    cake.tests.cases.libs.model.datasources
  228
+ */
  229
+class MssqlClientTestModel extends Model {
  230
+/**
  231
+ * name property
  232
+ *
  233
+ * @var string 'MssqlAssociatedTestModel'
  234
+ * @access public
  235
+ */
  236
+	var $name = 'MssqlClientTestModel';
  237
+/**
  238
+ * useTable property
  239
+ *
  240
+ * @var bool false
  241
+ * @access public
  242
+ */
  243
+	var $useTable = false;
  244
+/**
  245
+ * _schema property
  246
+ *
  247
+ * @var array
  248
+ * @access protected
  249
+ */
  250
+	var $_schema = array(
  251
+		'id'		=> array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8', 'key' => 'primary'),
  252
+		'name'		=> array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'),
  253
+		'email'		=> array('type' => 'string', 'null' => '1', 'default' => '', 'length' => '155'),
  254
+		'created'	=> array('type' => 'datetime', 'null' => '1', 'default' => '', 'length' => ''),
  255
+		'updated'	=> array('type' => 'datetime', 'null' => '1', 'default' => '', 'length' => null)
  256
+	);
  257
+}
  258
+/**
204 259
  * DboMssqlTest class
205 260
  *
206 261
  * @package       cake
@@ -283,8 +338,22 @@ function tearDown() {
283 338
  * @return void
284 339
  */
285 340
 	function testQuoting() {
286  
-		$result = $this->db->fields($this->model);
287  
-		$expected = array(
  341
+		$expected = "1.2";
  342
+		$result = $this->db->value(1.2, 'float');
  343
+		$this->assertIdentical($expected, $result);
  344
+
  345
+		$expected = "'1,2'";
  346
+		$result = $this->db->value('1,2', 'float');
  347
+		$this->assertIdentical($expected, $result);
  348
+	}
  349
+/**
  350
+ * testFields method
  351
+ *
  352
+ * @access public
  353
+ * @return void
  354
+ */
  355
+	function testFields() {
  356
+		$fields = array(
288 357
 			'[MssqlTestModel].[id] AS [MssqlTestModel__0]',
289 358
 			'[MssqlTestModel].[client_id] AS [MssqlTestModel__1]',
290 359
 			'[MssqlTestModel].[name] AS [MssqlTestModel__2]',
@@ -304,15 +373,32 @@ function testQuoting() {
304 373
 			'[MssqlTestModel].[created] AS [MssqlTestModel__16]',
305 374
 			'CONVERT(VARCHAR(20), [MssqlTestModel].[updated], 20) AS [MssqlTestModel__17]'
306 375
 		);
  376
+
  377
+		$result = $this->db->fields($this->model);
  378
+		$expected = $fields;
307 379
 		$this->assertEqual($result, $expected);
308 380
 
309  
-		$expected = "1.2";
310  
-		$result = $this->db->value(1.2, 'float');
311  
-		$this->assertIdentical($expected, $result);
  381
+		$this->db->clearFieldMappings();
  382
+		$result = $this->db->fields($this->model, null, 'MssqlTestModel.*');
  383
+		$expected = $fields;
  384
+		$this->assertEqual($result, $expected);
312 385
 
313  
-		$expected = "'1,2'";
314  
-		$result = $this->db->value('1,2', 'float');
315  
-		$this->assertIdentical($expected, $result);
  386
+		$this->db->clearFieldMappings();
  387
+		$result = $this->db->fields($this->model, null, array('*', 'AnotherModel.id', 'AnotherModel.name'));
  388
+		$expected = array_merge($fields, array(
  389
+			'[AnotherModel].[id] AS [AnotherModel__18]',
  390
+			'[AnotherModel].[name] AS [AnotherModel__19]'));
  391
+		$this->assertEqual($result, $expected);
  392
+
  393
+		$this->db->clearFieldMappings();
  394
+		$result = $this->db->fields($this->model, null, array('*', 'MssqlClientTestModel.*'));
  395
+		$expected = array_merge($fields, array(
  396
+			'[MssqlClientTestModel].[id] AS [MssqlClientTestModel__18]',
  397
+			'[MssqlClientTestModel].[name] AS [MssqlClientTestModel__19]',
  398
+			'[MssqlClientTestModel].[email] AS [MssqlClientTestModel__20]',
  399
+			'CONVERT(VARCHAR(20), [MssqlClientTestModel].[created], 20) AS [MssqlClientTestModel__21]',
  400
+			'CONVERT(VARCHAR(20), [MssqlClientTestModel].[updated], 20) AS [MssqlClientTestModel__22]'));
  401
+		$this->assertEqual($result, $expected);
316 402
 	}
317 403
 /**
318 404
  * testDistinctFields method
@@ -392,17 +478,22 @@ function testBuildColumn() {
392 478
 		$expected = '[client_id] int DEFAULT 0 NOT NULL';
393 479
 		$this->assertEqual($result, $expected);
394 480
 
395  
-		// 'name' => 'type' format
396  
-		$column = array('name' => 'client_id', 'type' => 'integer');
  481
+		$column = array('name' => 'client_id', 'type' => 'integer', 'null' => true);
397 482
 		$result = $this->db->buildColumn($column);
398  
-		$expected = '[client_id] int';
  483
+		$expected = '[client_id] int NULL';
399 484
 		$this->assertEqual($result, $expected);
400 485
 
401  
-		$column = array('name' => 'client_id', 'type' => 'integer', 'null' => true);
  486
+		// 'name' => 'type' format for columns
  487
+		$column = array('type' => 'integer', 'name' => 'client_id');
402 488
 		$result = $this->db->buildColumn($column);
403 489
 		$expected = '[client_id] int NULL';
404 490
 		$this->assertEqual($result, $expected);
405 491
 
  492
+		$column = array('type' => 'string', 'name' => 'name');
  493
+		$result = $this->db->buildColumn($column);
  494
+		$expected = '[name] varchar(255) NULL';
  495
+		$this->assertEqual($result, $expected);
  496
+
406 497
 		$column = array('name' => 'name', 'type' => 'string', 'null' => '', 'default' => '', 'length' => '255');
407 498
 		$result = $this->db->buildColumn($column);
408 499
 		$expected = '[name] varchar(255) DEFAULT \'\' NOT NULL';
8  cake/tests/cases/libs/model/model_write.test.php
@@ -149,12 +149,8 @@ function testUnderscoreFieldSave() {
149 149
  * @return void
150 150
  */
151 151
 	function testAutoSaveUuid() {
152  
-		// SQLite does not support non-integer primary keys, and SQL Server
153  
-		// is still having problems with custom PK's
154  
-		$this->skipIf(
155  
-			   $this->db->config['driver'] == 'sqlite'
156  
-			|| $this->db->config['driver'] == 'mssql'
157  
-		);
  152
+		// SQLite does not support non-integer primary keys
  153
+		$this->skipIf($this->db->config['driver'] == 'sqlite');
158 154
 
159 155
 		$this->loadFixtures('Uuid');
160 156
 		$TestModel =& new Uuid();
2  cake/tests/fixtures/uuid_tree_fixture.php
@@ -46,7 +46,7 @@ class UuidTreeFixture extends CakeTestFixture {
46 46
 	var $fields = array(
47 47
 		'id'	=> array('type' => 'string', 'length' => 36, 'key' => 'primary'),
48 48
 		'name'	=> array('type' => 'string','null' => false),
49  
-		'parent_id' => array('type' => 'string', 'length' => 36),
  49
+		'parent_id' => array('type' => 'string', 'length' => 36, 'null' => true),
50 50
 		'lft'	=> array('type' => 'integer','null' => false),
51 51
 		'rght'	=> array('type' => 'integer','null' => false)
52 52
 	);

0 notes on commit 76e50ef

Please sign in to comment.
Something went wrong with that request. Please try again.