Search code examples
cakephpcakephp-2.2cakephp-bake

CakePHP 2 Bake unable to create a Model


I am trying to create a model through Cake Bake command. I am using windows and II7. I have set up the global variables on the system path so i can do "cake bake" on my Command Prompt.

I have my database config defined in App/config/database.php

Once i do it, i press M for Model, then i select the default database and the console shows this message:

Your database does not have any tables.

And i am not able to create any model for my project.

If i manually create a table on my DB, the error changes and it shows this: http://www.subirimagenes.com/imagen-picture-8000920.html

What's the problem with it? Of course i have no tables if i have just installed Cake!!


Solution

  • First, create your tables with, let's say, phpMyAdmin (localhost/phpmyadmin).

    Then, if you have properly configured your database configuration in app/config/database.php you will see Models in your Bake script you can create.