M
M
Maxim Barulin2014-11-07 18:47:33
symfony
Maxim Barulin, 2014-11-07 18:47:33

How to combine innodb and myisam in doctrine 2?

Good day, Habr!
There was a need to combine the two engines. The need is called a spatial index (spatial index), innodb does not support this type of index, so you need to use myisam. And everything would be fine, but the table in which the field with the polygon type is located has an m2m connection to another table, and when updating the schema, the doctrine stubbornly tries to create a foreign key from m2m to the table with an index, although the myisam engine is registered in the table settings

Ent:
    type: entity
    table: MyTable
    options:
        engine: MyISAM

How to explain to the doctrine that it is not necessary to create a foreign key?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2014-11-07
Protko @Fesor

mysqlserverteam.com/innodb-spatial-indexes-in-5-7-... A
foreign key is a response to a related entity. Remove the connections and everything will be fine. Or abandon schema:update and update everything only with migrations (migration:diff and remove unnecessary key generation there).
Unfortunately, there is currently no other solution to the problem. Unless you upgrade at your own risk to a test version of mysql and stay on innodb or migrate to postgresql.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question