My enities:
```
<?php
namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Inventory entity
 *
 * @ORM\Entity(repositoryClass="Net\Repository\Inventory")
 * @ORM\Table(name="inventory")
 * @ORM\InheritanceType("JOINED")
 * @ORM\DiscriminatorColumn(name="discriminator_column", type="string")
 * @ORM\DiscriminatorMap({"inventory" = "AbstractItem", "inventory_room" = 
"Room"})
 *
 * @category Net
 * @package  Model
 */
abstract class AbstractItem
{
    /**
     * @ORM\Id @ORM\Column(name="inventory_id") @ORM\GeneratedValue
     * @var int
     */
    protected $inventory_id;

    /**
     * @ORM\Column(type="string")
     * @var string
     */
    protected $category;

    /**
     * @ORM\Column(type="string")
     * @var string
     */
    protected $part_number;
}
```

```
<?php
namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Inventory Room entity
 * @ORM\Entity
 * @ORM\Table(name="inventory_room")
 *
 * @category Net
 * @package  Model
 */
class Room extends AbstractItem
{
    /**
     * @ORM\Column(type="string")
     * @var string
     */
    protected $room_type;

    /**
     * @ORM\Column(type="string")
     * @var string
     */
    protected $rack_limit;
}
```
Then i run the command:
```
$ app/console doctrine:schema:update --force
Updating database schema...
Database schema updated successfully! "3" queries were executed
```
And look at the table schema.
```
CREATE TABLE `inventory` (
  `inventory_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `category` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `part_number` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `discriminator_column` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`inventory_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
```

```
CREATE TABLE `inventory_room` (
  `inventory_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `room_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `rack_limit` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`inventory_id`),
  CONSTRAINT `FK_38399EB59EEA759` FOREIGN KEY (`inventory_id`) REFERENCES 
`inventory` (`inventory_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
```
You see that Doctrine use ON DELETE CASCADE, but not use: ON UPDATE CASCADE

What option should I include to use ON UPDATE CASCADE.

I test this issues on versions:

"doctrine/orm": "^2.4.8" - "reference": 
"5aedac1e5c5caaeac14798822c70325dc242d467"

"doctrine/orm": "v2.5.1" - "reference": 
"e6a83bedbe67579cb0bfb688e982e617943a2945"

-- 
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 https://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to