Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create database from Doctrine model with Symfony

I've created a new database with the SQL CREATE DATABASE command to host my application tables. I would now generate the database from my Symony 2.1 project using Doctrine. I already have the correct mapping YML-PHP entities but when I try to use the command

php app/vendors doctrine:schema:create

it fails on a query that I run inside my application. What I don't understand is why it seems that it's trying to boot my bundle and so obviously it fails because the queries that I execute don't find the tables. How can I generate the new database?

Base table or view not found: 1146 Table 'mydatabase.mytable_menu' doesn't exist
like image 926
Stefano Avatar asked Apr 21 '26 11:04

Stefano


1 Answers

That command only creates the database for you. You will need to run this command to generate the actual database tables for your entities.

php app/console doctrine:schema:update --force
like image 144
Jhonne Avatar answered Apr 22 '26 23:04

Jhonne