Ask your Symfony questions! Pay money and get answers fast! (more info)

Why does 'doctrine:build-schema' give me 'Missing class name' Symfony

  • SOLVED

I run this:

./symfony doctrine:build-schema

I get this error:

<blockquote>Missing class name. </blockquote>

Check the screenshot.

I went to Google and started looking for info about this error. [[LINK href="http://groups.google.com/group/symfony-users/browse_thread/thread/a292c3ffa44216d2/a695d893792cbc2e?show_docid=a695d893792cbc2e#"]]I saw this thread on Google Groups[[/LINK]].

Someone suggested the problem was in schema.yml.

Pratik Mazumder summarizes my confusion when they write:

<blockquote>schema.yml definition? But that's an empty file till now. I am trying to
make the same with php symfony doctrine:build-schema </blockquote>


Alexandre Salomé replied:

<blockquote>Can be because of empty file. Building a non existing schema....
OK, add a simple definition to your schema before continuing tests </blockquote>

I decided to delete the config/doctrine/schema.yml file and try again. But I still got the same error.

Any suggestions?

symfony version 1.4.8

[UPDATE]

Someone asked about PDO support:


php -i | grep -i pdo
/etc/php5/cli/conf.d/pdo.ini,
/etc/php5/cli/conf.d/pdo_mysql.ini,
PDO
PDO support => enabled
PDO drivers => mysql
pdo_mysql
PDO Driver for MySQL, client library version => 5.1.37




Someone suggested that I might be using a reserved keyword as a table name. These are my table names:

mysql> show tables;

+------------------------------------------------------------------+
| Tables_in_msc_wine |
+------------------------------------------------------------------+
| appellation |
| bottle_size |
| color |
| contact |
| container |
| country |
| grape |
| importer |
| importers |
| many_to_many_map_of_content_to_content |
| many_to_many_map_of_messages_for_outside_organization_to_content |
| many_to_many_map_of_restrictions_to_content |
| many_to_many_map_of_to_do_to_content |
| many_to_many_map_wine_to_importer |
| media |
| messages_for_outside_organization |
| note |
| note_version |
| publishing_history |
| region |
| restrictions_on_use |
| sf_guard_forgot_password |
| sf_guard_group |
| sf_guard_group_permission |
| sf_guard_permission |
| sf_guard_remember_key |
| sf_guard_user |
| sf_guard_user_group |
| sf_guard_user_permission |
| sub_type |
| tag |
| tagging |
| taster_coverage |
| tasting_group |
| tastingnotes |
| to_do |
| type |
| wine |
| winery |
+------------------------------------------------------------------+
39 rows in set (0.05 sec)



[UPDATE]

Interesting. I deleted every table in the database and then recreated just the first 2 tables:


SET @[email protected]@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @[email protected]@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @[email protected]@SQL_MODE, SQL_MODE='TRADITIONAL';


-- -----------------------------------------------------
-- Table `country`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `country` ;

CREATE TABLE IF NOT EXISTS `country` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT ,
`name` VARCHAR(255) NULL DEFAULT NULL ,
PRIMARY KEY (`id`) ,
UNIQUE KEY (`id`)
)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;


-- -----------------------------------------------------
-- Table `sf_guard_user`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `sf_guard_user` ;

CREATE TABLE IF NOT EXISTS `sf_guard_user` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT ,
`first_name` VARCHAR(255) NOT NULL ,
`last_name` VARCHAR(255) NOT NULL ,
`email_address` VARCHAR(255) NOT NULL ,
`username` VARCHAR(128) NOT NULL ,
`algorithm` VARCHAR(128) NOT NULL DEFAULT 'sha1' ,
`salt` VARCHAR(128) NOT NULL ,
`password` VARCHAR(128) NOT NULL ,
`is_active` TINYINT(1) NULL DEFAULT '1' ,
`is_super_admin` TINYINT(1) NULL DEFAULT '0' ,
`last_login` DATETIME NOT NULL ,
`created_at` DATETIME NOT NULL ,
`updated_at` DATETIME NOT NULL ,
PRIMARY KEY (`id`) ,
UNIQUE KEY (`id`),
UNIQUE INDEX `email_address` (`email_address` ASC) ,
UNIQUE INDEX `username` (`username` ASC) ,
INDEX `is_active_idx_idx` (`is_active` ASC) )
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;


Then I run:

./symfony doctrine:build-schema


and I get the error:

Couldn't find class Content

I wonder if this has something to do with running in the sandbox?

This is the first page that comes up on Google for this error:

[[LINK href="http://melikedev.com/2009/12/09/symfony-w-doctrine-saving-many-to-many-mm-relationships/"]]http://melikedev.com/2009/12/09/symfony-w-doctrine-saving-many-to-many-mm-relationships/[[/LINK]]


[UPDATE]

I've uploaded the entire schema. Can anyone load this into a database and then run doctrine:build-schema?


[UPDATE]

Maybe this problem has a solution, but I do not want to spend any more time looking for it. I will remove the foreign key constraints from the MySql schema. I will try to enforce the foreign keys from the Symfony schema.

Answers (5)

2010-11-17

Loban Rahman answers:

Make sure your /config/doctrine folder is empty of all yml files.

Please post the following things, it will help debug:

(1) A sql dump of your database structure (just structure, no data)
(2) Your database.yml file
(3) The output when you run "symfony --trace doctrine:build-schema"


Lawrence Krubner comments:

Interesting. This is what I get:

./symfony --trace doctrine:build-schema

>> doctrine generating yaml schema from database
>> Doctrine_Connection_Mysql exec : SET NAMES 'UTF8' - ()
>> Doctrine_Connection_Mysql query : SHOW TABLES - ()
>> Doctrine_Connection_Mysql query : DESCRIBE appellation - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'appellation' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE bottle_size - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'bottle_size' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE color - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'color' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE contact - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'contact' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE container - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'container' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE country - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'country' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE grape - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'grape' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE importer - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'importer' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE importers - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'importers' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE many_to_many_map_of_content_to_content - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'many_to_many_map_of_content_to_content' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE many_to_many_map_of_messages_for_outside_organization_to_content - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'many_to_many_map_of_messages_for_outside_organization_to_content' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE many_to_many_map_of_restrictions_to_content - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'many_to_many_map_of_restrictions_to_content' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE many_to_many_map_of_to_do_to_content - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'many_to_many_map_of_to_do_to_content' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE many_to_many_map_wine_to_importer - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'many_to_many_map_wine_to_importer' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE media - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'media' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE messages_for_outside_organization - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'messages_for_outside_organization' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE note - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'note' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE note_version - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'note_version' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE publishing_history - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'publishing_history' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE region - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'region' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE restrictions_on_use - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'restrictions_on_use' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE sf_guard_forgot_password - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'sf_guard_forgot_password' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE sf_guard_group - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'sf_guard_group' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE sf_guard_group_permission - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'sf_guard_group_permission' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE sf_guard_permission - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'sf_guard_permission' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE sf_guard_remember_key - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'sf_guard_remember_key' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE sf_guard_user - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'sf_guard_user' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE sf_guard_user_group - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'sf_guard_user_group' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE sf_guard_user_permission - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'sf_guard_user_permission' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE sub_type - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'sub_type' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE tag - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'tag' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE tagging - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'tagging' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE taster_coverage - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'taster_coverage' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE tasting_group - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'tasting_group' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE tastingnotes - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'tastingnotes' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE to_do - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'to_do' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE type - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'type' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE wine - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'wine' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()
>> Doctrine_Connection_Mysql query : DESCRIBE winery - ()
>> Doctrine_Connection_Mysql query : SELECT DATABASE() - ()
>> Doctrine_Connection_Mysql query : SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = 'winery' AND table_schema = 'msc_wine' and REFERENCED_COLUMN_NAME is not NULL - ()


Lawrence Krubner comments:

Looking at the above output, it seems correct. Those are all of the tables.


Loban Rahman comments:

??? Where's the "missing class name" error message? Did you paste the entire output of the "symfony --trace doctrine:build-schema" command?


Loban Rahman comments:

Your last UPDATE made my think of something. Follow these steps please:

(1) Remove any schema file in config/doctrine
(2) ./symfony cc
(3) ./symfony doctrine:clean-model-files
(4) ./symfony cc
(5) ./symfony doctrine:build-schema

I've found that having old model files lying around always causes issues. Even after doing step #3, please check your lib/*/doctrine folders to make sure no spurious files are lying around and being auto-loaded.


Loban Rahman comments:

I see that you are using the sandbox. Doesn't it come with a default schema and tables? It all the more makes me think you have stale model files lying around.


Lawrence Krubner comments:

Loban,

Thanks. Your 5 step program fixed the error I was having with "Couldn't find class Content".

That was the error I got with half schema loaded.

However, when I went back to testing against the entire schema, the original error, " Missing class name" returned.

2010-11-18

Tejaswi Sharma answers:

Some one wrote in this forum [[LINK href="http://oldforum.symfony-project.org/index.php/t/22732/"]]http://oldforum.symfony-project.org/index.php/t/22732/[[/LINK]]
<blockquote>
Hi,

I have same problem, but in my case, the problem was in the relationship references.It because, after create DER in MySql Workbench, I change the name of tables manually in sql script, but don't change de relationship references, and run it with this error, MySQL don't complained. Then I have this error from symfony:doctrine:build-schema task. The solution was alter tables relationships references.

Hope it helps.
</blockquote>

Is this the case with you?


Lawrence Krubner comments:

That could be. I created the schema with MySql WorkBench, then made some changes by hand.


Tejaswi Sharma comments:

If that could be the case, could you also give the dump of your database structure(no data) so that I could test it on my machine too.


Lawrence Krubner comments:

I deleted all the tables and added 2 back in. Now I am getting a different error. I updated the question, up above, with the schema of the 2 tables that I recreated.


Tejaswi Sharma comments:

Lawrence , One thing I could tell you for sure that there is no problem in your db structure because in my machine the build command ran just fine.
<blockquote>
[email protected]:~/BrijjSetup_upgraded$ /usr/local/php5_3/bin/php ./symfony doctrine:build-schema>> doctrine generating yaml schema from database
>> doctrine Generate YAML schema successfully from database
</blockquote>

You may have issue with the sandbox itself. Why don't you create a normal setup other than sandbox and then try


Tejaswi Sharma comments:

The generated schema.yml is here


Tejaswi Sharma comments:

Sorry it denied to accept yml files so I renamed it to txt