Kdyby\doctrine not updating schema

D4rk
Member | 6
+
0
-

Hello,
I am using Kdyby\Doctrine and Nette in my application. It runs on Wamp 2.5 (with PHP 5.5.12, MYSQL 5.6). After upgrading (nette, doctrine and other stuff) with composer, I wasn't able to update my schema. For schema updating I was using this command:
php ./www/index.php orm:schema-tool:update --force --dump-sql

What happens, when I enter this command? You might ask. After a while, command prompt appears without any output. (So after I enter command…pause…nothing…new prompt).

Browsing this forum I bumped into this article, about best practices in symphony

I found out, that php index.php is deprecated, so I created console.php file according to tutorial mentioned above. Then modified my command to this:
php bin/console.php orm:schema-tool:update --force --dump-sql

The output was the same – nothing. Which is strange, schema is not updated after running command. When I try any other command, for example
php ./www/index.php help
or
php bin/console.php help
It shows help as expected.

Here are some addtional informations that might help solve the problem.
current composer.json

{
	"name": "nette/sandbox",
	"description": "The sandbox is a pre-packaged Nette Framework project, basic configured structure for your application.",
	"homepage": "https://nette.org",
	"type": "project",
	"license": ["BSD-3-Clause", "GPL-2.0", "GPL-3.0"],
	"authors": [
		{
			"name": "David Grudl",
			"homepage": "https://davidgrudl.com"
		},
		{
			"name": "Nette Community",
			"homepage": "https://nette.org/en/contributors?lang=en"
		}
	],
	"require": {
    "nette/nette": "~2.3",
    "kdyby/doctrine": "3.1",
		"symfony/event-dispatcher": "^2.7",
		"nextras/forms": "^1.6",
		"twbs/bootstrap": "^3.3",
		"kdyby/validator": "^0.3.0",
    "dompdf/dompdf": "dev-master"
	},
	"require-dev": {
		"nette/tester": "~1.3"
	}
}

One of entities I need to create in database

namespace App;

use Doctrine\ORM\Mapping as ORM;
use \Kdyby\Doctrine\Entities\MagicAccessors;

/**
 * @ORM\Entity
 */
class ForumTopic extends \Kdyby\Doctrine\Entities\BaseEntity
{


    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue
     */
    public $id;

    /**
     * @ORM\Column(type="string")
     */
    public $title;

    /**
     * @ORM\Column(type="string")
     * @var string
     */
    public $description;
    /**
     * @ORM\Column(type="datetime", nullable=true)
     * @var DateTime
     */
    public $created;

    /**
     * @ORM\ManyToOne(targetEntity="Project")
     * @ORM\JoinColumn(name="project", referencedColumnName="id", nullable=true)
     * @var string
     */
    public $project_id;

    /**
     * @ORM\ManyToOne(targetEntity="ForumTopic")
     * @ORM\JoinColumn(name="ForumTopic", referencedColumnName="id", nullable=true)
     * @var string
     */
    public $parentTopic_id;

    /**
     * @ORM\Column(type="boolean")
     */
	public $isLocked;

}

Now I cant update even when I downgrade to older versions of Kdyby\Doctrine or Nette. Could you please help me find the problem?
Thanks

David Matějka
Moderator | 6445
+
0
-

have you tried to run your application in a debug mode?