When setting up a new application (Zend + Doctrine 1.2) and using the
CLI to generate models from my schema YAML and then create the db
tables I get a message in the CLI that the tables have been created
successfully but checking the database shows that the CLI is lying to
me b/c no tables have been created at all. I can successfully drop,
create and rebuild the db from the CLI, so I know my connection string
is correct. Has anyone else ran into this problem?
# environment
Mac OS X 10.6.1
Zend Framework v 1.9.2
Doctrine 1.2-ALPHA2
PHP 5.2.10
Make sure you generate your models from the YAML, and then create your
database from your models. Make sure the path to your models is properly
configured.
On Mon, Oct 26, 2009 at 10:48 AM, jeushy <jjohn...@grafikchaos.com> wrote:
> When setting up a new application (Zend + Doctrine 1.2) and using the
> CLI to generate models from my schema YAML and then create the db
> tables I get a message in the CLI that the tables have been created
> successfully but checking the database shows that the CLI is lying to
> me b/c no tables have been created at all. I can successfully drop,
> create and rebuild the db from the CLI, so I know my connection string
> is correct. Has anyone else ran into this problem?
> # environment
> Mac OS X 10.6.1
> Zend Framework v 1.9.2
> Doctrine 1.2-ALPHA2
> PHP 5.2.10
-- Jonathan H. Wage (+1 415 992 5468)
Open Source Software Developer & Evangelist
sensiolabs.com | jwage.com | doctrine-project.org | symfony-project.org
You can contact Jonathan about Doctrine, Symfony and Open-Source or for
training, consulting, application development, or business related questions
at jonathan.w...@sensio.com
Im' having the same issue. All paths are correct, as it creates the
models just fine. The database will drop and create, but there are no
tables in it. If I generate-sql, the file is blank.
On Mon, Oct 26, 2009 at 10:33 AM, Jonathan Wage <jonw...@gmail.com> wrote:
> Make sure you generate your models from the YAML, and then create your
> database from your models. Make sure the path to your models is properly
> configured.
> - Jon
> On Mon, Oct 26, 2009 at 10:48 AM, jeushy <jjohn...@grafikchaos.com> wrote:
>> When setting up a new application (Zend + Doctrine 1.2) and using the
>> CLI to generate models from my schema YAML and then create the db
>> tables I get a message in the CLI that the tables have been created
>> successfully but checking the database shows that the CLI is lying to
>> me b/c no tables have been created at all. I can successfully drop,
>> create and rebuild the db from the CLI, so I know my connection string
>> is correct. Has anyone else ran into this problem?
>> # environment
>> Mac OS X 10.6.1
>> Zend Framework v 1.9.2
>> Doctrine 1.2-ALPHA2
>> PHP 5.2.10
> --
> Jonathan H. Wage (+1 415 992 5468)
> Open Source Software Developer & Evangelist
> sensiolabs.com | jwage.com | doctrine-project.org | symfony-project.org
> You can contact Jonathan about Doctrine, Symfony and Open-Source or for
> training, consulting, application development, or business related questions
> at jonathan.w...@sensio.com
loptap:scripts bas$ ./doctrine.sh rebuild-db
rebuild-db - Are you sure you wish to drop your databases? (y/n)
y
rebuild-db - Successfully dropped database for connection named
'default'
rebuild-db - Generated models successfully from YAML schema
rebuild-db - Successfully created database for connection named
'default'
rebuild-db - Created tables successfully
with 1.2.0BETA1 the exact same thing drops and creates the database,
creates the models, but does not create any tables or an sql file
loptap:scripts bas$ ./doctrine.sh rebuild-db
rebuild-db - Are you sure you wish to drop your databases? (y/n)
y
rebuild-db - Successfully dropped database for connection "default"
named "parablesdemo"
rebuild-db - Generated models successfully from YAML schema
rebuild-db - Successfully created database for connection "default"
named "parablesdemo"
rebuild-db - Created tables successfully
loptap:scripts bas$
> Im' having the same issue. All paths are correct, as it creates the
> models just fine. The database will drop and create, but there are no
> tables in it. If I generate-sql, the file is blank.
> On Mon, Oct 26, 2009 at 10:33 AM, Jonathan Wage <jonw...@gmail.com>
> wrote:
>> Make sure you generate your models from the YAML, and then create
>> your
>> database from your models. Make sure the path to your models is
>> properly
>> configured.
>> - Jon
>> On Mon, Oct 26, 2009 at 10:48 AM, jeushy <jjohn...@grafikchaos.com>
>> wrote:
>>> When setting up a new application (Zend + Doctrine 1.2) and using
>>> the
>>> CLI to generate models from my schema YAML and then create the db
>>> tables I get a message in the CLI that the tables have been created
>>> successfully but checking the database shows that the CLI is lying
>>> to
>>> me b/c no tables have been created at all. I can successfully drop,
>>> create and rebuild the db from the CLI, so I know my connection
>>> string
>>> is correct. Has anyone else ran into this problem?
>>> # environment
>>> Mac OS X 10.6.1
>>> Zend Framework v 1.9.2
>>> Doctrine 1.2-ALPHA2
>>> PHP 5.2.10
>> --
>> Jonathan H. Wage (+1 415 992 5468)
>> Open Source Software Developer & Evangelist
>> sensiolabs.com | jwage.com | doctrine-project.org | symfony-project.org
>> You can contact Jonathan about Doctrine, Symfony and Open-Source or
>> for
>> training, consulting, application development, or business related
>> questions
>> at jonathan.w...@sensio.com
just wanted to add that with 1.2 the generated files model (meaning the Base classes, not the User models) classes cannot be found automagically and I need to manually include those models... eventhough that path is in the include_path???
with 1.1, I do not need to indclude the files manually...
> just wanted to add that with 1.2 the generated files model (meaning
> the Base classes, not the User models) classes cannot be found
> automagically and I need to manually include those models...
> eventhough that path is in the include_path???
> with 1.1, I do not need to indclude the files manually...
I figured out my particular issue. I'm integrating with Zend
Framework. When registering the Doctrine Autoloader, you have to set
the Zend_Loader_Autoloader as the fallback autoloader first, and make
sure your based model path is in the include path.
On Sat, Nov 7, 2009 at 1:13 PM, ajbrown <a...@ajbrown.org> wrote:
> Does anyone have an suggestions for this?
> I still cannot get Doctrine 1.2 to create tables or sql for me. I've
> done this hundreds of times on Doctrine 1.1, though.
> On Nov 6, 8:06 am, Bas Kamer <b...@bushbaby.nl> wrote:
>> On 6 nov 2009, at 13:40, Bas Kamer wrote:
>> > .... see previous
>> just wanted to add that with 1.2 the generated files model (meaning
>> the Base classes, not the User models) classes cannot be found
>> automagically and I need to manually include those models...
>> eventhough that path is in the include_path???
>> with 1.1, I do not need to indclude the files manually...
i'm still experiencing the same problem, your autoloader work-around
didn't work for me
does anybody else have the same problem, or maybe better, a solution
please?
before upgrading to 1.1 everything worked great, but after the 1.2
update, the generate-migrations-diff and generate-sql commands don't
work anymore :(
generate-sql generates a 0 bytes file and generate-migrations-diff
says: "Could not generate migration classes from difference"
> When setting up a new application (Zend + Doctrine 1.2) and using the
> CLI to generate models from my schema YAML and then create the db
> tables I get a message in the CLI that the tables have been created
> successfully but checking the database shows that the CLI is lying to
> me b/c no tables have been created at all. I can successfully drop,
> create and rebuild the db from the CLI, so I know my connection string
> is correct. Has anyone else ran into this problem?
> # environment
> Mac OS X 10.6.1
> Zend Framework v 1.9.2
> Doctrine 1.2-ALPHA2
> PHP 5.2.10
> Just wanted to add that I am also having the exact same issue? I'm
> gonna go look in the bug reports and see if its been submitted?
> On Oct 26, 8:48 am, jeushy <jjohn...@grafikchaos.com> wrote:
> > When setting up a new application (Zend + Doctrine 1.2) and using the
> > CLI to generate models from my schema YAML and then create the db
> > tables I get a message in the CLI that the tables have been created
> > successfully but checking the database shows that the CLI is lying to
> > me b/c no tables have been created at all. I can successfully drop,
> > create and rebuild the db from the CLI, so I know my connection string
> > is correct. Has anyone else ran into this problem?
> > # environment
> > Mac OS X 10.6.1
> > Zend Framework v 1.9.2
> > Doctrine 1.2-ALPHA2
> > PHP 5.2.10
> I am having the same issue using Doctrine 1.2 and ZF 1.9.5 on Ubuntu,
> couldnt see anything on the Doctrine JIRA
> On Nov 10, 8:22 pm, travis <arthurdeli...@gmail.com> wrote:
> > Just wanted to add that I am also having the exact same issue? I'm
> > gonna go look in the bug reports and see if its been submitted?
> > On Oct 26, 8:48 am, jeushy <jjohn...@grafikchaos.com> wrote:
> > > When setting up a new application (Zend + Doctrine 1.2) and using the
> > > CLI to generate models from my schema YAML and then create the db
> > > tables I get a message in the CLI that the tables have been created
> > > successfully but checking the database shows that the CLI is lying to
> > > me b/c no tables have been created at all. I can successfully drop,
> > > create and rebuild the db from the CLI, so I know my connection string
> > > is correct. Has anyone else ran into this problem?
> > > # environment
> > > Mac OS X 10.6.1
> > > Zend Framework v 1.9.2
> > > Doctrine 1.2-ALPHA2
> > > PHP 5.2.10
With Doctrine 1.2 beta 2 and cli, when I run ./doctrine build.all-
reload
the result is:
build-all-reload - Are you sure you wish to drop your databases? (y/n)
y
build-all-reload - Successfully dropped database for connection named
'connection 1'
build-all-reload - Generated models successfully from YAML schema
build-all-reload - Successfully created database for connection named
'connection 1'
PHP Fatal error: Class 'BaseTableName' not found in /path/to/model/
model/TableName.php on line 13
Fatal error: Class 'BaseScadenziario' not found in /path/to/model/
TableName.php on line 13
> With Doctrine 1.2 beta 2 and cli, when I run ./doctrine build.all-
> reload
> the result is:
> build-all-reload - Are you sure you wish to drop your databases? (y/n)
> y
> build-all-reload - Successfully dropped database for connection named
> 'connection 1'
> build-all-reload - Generated models successfully from YAML schema
> build-all-reload - Successfully created database for connection named
> 'connection 1'
> PHP Fatal error: Class 'BaseTableName' not found in /path/to/model/
> model/TableName.php on line 13
> Fatal error: Class 'BaseScadenziario' not found in /path/to/model/
> TableName.php on line 13
This usually happens after you change the name of a table in the schema.
The models in base get wiped and generated - but the models in the dir
above no-longer have their baseModel.
On Wed, 2009-11-11 at 12:37 -0800, Fabrizio wrote: > With Doctrine 1.2 beta 2 and cli, when I run ./doctrine build.all-
> reload
> the result is:
> build-all-reload - Are you sure you wish to drop your databases? (y/n)
> y
> build-all-reload - Successfully dropped database for connection named
> 'connection 1'
> build-all-reload - Generated models successfully from YAML schema
> build-all-reload - Successfully created database for connection named
> 'connection 1'
> PHP Fatal error: Class 'BaseTableName' not found in /path/to/model/
> model/TableName.php on line 13
> Fatal error: Class 'BaseScadenziario' not found in /path/to/model/
> TableName.php on line 13
The models are generate fine. I can create and drop the database.
However, the schema.sql file when generated is empty and when I use
create-tables via the CLI nothing is added to the databse. The CLI
runs fine, no errors or warnings.
On 12 Nov, 00:10, dasher <das...@inspiredthinking.co.uk> wrote:
> This usually happens after you change the name of a table in the schema.
> The models in base get wiped and generated - but the models in the dir
> above no-longer have their baseModel.
> iirc clean-model-files fixes it.
> On Wed, 2009-11-11 at 12:37 -0800, Fabrizio wrote:
> > With Doctrine 1.2 beta 2 and cli, when I run ./doctrine build.all-
> > reload
> > the result is:
> > build-all-reload - Are you sure you wish to drop your databases? (y/n)
> > y
> > build-all-reload - Successfully dropped database for connection named
> > 'connection 1'
> > build-all-reload - Generated models successfully from YAML schema
> > build-all-reload - Successfully created database for connection named
> > 'connection 1'
> > PHP Fatal error: Class 'BaseTableName' not found in /path/to/model/
> > model/TableName.php on line 13
> > Fatal error: Class 'BaseScadenziario' not found in /path/to/model/
> > TableName.php on line 13
If the script you use to create the tables, has already loaded the
models from the disk, then it might not work. Make sure you aren't
loading every single model class. In order for the create-tables
command to work, it must be able to load the models from the disk for
the first time. I suspect your configuration/bootstrap is loading the
models.
- Jon
On Nov 11, 8:32 pm, Dkwad <legiond...@googlemail.com> wrote:
> The models are generate fine. I cancreateand drop the database.
> However, the schema.sql file when generated is empty and when I usecreate-tablesvia the CLI nothing is added to the databse. The CLI
> runs fine, no errors or warnings.
> On 12 Nov, 00:10, dasher <das...@inspiredthinking.co.uk> wrote:
> > This usually happens after you change the name of a table in the schema.
> > The models in base get wiped and generated - but the models in the dir
> > above no-longer have their baseModel.
> > iirc clean-model-files fixes it.
> > On Wed, 2009-11-11 at 12:37 -0800, Fabrizio wrote:
> > > With Doctrine 1.2 beta 2 and cli, when I run ./doctrine build.all-
> > > reload
> > > the result is:
> > > build-all-reload - Are you sure you wish to drop your databases? (y/n)
> > > y
> > > build-all-reload - Successfully dropped database for connection named
> > > 'connection 1'
> > > build-all-reload - Generated models successfully from YAML schema
> > > build-all-reload - Successfully created database for connection named
> > > 'connection 1'
> > > PHP Fatal error: Class 'BaseTableName' not found in /path/to/model/
> > > model/TableName.php on line 13
> > > Fatal error: Class 'BaseScadenziario' not found in /path/to/model/
> > > TableName.php on line 13
build-all-reload - Are you sure you wish to drop your databases? (y/n)
y
build-all-reload - Successfully dropped database for connection named
'connection 1'
build-all-reload - Generated models successfully from YAML schema
build-all-reload - Successfully created database for connection named
'connection 1'
PHP Fatal error: Class 'BaseTableName' not found in /var/www/html/
project_folder/lib/model/TableName.php on line 13
Fatal error: Class 'BaseTableName' not found in /var/www/html/
project_folder/lib/model/TableName.php on line 13
Where is the problem?
Thanks
Fabrizio
On 12 Nov, 19:58, jwage <jonw...@gmail.com> wrote:
> If the script you use to create the tables, has already loaded the
> models from the disk, then it might not work. Make sure you aren't
> loading every single model class. In order for the create-tables
> command to work, it must be able to load the models from the disk for
> the first time. I suspect your configuration/bootstrap is loading the
> models.
> build-all-reload - Are you sure you wish to drop your databases? (y/n)
> y
> build-all-reload - Successfully dropped database for connection named
> 'connection 1'
> build-all-reload - Generated models successfully from YAML schema
> build-all-reload - Successfully created database for connection named
> 'connection 1'
> PHP Fatal error: Class 'BaseTableName' not found in /var/www/html/
> project_folder/lib/model/TableName.php on line 13
> Fatal error: Class 'BaseTableName' not found in /var/www/html/
> project_folder/lib/model/TableName.php on line 13
> Where is the problem?
> Thanks
> Fabrizio
> On 12 Nov, 19:58, jwage <jonw...@gmail.com> wrote:
>> If the script you use to create the tables, has already loaded the
>> models from the disk, then it might not work. Make sure you aren't
>> loading every single model class. In order for the create-tables
>> command to work, it must be able to load the models from the disk for
>> the first time. I suspect your configuration/bootstrap is loading the
>> models.
>> - Jon
> --
> You received this message because you are subscribed to the Google
> Groups "doctrine-user" group.
> To post to this group, send email to doctrine-user@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/doctrine-user?hl= > .
> The models are generate fine. I can create and drop the database.
> However, the schema.sql file when generated is empty and when I use
> create-tables via the CLI nothing is added to the databse. The CLI
> runs fine, no errors or warnings.
> On 12 Nov, 00:10, dasher <das...@inspiredthinking.co.uk> wrote:
> > This usually happens after you change the name of a table in the schema.
> > The models in base get wiped and generated - but the models in the dir
> > above no-longer have their baseModel.
> > iirc clean-model-files fixes it.
> > On Wed, 2009-11-11 at 12:37 -0800, Fabrizio wrote:
> > > With Doctrine 1.2 beta 2 and cli, when I run ./doctrine build.all-
> > > reload
> > > the result is:
> > > build-all-reload - Are you sure you wish to drop your databases? (y/n)
> > > y
> > > build-all-reload - Successfully dropped database for connection named
> > > 'connection 1'
> > > build-all-reload - Generated models successfully from YAML schema
> > > build-all-reload - Successfully created database for connection named
> > > 'connection 1'
> > > PHP Fatal error: Class 'BaseTableName' not found in /path/to/model/
> > > model/TableName.php on line 13
> > > Fatal error: Class 'BaseScadenziario' not found in /path/to/model/
> > > TableName.php on line 13
well I had the same problem where I had my YAML scheme, had all the
paths setup correctly, yet upon a "build-all-load" from the CLI I, I
got all the PHP models and the database but no tables in the database.
So I spent a couple of hours in debug mode (have to love open source
for this), and it turns out that one of my index definitions in my
YAML schema was acceptable to Doctrine but not to MySQL, and the
script terminated silently once it started to create tables in MySQL.
When I removed the index definition from YAML, all tables were created
beautifully. Apart from an unacceptable column that is, which Doctrine
told me about nicely.
Although, I would have preferred Doctrine to give me a verbose error
message about the index, it was ultimately my syntax that prevented it
from created the tables.
Hope that helps
Windows XP
Doctrine 1.2.1
Zend 1.9.5
MySQL 5.1.37
On Oct 27, 12:48 am, jeushy <jjohn...@grafikchaos.com> wrote:
> When setting up a new application (Zend + Doctrine 1.2) and using the
> CLI to generate models from my schema YAML and then create the db
> tables I get a message in the CLI that the tables have been created
> successfully but checking the database shows that the CLI is lying to
> me b/c no tables have been created at all. I can successfully drop,
> create and rebuild the db from the CLI, so I know my connection string
> is correct. Has anyone else ran into this problem?
> # environment
> Mac OS X 10.6.1
> Zend Framework v 1.9.2
> Doctrine 1.2-ALPHA2
> PHP 5.2.10
Alex! You just saved me a trip to the hospital and having to patch
another hole in the wall.
I can confirm that the spl_autoload_register(array('Doctrine',
'modelsAutoload')); line worked to fix my woes on a Zend 1.9.6 and
Doctrine 1.2.1 application.
Cheers,
Josh
On Nov 14, 3:54 pm, Alex Mancini <nmanc...@gmail.com> wrote:
> > The models are generate fine. I can create and drop the database.
> > However, the schema.sql file when generated is empty and when I use
> > create-tables via the CLI nothing is added to the databse. The CLI
> > runs fine, no errors or warnings.
> > On 12 Nov, 00:10, dasher <das...@inspiredthinking.co.uk> wrote:
> > > This usually happens after you change the name of a table in the schema.
> > > The models in base get wiped and generated - but the models in the dir
> > > above no-longer have their baseModel.
> > > iirc clean-model-files fixes it.
> > > On Wed, 2009-11-11 at 12:37 -0800, Fabrizio wrote:
> > > > With Doctrine 1.2 beta 2 and cli, when I run ./doctrine build.all-
> > > > reload
> > > > the result is:
> > > > build-all-reload - Are you sure you wish to drop your databases? (y/n)
> > > > y
> > > > build-all-reload - Successfully dropped database for connection named
> > > > 'connection 1'
> > > > build-all-reload - Generated models successfully from YAML schema
> > > > build-all-reload - Successfully created database for connection named
> > > > 'connection 1'
> > > > PHP Fatal error: Class 'BaseTableName' not found in /path/to/model/
> > > > model/TableName.php on line 13
> > > > Fatal error: Class 'BaseScadenziario' not found in /path/to/model/
> > > > TableName.php on line 13
I just found this thread and I am experiencing similar problems
getting the doctrine cli to properly generate zf-compatible models
based on a schema yaml file.
Below are my specific details including an example of the cli output.
Any help would be greatly appreciated.
===
System Information
====
Apache/2.2.11 (Win32)
PHP/5.2.10
Doctrine 1.2.1
ZF 1.9.6
build-all-reload - Are you sure you wish to drop your databases? (y/n)
y
build-all-reload - Successfully dropped database for connection named
'doctrine'
build-all-reload - Generated models successfully from YAML schema
build-all-reload - Successfully created database for connection named
'doctrine'
build-all-reload - Created tables successfully
PHP Fatal error: Cannot redeclare class Default_Model_BaseGroup in D:
\Web Server Root\Projects\mysite\application\modules\default\models
\BaseGroup.php on line 47
Fatal error: Cannot redeclare class Default_Model_BaseGroup in D:\Web
Server Root\Projects\mysite\application\modules\default\models
\BaseGroup.php on line 47
This is the solution: move this line $manager->setAttribute(Doctrine::ATTR_MODEL_LOADING, Doctrine::MODEL_LOADING_CONSERVATIVE); from the bootstrap file to other file like index.php.