Doctrine integration
❓ Support Question / Feature Request
Hello!
I would use the Doctrine ORM for our bot package, it would make sense to me, because we can use DB easier. In the end I can create the PR, if my idea sounds okay :)
To do that, I have to solve a problem...
I'm trying to convert the SQL-file to Doctrine Entities. https://github.com/php-telegram-bot/core/blob/master/structure.sql
I need to use command in console:
./vendor/bin/doctrine orm:convert-mapping php src/ --from-database --force
But I've got an error...
Property "chat" in "EditedMessage" was already declared, but it must be declared only once
How can I fix it?
Thank you a lot!
Seems that having chat_id in multiple foreign keys is the problem here.
There are other errors too after fixing the edited_message table foreign key which I'm busy trying to fix.
@MyZik Have you made any progress on this? I saw your issue at https://github.com/doctrine/orm/issues/8108, but there aren't any solutions there yet either 😕
After lots of testing and checking, the problem are the foreign key definitions. Because we have certain tables that have multiple foreign keys with the same signature (i.e. using the same table-field combinations), Doctrine sees this as a duplicate and therefore throws the error.
Maybe there is a flag for doctrine to ignore such errors?
As far as I can tell, there is nothing we can do, apart from removing those foreign key constraints 😕
@MyZik Have you found some solution for this yet?