0

Mysql 5.6 Doctrine 2.5

I created a table with 19 columns and ran

php app/console doctrine:generate:entities AcmeBlogBundle

As described here:

http://symfony.com/doc/current/doctrine/reverse_engineering.html

Which created the entitity class and repository class but only created the id column. Also I notice there is no meta info such as autonumber for the id...I also tried with -vvv but it runs without error.

    namespace Test\CoreBundle\Entity;

/**
 * TestEvent
 */
class TestEvent
{
    /**
     * @var integer
     */
    private $id;


    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }
}

Why did it not create the other 18 properties?

jim smith
  • 2,394
  • 5
  • 29
  • 35
  • 2
    Please add the code for the mapping file that you generated – JimL Jan 08 '17 at 11:50
  • Hmm... there is no doctrine folder in `src/Test/CoreBundle/Resources/config` – jim smith Jan 08 '17 at 12:05
  • 1
    What happens when you run the mapping import command? – JimL Jan 08 '17 at 12:06
  • [Doctrine\ORM\Mapping\MappingException] "Table SELECT * from temp_update_table has no primary key." There is no table with that name. – jim smith Jan 08 '17 at 12:13
  • 1
    You can refer to [this answer](http://stackoverflow.com/a/15766666/1078488) for tables without a PK, but it's much easier to just remove it if you're able to. Make sure you have a proper db backup before venturing into this – JimL Jan 08 '17 at 12:15

0 Answers0