GrowyTobe
GrowyTobe

Reputation: 145

Symfony 6 - loading fixtures in not possible because of SQLSTATE[42P01]: Undefined table: 7

I made two entities: "Personne" and "Famille". Personne entity has properties: firstname, lastname, age and Famille entity has side property.

I'm using orm-fixtures and fzaninotto/faker to create fake data.

How I did it:

Firstly I made Personne entity then created the data using:

Symfony console make:fixture

and

Symfony console doctrine:fixture:load

which worked well.

Then I proceed to do the same with Famille entity but then at:

Symfony console doctrine:fixture:load

I got the error:

In ExceptionConverter.php line 71:

An exception occurred while executing a query: SQLSTATE[42P01]: Undefined table: 7 ERROR: relation « famille » doesn't exist
LINE 1: DELETE FROM famille ^

In Exception.php line 28:

SQLSTATE[42P01]: Undefined table: 7 ERROR: relation « famille » doesn't exist LINE 1: DELETE FROM famille ^

In Connection.php line 31:

SQLSTATE[42P01]: Undefined table: 7 ERROR: relation « famille » doesn't exist LINE 1: DELETE FROM famille ^

But I don't understand because I have no relation now. I tried to make OneToOne relation between Personne and Famille entities but I had this error and then tried again without the relation OneToOne but the error is still here. What should I do?

Upvotes: 0

Views: 613

Answers (1)

GrowyTobe
GrowyTobe

Reputation: 145

I forgot to do the migrations again, so:

symfony console make:migration
symfony console doctrine:migrations:migrate

Upvotes: 1

Related Questions