0

Here https://stackoverflow.com/a/13374264/6250381 is written "then update your schema", but how to make that?

Try using

/**
 * @ORM\ManyToOne(targetEntity="Report", inversedBy="responses")
 * @ORM\JoinColumn(name="reportId", referencedColumnName="id", onDelete="CASCADE")
 */
protected $report;

And then update your schema. It will add database level Cascading

Community
  • 1
  • 1
Max
  • 27
  • 2
  • 8
  • 5
    Use `php bin/console doctrine:schema:update --force` command – Jakub Matczak Jan 16 '17 at 12:39
  • [Doctrine\DBAL\DBALException] Unknown database type enum requested, Doctrine\DBAL\Platforms\MySqlPlatform may not support it. – Max Jan 16 '17 at 12:42
  • You probably have some other error in you DB configuration, but it doesn't relate to this issue. It looks like you're using `enum` type for some field which is not supported in this configuration. – Jakub Matczak Jan 16 '17 at 12:47
  • with enum I resolve, I think with http://stackoverflow.com/a/12925885/6250381 – Max Jan 16 '17 at 12:52
  • now I have problem `SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails` when run update – Max Jan 16 '17 at 12:55
  • 3
    I would suggest rolling back your schema changes. Then make one small change and run update. See how it works. Then make another change. As it stands, it seems like you made a bunch of changes. The syntax errors will keep messing with you until you understand them. – Cerad Jan 16 '17 at 14:03

1 Answers1

0

Even if before, I made migration and migrated. I needed to use this command to helped me to update my doctrine database schema php bin/console doctrine:schema:update --force

Joffrey Outtier
  • 880
  • 10
  • 9