2

我正在关注本教程:http ://tutorial.symblog.co.uk/docs/extending-the-model-blog-comments.html#doctrine-2-migrations

1) 安装 Doctrine 迁移包

1.1) - 添加

 "doctrine/migrations": "dev-master",
 "doctrine/doctrine-migrations-bundle": "dev-master"

到 composer.json

1.2) 运行

 php composer.phar update

2)添加

new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),

在 AppKernel.php 中

3) 运行

php app/console doctrine:migrations:diff

这应该运行命令并找到当前实体和数据库之间的差异,是吗?但我得到一个错误:

 Fatal error: Class 'Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle' not found in D:\xampp\htdocs\symblog.dev\app\AppKernel.php on line 23

这正是 (2.)

你能帮我吗?欢迎任何建议!

4

1 回答 1

3

我认为捆绑包同时被重命名。尝试:(更新的问题):

// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        //...
        new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
    );
}

请参阅DoctrineMigrationsBundle 文档DoctrineMigrationsBundle

于 2013-02-06T16:55:08.413 回答