During my tinkering around with SchemaTool which removed the need to drop 
tables in the ValueConversion tests the 
Doctrine\Tests\ORM\Functional\ValueConversionType\OneToOneCompositeIdTest 
is now failing because the unique index name already exists with

Doctrine\DBAL\Exception\TableExistsException: An exception occurred while 
executing 'CREATE UNIQUE INDEX associatedEntity_uniq ON 
vct_owning_onetoone_compositeid (associated_id1, associated_id2)'

I can see in my debugs:

  string(127) "CREATE UNIQUE INDEX associated_entity_uniq ON 
vct_owning_onetoone_compositeid_foreignkey (associated_id, 
associated_foreign_id)"
  [4]=>
  string(126) "CREATE UNIQUE INDEX associatedEntity_uniq ON 
vct_owning_onetoone_compositeid_foreignkey (associated_id, 
associated_foreign_id)"

  string(109) "CREATE UNIQUE INDEX associatedEntity_uniq ON 
vct_owning_onetoone_compositeid (associated_id1, associated_id2)"

But this index is on a different table.

The unique constraints are created in 
lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php
_validateAndCompleteOneToOneMapping()
                
$this->table['uniqueConstraints'][$mapping['fieldName']."_uniq"] = array(
                    'columns' => $uniqueConstraintColumns
                );

I don't know anything about SQLite and whether it requires unique index 
names.

Does anyone with more knowledge on how this stuff works have some 
suggestions?

I'd probably look at modifying things to use the naming strategy, after 
extending it to support unique constraints, and defaulting to the hashed 
value used in other indexes and make sure to include the table name when 
creating the hash.

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to