OnDelete={"REMOVE"}, Bug? #5155

Closed
opened 2026-01-22 14:59:53 +01:00 by admin · 1 comment
Owner

Originally created by @lukasz18dg on GitHub (Jun 15, 2016).

Originally assigned to: @Ocramius on GitHub.

Good day.
This is my first speech in this "forum", so I apologize in advance if I break any rules of procedure. I was looking for, I have not found.
I have about this problem:
This code works on a SQLite database:

        /**
         * @ORM\ManyToMany(targetEntity="Druzyna", inversedBy="wynikFK")
         * @ORM\JoinTable(name="tablica_Druzyn",
         *     joinColumns={@ORM\JoinColumn(name="wynik_id", referencedColumnName="id", onDelete="REMOVE")},
         *     inverseJoinColumns={@ORM\JoinColumn(name="druzyna_id", referencedColumnName="id", onDelete="REMOVE")}
         *     )
         */
        private $tablicaDruzyn;

The same for MySQL database does not work.
Symfony console, it only returns me this error:
"Invalid foreign key action: REMOVE"
Did I do something?
As you can see, the code earlier, I have a table Many to many on both sides can be accessed. How removal work, it removes the one hand and on the other hand, unfortunately unexplained reasons, is in Table 3, specially created for the lot of many. So I used onDelete = "REMOVE" to me was the part that was in relation to what was removed. But I do not want to act this for MYSQL.

Originally created by @lukasz18dg on GitHub (Jun 15, 2016). Originally assigned to: @Ocramius on GitHub. Good day. This is my first speech in this "forum", so I apologize in advance if I break any rules of procedure. I was looking for, I have not found. I have about this problem: This code works on a SQLite database: ``` php /** * @ORM\ManyToMany(targetEntity="Druzyna", inversedBy="wynikFK") * @ORM\JoinTable(name="tablica_Druzyn", * joinColumns={@ORM\JoinColumn(name="wynik_id", referencedColumnName="id", onDelete="REMOVE")}, * inverseJoinColumns={@ORM\JoinColumn(name="druzyna_id", referencedColumnName="id", onDelete="REMOVE")} * ) */ private $tablicaDruzyn; ``` The same for MySQL database does not work. Symfony console, it only returns me this error: "Invalid foreign key action: REMOVE" Did I do something? As you can see, the code earlier, I have a table Many to many on both sides can be accessed. How removal work, it removes the one hand and on the other hand, unfortunately unexplained reasons, is in Table 3, specially created for the lot of many. So I used onDelete = "REMOVE" to me was the part that was in relation to what was removed. But I do not want to act this for MYSQL.
admin added the Invalid label 2026-01-22 14:59:53 +01:00
admin closed this issue 2026-01-22 14:59:53 +01:00
Author
Owner

@Ocramius commented on GitHub (Jun 15, 2016):

it's onDelete="CASCADE"

@Ocramius commented on GitHub (Jun 15, 2016): it's `onDelete="CASCADE"`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5155