Re: Missing database table trying to bake a model

2007-11-20 Thread RichardAtHome

Recently, they changed the way that bake runs (tripped me up too).

You need to run it from your /app directory

and add the bake directory to your path.

There's a note at the top of bake.bat script that gives better/fuller
instructions.

Hope this helps

On Nov 20, 10:03 am, Scronkey <[EMAIL PROTECTED]> wrote:
> You mean you copied the whole 'console' directory into your app
> directory?
>
> I can't see how that would make a difference as far as baking models
> go, but even if it did it doesn't seem a very efficient solution
> considering how many directories and files are in the console
> directory.
>
> Out of interest, how many databases are you connecting to, and what
> engine are they using?
>
> On Nov 20, 3:51 pm, uae2k <[EMAIL PROTECTED]> wrote:
>
> > well ... maybe this is the solution
>
> > I have copied "console" to the "app" folder and it works fine with me
>
> > On Nov 20, 8:30 am, uae2k <[EMAIL PROTECTED]> wrote:
>
> > > I have the same problem and I tried your way but without any result
>
> > > Any one can help here !
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Missing database table trying to bake a model

2007-11-20 Thread Scronkey

You mean you copied the whole 'console' directory into your app
directory?

I can't see how that would make a difference as far as baking models
go, but even if it did it doesn't seem a very efficient solution
considering how many directories and files are in the console
directory.

Out of interest, how many databases are you connecting to, and what
engine are they using?

On Nov 20, 3:51 pm, uae2k <[EMAIL PROTECTED]> wrote:
> well ... maybe this is the solution
>
> I have copied "console" to the "app" folder and it works fine with me
>
> On Nov 20, 8:30 am, uae2k <[EMAIL PROTECTED]> wrote:
>
> > I have the same problem and I tried your way but without any result
>
> > Any one can help here !
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Missing database table trying to bake a model

2007-11-19 Thread uae2k

well ... maybe this is the solution

I have copied "console" to the "app" folder and it works fine with me

On Nov 20, 8:30 am, uae2k <[EMAIL PROTECTED]> wrote:
> I have the same problem and I tried your way but without any result
>
> Any one can help here !

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Missing database table trying to bake a model

2007-11-19 Thread uae2k

I have the same problem and I tried your way but without any result

Any one can help here !

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Missing database table trying to bake a model

2007-11-13 Thread Scronkey

I have found out why this was happening and with two very small
adjustments in cake/console/libs/tasks/model.php I can successfully
bake models in either the mysql or the firebird database.

All the functionality is there and ready to go, it just appears it has
yet to be 'turned on'. (using latest branch checkout)

In the function __interactive, a new model is created twice with the
following code:
tempModel = new Model(false, $useTable);
this is after the request if validation is required, and
tempOtherModel = new Model(false, $useTable);
this is after the request if associations are required.

However, the constructor for Model can take a third parameter, $ds,
but as this is not passed in either case, the new Model uses the
'default' dbConfig.

Once I added the existing variable $useDbConfig to both calls, such
as:
tempModel = new Model(false, $useTable, $useDbConfig);
the models are correctly baked.

My concern now is why is this functionality not enabled?
Am I going about this the wrong way?
I could not find any tickets on this so if this is the correct way,
should I write a ticket?

If I'm on the right track I will investigate the related problem when
trying to bake the relevant controllers and views, which currently
only display the list of 'default' models when I try to use my
alternate firebird database config.

If I'm not on the right track, can anyone enlighten me?

On Nov 11, 12:31 pm, Scronkey <[EMAIL PROTECTED]> wrote:
> This occurs when trying to setup an additional database connection to
> a Firebird server.
>
> I'm using mysql for the bulk of my app (with no problems), but in
> trying to set up access to a few tables in my Firebird db some oddness
> occurs.
>
> I have the entry in the database.sql config file and bake presents me
> with the correct list of tables to choose from when I try to create a
> model so it can obviously successfully connect to the server and
> database in question. When presented with the first question
> (supplying validation criteria) I get the following error (regardless
> if want validation or not):
>
> Error: Missing database table 'employees' for model 'Model'
>
> Note that the table name is correct, but it seems to be trying to
> locate a model called 'Model'.
> This oddness made me think that could be a bug, (also considering cake
> can connect and return a list of tables) so I started hunting. Several
> hours have passed and I'm now getting quite lost and cross-eyed from
> the code and was hoping someone with more familiarity of Cake's
> innards could help.
>
> I've traced the error to the __interactive function in console/libs/
> tasks/model.php, to the line:
> $tempModel = new Model(false, $useTable);
>
> I assumed this is a call to the __construct method in cake/libs/model/
> model.php but I'm lost trying get any further.
>
> If no one has an immediate thought of why this occurs, then perhaps
> someone can tell me how can I get diagnostic messages from within
> model.php? As there is no active browser (shell bake) and I can't seem
> to access the shell->out() function to dump messages I can't easily
> narrow down where this actually falls over.
>
> Any advice or tips ?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Missing database table trying to bake a model

2007-11-10 Thread Scronkey

This occurs when trying to setup an additional database connection to
a Firebird server.

I'm using mysql for the bulk of my app (with no problems), but in
trying to set up access to a few tables in my Firebird db some oddness
occurs.

I have the entry in the database.sql config file and bake presents me
with the correct list of tables to choose from when I try to create a
model so it can obviously successfully connect to the server and
database in question. When presented with the first question
(supplying validation criteria) I get the following error (regardless
if want validation or not):

Error: Missing database table 'employees' for model 'Model'

Note that the table name is correct, but it seems to be trying to
locate a model called 'Model'.
This oddness made me think that could be a bug, (also considering cake
can connect and return a list of tables) so I started hunting. Several
hours have passed and I'm now getting quite lost and cross-eyed from
the code and was hoping someone with more familiarity of Cake's
innards could help.

I've traced the error to the __interactive function in console/libs/
tasks/model.php, to the line:
$tempModel = new Model(false, $useTable);

I assumed this is a call to the __construct method in cake/libs/model/
model.php but I'm lost trying get any further.

If no one has an immediate thought of why this occurs, then perhaps
someone can tell me how can I get diagnostic messages from within
model.php? As there is no active browser (shell bake) and I can't seem
to access the shell->out() function to dump messages I can't easily
narrow down where this actually falls over.

Any advice or tips ?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---