Skip to content

Commit

Permalink
#881 DDC-2825 - renaming table/schema name for clarity and to avoid c…
Browse files Browse the repository at this point in the history
…ollisions
  • Loading branch information
Ocramius committed Jan 14, 2015
1 parent 7b168de commit 7164e28
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,11 @@

namespace Doctrine\Tests\Models\DDC2825;

/**
* @Entity
* @Table(name="mytable", schema="myschema")
*/
/** @Entity @Table(name="explicit_table", schema="explicit_schema") */
class ExplicitSchemaAndTable
{
const CLASSNAME = __CLASS__;

/**
* @Id @Column()
*/
/** @Id @Column(type="integer") @GeneratedValue(strategy="AUTO") */
public $id;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,12 @@
* Quoted column name to check that sequence names are
* correctly handled
*
* @Entity
* @Table(name="myschema.mytable")
* @Entity @Table(name="implicit_schema.implicit_table")
*/
class SchemaAndTableInTableName
{
const CLASSNAME = __CLASS__;

/**
* @Id @Column()
*/
/** @Id @Column(type="integer") @GeneratedValue(strategy="AUTO") */
public $id;
}
Original file line number Diff line number Diff line change
Expand Up @@ -944,8 +944,8 @@ public function testSchemaDefinitionViaExplicitTableSchemaAnnotationProperty()
/* @var $metadata \Doctrine\ORM\Mapping\ClassMetadata */
$metadata = $this->createClassMetadataFactory()->getMetadataFor(ExplicitSchemaAndTable::CLASSNAME);

$this->assertSame('myschema', $metadata->getSchemaName());
$this->assertSame('mytable', $metadata->getTableName());
$this->assertSame('explicit_schema', $metadata->getSchemaName());
$this->assertSame('explicit_table', $metadata->getTableName());
}

/**
Expand All @@ -957,8 +957,8 @@ public function testSchemaDefinitionViaSchemaDefinedInTableNameInTableAnnotation
/* @var $metadata \Doctrine\ORM\Mapping\ClassMetadata */
$metadata = $this->createClassMetadataFactory()->getMetadataFor(SchemaAndTableInTableName::CLASSNAME);

$this->assertSame('myschema', $metadata->getSchemaName());
$this->assertSame('mytable', $metadata->getTableName());
$this->assertSame('implicit_schema', $metadata->getSchemaName());
$this->assertSame('implicit_table', $metadata->getTableName());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
/* @var $metadata ClassMetadata */

$metadata->setPrimaryTable(array(
'name' => 'mytable',
'schema' => 'myschema',
'name' => 'explicit_table',
'schema' => 'explicit_schema',
));

$metadata->mapField(array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* @var $metadata ClassMetadata */

$metadata->setPrimaryTable(array(
'name' => 'myschema.mytable',
'name' => 'implicit_schema.implicit_table',
));

$metadata->mapField(array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
https://raw.github.com/doctrine/doctrine2/master/doctrine-mapping.xsd"
>
<entity name="Doctrine\Tests\Models\DDC2825\ExplicitSchemaAndTable" table="mytable" schema="myschema">
<entity name="Doctrine\Tests\Models\DDC2825\ExplicitSchemaAndTable" table="explicit_table" schema="explicit_schema">
<id name="id" column="id">
<generator strategy="AUTO"/>
</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
https://raw.github.com/doctrine/doctrine2/master/doctrine-mapping.xsd"
>
<entity name="Doctrine\Tests\Models\DDC2825\SchemaAndTableInTableName" table="myschema.mytable">
<entity name="Doctrine\Tests\Models\DDC2825\SchemaAndTableInTableName" table="implicit_schema.implicit_table">
<id name="id" column="id">
<generator strategy="AUTO"/>
</id>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Doctrine\Tests\Models\DDC2825\ExplicitSchemaAndTable:
type: entity
table: mytable
schema: myschema
table: explicit_table
schema: explicit_schema
id:
id:
generator:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Doctrine\Tests\Models\DDC2825\SchemaAndTableInTableName:
type: entity
table: myschema.mytable
table: implicit_schema.implicit_table
id:
id:
generator:
Expand Down

0 comments on commit 7164e28

Please sign in to comment.