Fopa Léon Constantin
Fopa Léon Constantin

Reputation: 12363

Why my tables are not create by Doctrine in symfony

I'm learning how to use the php framework symfony 1.4, I'm on the model usage learning. I've write the model in the schema.yml, and I've run the following commands :

php symfony doctrine:build model which create the model's .class.php files, but i've look on my MySQL database manager and notice that, the database has been create but it still empty. Tables were not created automatically.

So when I try to deal with my datebase, I get exceptions like :

SQLSTATE[42S02]: Base table or view not found: 1146 table 'parlonsaffaires.blog_article' doesn't exists

Can someone help me ?

thanks to any reply

Upvotes: 0

Views: 1476

Answers (2)

Steven Mercatante
Steven Mercatante

Reputation: 25305

You might have other classes already cached which could cause that error. Try running php symfony cc to clear the cache, then try building the database again using php symfony doctrine:build --all (I don't think php symfony doctrine:build model will work in Symfony 1.4 - make sure you're following the latest version of the Jobeet tutorial).

Upvotes: 2

Grad van Horck
Grad van Horck

Reputation: 4506

Use php symfony doctrine:build --all to build models, SQL and database.

(Also, use php symfony help doctrine:build to see more info about the doctrine:build task.)

Upvotes: 3

Related Questions