I'm trying to create a schema using vendor\bin\doctrine orm:schema-tool:create but getting this error:
Fatal error: Uncaught PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'eventapp.event' doesn't exist in C:\\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOStatement.php:105
I'm using MySQL and Doctrine ORM 2. The schema existed before with the same tables and I used vendor\bin\doctrine orm:schema-tool:drop --force right before, which executed correctly, so it can't be a problem with the connection. orm:schema-tool:update gives me the same error.
I tried deleting the schema and creating it again with the same name, still getting the error. I have also checked the annotations for each entity class, they're all correct. Example:
/**
* @ORM\Entity
* @ORM\Table(name="event")
**/
class Event
{
...
My guess: I have two entities with a Many-to-One association to event and I'm assuming the schema tool is looking for that table when creating the schema, and since it doesn't exist, I'm getting this error. The fact that I'm getting the error twice seems to support that, but I might be completely wrong. This is what the association looks like:
/**
* @ORM\ManyToOne(targetEntity="Event")
* @ORM\JoinColumn(name="event", referencedColumnName="id")
*/
private $event;
with no corresponding entry in event since I only need it to be unidirectional.
Edit: Nope. Removed all associations from my entities. Still getting the exact same error message. I'm completely lost here.
How can I get Doctrine to correctly create the schema here? I haven't tried creating an empty event table, but that wouldn't be a desired solution anyway since I want it to be easily deployable with no further setup...