views:

102

answers:

1

Hello Everyone,

I just got Doctrine 1.2.1 working in my environment (ubuntu) together with the Zend Framework. When I run my doctrine command

./doctrine build-all-reload

it gives me the output:

build-all-reload - Are you sure you wish to drop your databases? (y/n)
y
build-all-reload - SQLSTATE[HY000]: General error: 1008 Can't drop database 'zcdev'; database doesn't exist. Failing Query: "DROP DATABASE zcdev"
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
build-all-reload - Data was successfully loaded

But when i look in my db with phpMyAdmin I find out that my db is created but not my table.

Here is my yml file:

    options:
 type: INNODB
 collate: utf_general_ci
 charset: utf8


    Events:
     columns:
      evt_id:
       type: integer
       primary: true
       autoincrement: true
      evt_name: string(200)
      evt_description: string(200)
      evt_startdate: date
      evt_enddate: date
      evt_starttime: time
      evt_endtime: time
      evt_amtpersons: integer

I checked if it's really using my yml file by renaming it and it is because when i rename my yml file i get a corresponding error. So any idea's?

+1  A: 

Do you include the spl_autoload_register when setting up autoloading? Here is my initDoctrine function from my Bootstrap.php file:

    public function _initDoctrine()
    {

        $this->getApplication()->getAutoloader()
            ->pushAutoloader(array('Doctrine', 'autoload'));
        spl_autoload_register(array('Doctrine', 'modelsAutoload'));

        $manager = Doctrine_Manager::getInstance();

        $manager->setAttribute(Doctrine::ATTR_AUTO_ACCESSOR_OVERRIDE, true);
        $manager->setAttribute(Doctrine::ATTR_MODEL_LOADING, Doctrine::MODEL_LOADING_CONSERVATIVE);
        $manager->setAttribute(Doctrine::ATTR_AUTOLOAD_TABLE_CLASSES, true);

        $doctrineConfig = $this->getOption('doctrine');

        Doctrine::loadModels($doctrineConfig['models_path']);

        $conn = Doctrine_Manager::connection($doctrineConfig['dsn'],'doctrine');
        $conn->setAttribute(Doctrine::ATTR_USE_NATIVE_ENUM, true);
        return $conn;
    }
EasyEcho
see my earlier comment. it has been solved already. THanks for your help anywayz.
sanders