Skip to content
Browse files

Merge remote-tracking branch 'upstream/1.6' into 1.6

  • Loading branch information...
2 parents 9ec1311 + d6c2eba commit c453dfe55dd86adbb8b1a31997e4b80c65464812 rozwell committed
View
13 lib/addon/sfPropelDatabaseSchema.class.php
@@ -963,10 +963,19 @@ protected function getCorrectValueFor($key, $value)
{
return $value == 1 ? 'true' : 'false';
}
- else
+ $acceptStringBoolean = array('default');
+ if (in_array($key, $acceptStringBoolean))
{
- return null === $value ? 'null' : $value;
+ if ($value === true)
+ {
+ return 'true';
+ }
+ if ($value === false)
+ {
+ return 'false';
+ }
}
+ return null === $value ? 'null' : $value;
}
/**
View
2 test/unit/fixtures/new_schema.yml
@@ -28,6 +28,8 @@ classes:
first_name: { type: varchar, size: 255, default: "Anonymous" }
last_name: varchar(50)
age: { type: integer, required: true, index: true }
+ is_alive: { type: boolean, default: true }
+ is_dead: { type: boolean, required: true, default: false }
ab_group_id:
created_at:
View
4 test/unit/fixtures/schema.xml
@@ -22,6 +22,8 @@
<index>
<index-column name="age" />
</index>
+ <column name="is_alive" type="boolean" default="true" />
+ <column name="is_dead" type="boolean" required="true" default="false" />
<column name="ab_group_id" type="integer" />
<foreign-key foreignTable="ab_group">
<reference local="ab_group_id" foreign="id" />
@@ -64,7 +66,7 @@
<table name="ij_article" phpName="Article" behaviors="a:2:{s:8:&quot;paranoid&quot;;a:1:{s:6:&quot;column&quot;;s:10:&quot;deleted_at&quot;;}s:17:&quot;act_as_nested_set&quot;;N;}">
<behavior name="paranoid">
- <parameter name="column" value="deleted_at" />
+ <parameter name="column" value="deleted_at"/>
</behavior>
<behavior name="act_as_nested_set" />
<column name="title" type="varchar" size="50" />
View
2 test/unit/fixtures/schema.yml
@@ -21,6 +21,8 @@ propel:
first_name: { type: varchar, size: 255, default: "Anonymous" }
last_name: varchar(50)
age: { type: integer, required: true, index: true }
+ is_alive: { type: boolean, default: true }
+ is_dead: { type: boolean, required: true, default: false }
ab_group_id:
created_at:
View
2 test/unit/sfPropelDatabaseSchemaTest.php
@@ -47,7 +47,7 @@ public function is_line_by_line($exp1, $exp2)
require_once SF_DIR . 'lib/util/sfToolkit.class.php';
require_once SF_DIR . 'lib/yaml/sfYaml.php';
-$t = new my_lime_test(409);
+$t = new my_lime_test(423);
$t->diag('Classical YAML to XML conversion');
$p = new sfPropelDatabaseSchema();

0 comments on commit c453dfe

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