Permalink
Browse files

Merge branch 'develop' into autoload

  • Loading branch information...
2 parents 80772da + 0c839d4 commit 328b0bcfcd51e92374035092c51de1bd5b5ec23a @opengeek committed May 8, 2012
@@ -18,7 +18,7 @@
'password' => NULL,
'integer' => NULL,
'float' => '1.01230',
- 'boolean' => 0,
+ 'boolean' => NULL,
),
'fieldMeta' =>
array (
@@ -107,13 +107,13 @@
'precision' => '1',
'phptype' => 'boolean',
'null' => false,
- 'default' => 0,
),
),
'indexes' =>
array (
'PRIMARY' =>
array (
+ 'alias' => 'PRIMARY',
'primary' => true,
'unique' => true,
'columns' =>
@@ -125,6 +125,7 @@
),
'unique_varchar' =>
array (
+ 'alias' => 'unique_varchar',
'primary' => false,
'unique' => true,
'columns' =>
@@ -18,7 +18,7 @@
'password' => NULL,
'integer' => NULL,
'float' => 1.0123,
- 'boolean' => 0,
+ 'boolean' => NULL,
),
'fieldMeta' =>
array (
@@ -105,7 +105,6 @@
'dbtype' => 'bit',
'phptype' => 'boolean',
'null' => false,
- 'default' => 0,
),
),
'indexes' =>
@@ -66,12 +66,12 @@
<field key="password" dbtype="varchar" phptype="password" null="false" />
<field key="integer" dbtype="int" phptype="integer" null="false" />
<field key="float" dbtype="decimal" precision="10,5" phptype="float" null="false" default="1.01230" />
- <field key="boolean" dbtype="tinyint" precision="1" phptype="boolean" null="false" default="0" />
+ <field key="boolean" dbtype="tinyint" precision="1" phptype="boolean" null="false" />
- <index name="PRIMARY" primary="true" unique="true">
+ <index alias="PRIMARY" name="PRIMARY" primary="true" unique="true">
<column key="id" />
</index>
- <index name="unique_varchar" primary="false" unique="true">
+ <index alias="unique_varchar" name="unique_varchar" primary="false" unique="true">
<column key="unique_varchar" />
</index>
</object>
@@ -92,10 +92,10 @@
<field key="date_modified" dbtype="timestamp" phptype="timestamp" null="false" default="CURRENT_TIMESTAMP" />
</object>
- <index name="name" primary="false" unique="true">
+ <index alias="name" name="name" primary="false" unique="true">
<column key="name" length="" collation="A" null="false" />
</index>
- <index name="color" primary="false" unique="false">
+ <index alias="color" name="color" primary="false" unique="false">
<column key="color" length="" collation="A" null="false" />
</index>
<object class="implicit.subpkg.xPDOSubSample" table="xpdosubsample" extends="xPDOSample">
@@ -59,7 +59,7 @@
<field key="password" dbtype="varchar" phptype="password" null="false" />
<field key="integer" dbtype="int" phptype="integer" null="false" />
<field key="float" dbtype="decimal" precision="(10,5)" phptype="float" null="false" default="1.01230" />
- <field key="boolean" dbtype="bit" phptype="boolean" null="false" default="0" />
+ <field key="boolean" dbtype="bit" phptype="boolean" null="false" />
<index name="unique_varchar" primary="false" unique="true">
<column key="unique_varchar" />
View
@@ -339,7 +339,7 @@ public function testGetFields($class,array $correctFields = array()) {
$diff = array_diff($fields,$correctFields);
$diff2 = array_diff($correctFields,$fields);
$success = is_array($fields) && empty($diff) && empty($diff2);
- $this->assertTrue($success);
+ $this->assertEquals($correctFields, $fields);
}
/**
* Data provider for testGetFields
@@ -361,6 +361,7 @@ public function providerGetFields() {
'security_level' => 1,
)),
array('xPDOSample', array(
+ 'id' => NULL,
'parent' => 0,
'unique_varchar' => NULL,
'varchar' => NULL,
@@ -372,10 +373,11 @@ public function providerGetFields() {
'enum' => NULL,
'password' => NULL,
'integer' => NULL,
- 'float' => 1.0123,
+ 'float' => 1.01230,
'boolean' => NULL,
)),
array('implicit.subpkg.xPDOSubSample', array(
+ 'id' => NULL,
'parent' => 0,
'unique_varchar' => NULL,
'varchar' => NULL,
@@ -387,7 +389,7 @@ public function providerGetFields() {
'enum' => NULL,
'password' => NULL,
'integer' => NULL,
- 'float' => 1.0123,
+ 'float' => 1.01230,
'boolean' => NULL,
'another_integer' => NULL
)),
View
@@ -1,5 +1,6 @@
This file shows the changes in this release of xPDO.
+- Prefix indexes with table name for sqlite
- Fix lazy loading of fields on demand
- [#7607] xPDOObject->get(array) triggering invalid lazy loading
- xPDOObject/xPDOSimpleObject support for xPDO::getDescendants()
@@ -120,6 +120,7 @@ public function createObjectContainer($className) {
$tableConstraints = array();
if (!empty ($indexes)) {
foreach ($indexes as $indexkey => $indexdef) {
+ $indexkey = $this->xpdo->literal($instance->_table) . '_' . $indexkey;
$indexType = ($indexdef['primary'] ? 'PRIMARY KEY' : ($indexdef['unique'] ? 'UNIQUE' : 'INDEX'));
$index = $indexdef['columns'];
if (is_array($index)) {

0 comments on commit 328b0bc

Please sign in to comment.