propelorm / Propel2

Propel2 is an open-source high-performance Object-Relational Mapping (ORM) for modern PHP
http://propelorm.org/
MIT License
1.26k stars 399 forks source link

propel reverse doesn't generate foreign-key tag un schema #1785

Open Nekool opened 3 years ago

Nekool commented 3 years ago

Hello there, I am migrating an application from PHP 5.6 to php 7(.4) with a mariadb10 database (tried with mysql8 too)and decided that it would be wise to upgrade from propel 1. to propel2. I managed to but at the moment of the generation of models the shema did not have mention of foreign keys but instead "index" with "name" property containing the name of the foreign key defined in the database. the command i used : propel reverse "mysql:host=localhost;dbname=db;user=root;password=pwd" i have found no argument to precise the creation or not of foreign keys, so i just copy pasted exemple of schema present in the documentation, and it seemed to work for SOME models but not one despite having the correct tags to define the foreign key for table 'suivis'.

my config seems fine and no table has been excluded. (sorry for bad english)