commit 8c53762f6b9125e0379858344b5697110f01d9d9
parent a47e808f1bb5239e6dd1cb65e9a9d3294d4884a0
Author: Felicitus <felicitus@felicitus.org>
Date: Thu, 8 Sep 2011 02:23:55 +0200
Added indexes to categories
Diffstat:
4 files changed, 38 insertions(+), 4 deletions(-)
diff --git a/src/de/RaumZeitLabor/PartKeepr/Category/AbstractCategory.php b/src/de/RaumZeitLabor/PartKeepr/Category/AbstractCategory.php
@@ -14,8 +14,8 @@ declare(encoding = 'UTF-8');
* Represents an abstract category
*/
class AbstractCategory extends BaseEntity implements Node, Serializable {
- /**
- * The "left" property of the nested set
+ /**
+ * The "left" property of the nested set
* @Column(type="integer")
* @var integer
*/
diff --git a/src/de/RaumZeitLabor/PartKeepr/FootprintCategory/FootprintCategory.php b/src/de/RaumZeitLabor/PartKeepr/FootprintCategory/FootprintCategory.php
@@ -7,7 +7,7 @@ declare(encoding = 'UTF-8');
/**
* @Entity
- *
+ * @Table(indexes={@index(name="lft", columns={"lft"}),@index(name="rgt", columns={"rgt"})})
* The entity for our footprint categories
*
*/
diff --git a/src/de/RaumZeitLabor/PartKeepr/PartCategory/PartCategory.php b/src/de/RaumZeitLabor/PartKeepr/PartCategory/PartCategory.php
@@ -7,7 +7,7 @@ declare(encoding = 'UTF-8');
/**
* @Entity
- *
+ * @Table(indexes={@index(name="lft", columns={"lft"}),@index(name="rgt", columns={"rgt"})})
* The entity for our part categories
*
*/
diff --git a/src/de/RaumZeitLabor/PartKeepr/Versions/Version20110908020532.php b/src/de/RaumZeitLabor/PartKeepr/Versions/Version20110908020532.php
@@ -0,0 +1,34 @@
+<?php
+
+namespace DoctrineMigrations;
+
+use Doctrine\DBAL\Migrations\AbstractMigration,
+ Doctrine\DBAL\Schema\Schema;
+
+use de\RaumZeitLabor\PartKeepr\PartKeepr;
+
+class Version20110908020532 extends AbstractMigration
+{
+ public function up(Schema $schema)
+ {
+ $tool = new \Doctrine\ORM\Tools\SchemaTool(PartKeepr::getEM());
+
+ $classes = array(
+ 'de\RaumZeitLabor\PartKeepr\PartCategory\PartCategory',
+ 'de\RaumZeitLabor\PartKeepr\FootprintCategory\FootprintCategory'
+ );
+
+ $aClasses = array();
+
+ foreach ($classes as $class) {
+ $aClasses[] = PartKeepr::getEM()->getClassMetadata($class);
+ }
+
+ $tool->updateSchema($aClasses, true);
+ }
+
+ public function down(Schema $schema)
+ {
+
+ }
+}