Skip to content

Commit

Permalink
Fix boolean column defaults.
Browse files Browse the repository at this point in the history
Postgres gets mad when booleans get integers.
  • Loading branch information
markstory committed Mar 20, 2014
1 parent 6ad59a4 commit 50f90b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions tests/Fixture/BakeArticleFixture.php
@@ -1,7 +1,5 @@
<?php
/**
* BakeArticleFixture
*
* CakePHP(tm) Tests <http://book.cakephp.org/2.0/en/development/testing.html>
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
Expand All @@ -19,7 +17,7 @@
use Cake\TestSuite\Fixture\TestFixture;

/**
* Short description for class.
* BakeArticleFixture
*
*/
class BakeArticleFixture extends TestFixture {
Expand All @@ -34,7 +32,7 @@ class BakeArticleFixture extends TestFixture {
'bake_user_id' => ['type' => 'integer', 'null' => false],
'title' => ['type' => 'string', 'null' => false],
'body' => 'text',
'published' => ['type' => 'boolean', 'length' => 1, 'default' => 0],
'published' => ['type' => 'boolean', 'length' => 1, 'default' => false],
'created' => 'datetime',
'updated' => 'datetime',
'_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
Expand Down
6 changes: 2 additions & 4 deletions tests/Fixture/CounterCachePostFixture.php
@@ -1,7 +1,5 @@
<?php
/**
* Counter Cache Test Fixtures
*
* CakePHP(tm) Tests <http://book.cakephp.org/2.0/en/development/testing.html>
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
Expand All @@ -19,7 +17,7 @@
use Cake\TestSuite\Fixture\TestFixture;

/**
* Short description for class.
* Counter Cache Test Fixtures
*
*/
class CounterCachePostFixture extends TestFixture {
Expand All @@ -28,7 +26,7 @@ class CounterCachePostFixture extends TestFixture {
'id' => ['type' => 'integer'],
'title' => ['type' => 'string', 'length' => 255],
'user_id' => ['type' => 'integer', 'null' => true],
'published' => ['type' => 'boolean', 'null' => false, 'default' => 0],
'published' => ['type' => 'boolean', 'null' => false, 'default' => false],
'_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]]
);

Expand Down

0 comments on commit 50f90b0

Please sign in to comment.