Merged in fix_doctrine_mapping_schema (pull request #11)

Fix doctrine mapping schema
This commit is contained in:
Alexey Eschenko 2016-12-11 06:34:02 +03:00
commit 1099199ac5
13 changed files with 56 additions and 45 deletions

View file

@ -1,4 +1,4 @@
![CodeShip badge](https://codeship.com/projects/bb9fe730-a175-0134-5572-12490b0b4938/status?branch=master) [ ![Codeship Status for skobkin/point-tools](https://app.codeship.com/projects/bb9fe730-a175-0134-5572-12490b0b4938/status?branch=master)](https://app.codeship.com/projects/189850)
# Point Tools # Point Tools

View file

@ -9,8 +9,8 @@
"require": { "require": {
"php": ">=5.3.3", "php": ">=5.3.3",
"symfony/symfony": "2.7.*", "symfony/symfony": "2.7.*",
"doctrine/orm": "~2.2,>=2.2.3,<2.5", "doctrine/orm": "~2.4,<2.7.0",
"doctrine/dbal": "<2.5", "doctrine/dbal": "~2.4",
"doctrine/doctrine-bundle": "~1.4", "doctrine/doctrine-bundle": "~1.4",
"twig/extensions": "~1.0", "twig/extensions": "~1.0",
"symfony/assetic-bundle": "~2.3", "symfony/assetic-bundle": "~2.3",

67
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "730ff4da78d65c53b95f3a273c73c89b", "content-hash": "6c27cec95d59f5ae16b2287be0b2ba05",
"packages": [ "packages": [
{ {
"name": "doctrine/annotations", "name": "doctrine/annotations",
@ -212,16 +212,16 @@
}, },
{ {
"name": "doctrine/common", "name": "doctrine/common",
"version": "v2.7.1", "version": "v2.6.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/doctrine/common.git", "url": "https://github.com/doctrine/common.git",
"reference": "5954c297e9d93ff84554906c2fbbc2a133c43941" "reference": "7bce00698899aa2c06fe7365c76e4d78ddb15fa3"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/doctrine/common/zipball/5954c297e9d93ff84554906c2fbbc2a133c43941", "url": "https://api.github.com/repos/doctrine/common/zipball/7bce00698899aa2c06fe7365c76e4d78ddb15fa3",
"reference": "5954c297e9d93ff84554906c2fbbc2a133c43941", "reference": "7bce00698899aa2c06fe7365c76e4d78ddb15fa3",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -230,10 +230,10 @@
"doctrine/collections": "1.*", "doctrine/collections": "1.*",
"doctrine/inflector": "1.*", "doctrine/inflector": "1.*",
"doctrine/lexer": "1.*", "doctrine/lexer": "1.*",
"php": "~5.6|~7.0" "php": "~5.5|~7.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^5.4.6" "phpunit/phpunit": "~4.8|~5.0"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@ -281,34 +281,42 @@
"persistence", "persistence",
"spl" "spl"
], ],
"time": "2016-12-03T08:15:01+00:00" "time": "2016-11-30T16:50:46+00:00"
}, },
{ {
"name": "doctrine/dbal", "name": "doctrine/dbal",
"version": "v2.4.5", "version": "v2.5.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/doctrine/dbal.git", "url": "https://github.com/doctrine/dbal.git",
"reference": "5a1f4bf34d61d997ccd9f0539fbc14c7a772aa16" "reference": "9f8c05cd5225a320d56d4bfdb4772f10d045a0c9"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/doctrine/dbal/zipball/5a1f4bf34d61d997ccd9f0539fbc14c7a772aa16", "url": "https://api.github.com/repos/doctrine/dbal/zipball/9f8c05cd5225a320d56d4bfdb4772f10d045a0c9",
"reference": "5a1f4bf34d61d997ccd9f0539fbc14c7a772aa16", "reference": "9f8c05cd5225a320d56d4bfdb4772f10d045a0c9",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"doctrine/common": "~2.4", "doctrine/common": ">=2.4,<2.7-dev",
"php": ">=5.3.2" "php": ">=5.3.2"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "3.7.*", "phpunit/phpunit": "4.*",
"symfony/console": "~2.0" "symfony/console": "2.*||^3.0"
}, },
"suggest": { "suggest": {
"symfony/console": "For helpful console commands such as SQL execution and import of files." "symfony/console": "For helpful console commands such as SQL execution and import of files."
}, },
"bin": [
"bin/doctrine-dbal"
],
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.5.x-dev"
}
},
"autoload": { "autoload": {
"psr-0": { "psr-0": {
"Doctrine\\DBAL\\": "lib/" "Doctrine\\DBAL\\": "lib/"
@ -344,7 +352,7 @@
"persistence", "persistence",
"queryobject" "queryobject"
], ],
"time": "2016-01-05T22:18:20+00:00" "time": "2016-09-09T19:13:33+00:00"
}, },
{ {
"name": "doctrine/doctrine-bundle", "name": "doctrine/doctrine-bundle",
@ -826,28 +834,31 @@
}, },
{ {
"name": "doctrine/orm", "name": "doctrine/orm",
"version": "v2.4.8", "version": "v2.5.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/doctrine/doctrine2.git", "url": "https://github.com/doctrine/doctrine2.git",
"reference": "5aedac1e5c5caaeac14798822c70325dc242d467" "reference": "73e4be7c7b3ba26f96b781a40b33feba4dfa6d45"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/doctrine/doctrine2/zipball/5aedac1e5c5caaeac14798822c70325dc242d467", "url": "https://api.github.com/repos/doctrine/doctrine2/zipball/73e4be7c7b3ba26f96b781a40b33feba4dfa6d45",
"reference": "5aedac1e5c5caaeac14798822c70325dc242d467", "reference": "73e4be7c7b3ba26f96b781a40b33feba4dfa6d45",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"doctrine/collections": "~1.1", "doctrine/cache": "~1.4",
"doctrine/dbal": "~2.4", "doctrine/collections": "~1.2",
"doctrine/common": ">=2.5-dev,<2.7-dev",
"doctrine/dbal": ">=2.5-dev,<2.6-dev",
"doctrine/instantiator": "~1.0.1",
"ext-pdo": "*", "ext-pdo": "*",
"php": ">=5.3.2", "php": ">=5.4",
"symfony/console": "~2.0" "symfony/console": "~2.5|~3.0"
}, },
"require-dev": { "require-dev": {
"satooshi/php-coveralls": "dev-master", "phpunit/phpunit": "~4.0",
"symfony/yaml": "~2.1" "symfony/yaml": "~2.3|~3.0"
}, },
"suggest": { "suggest": {
"symfony/yaml": "If you want to use YAML Metadata Mapping Driver" "symfony/yaml": "If you want to use YAML Metadata Mapping Driver"
@ -859,7 +870,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "2.4.x-dev" "dev-master": "2.6.x-dev"
} }
}, },
"autoload": { "autoload": {
@ -895,7 +906,7 @@
"database", "database",
"orm" "orm"
], ],
"time": "2015-08-31T13:19:01+00:00" "time": "2016-09-10T18:51:13+00:00"
}, },
{ {
"name": "guzzle/guzzle", "name": "guzzle/guzzle",

View file

@ -9,7 +9,7 @@ use Skobkin\Bundle\PointToolsBundle\Entity\User;
/** /**
* Comment * Comment
* *
* @ORM\Table(name="posts.comments", schema="posts", indexes={ * @ORM\Table(name="comments", schema="posts", indexes={
* @ORM\Index(name="idx_comment_created_at", columns={"created_at"}) * @ORM\Index(name="idx_comment_created_at", columns={"created_at"})
* }) * })
* @ORM\Entity * @ORM\Entity
@ -80,7 +80,7 @@ class Comment
* @var File[]|ArrayCollection * @var File[]|ArrayCollection
* *
* @ORM\ManyToMany(targetEntity="Skobkin\Bundle\PointToolsBundle\Entity\Blogs\File", fetch="EXTRA_LAZY", cascade={"persist"}) * @ORM\ManyToMany(targetEntity="Skobkin\Bundle\PointToolsBundle\Entity\Blogs\File", fetch="EXTRA_LAZY", cascade={"persist"})
* @ORM\JoinTable(name="posts.comments_files", schema="posts", * @ORM\JoinTable(name="comments_files", schema="posts",
* joinColumns={@ORM\JoinColumn(name="comment_id")}, * joinColumns={@ORM\JoinColumn(name="comment_id")},
* inverseJoinColumns={@ORM\JoinColumn(name="file_id")} * inverseJoinColumns={@ORM\JoinColumn(name="file_id")}
* ) * )

View file

@ -7,7 +7,7 @@ use Doctrine\ORM\Mapping as ORM;
/** /**
* File * File
* *
* @ORM\Table(name="posts.files", schema="posts") * @ORM\Table(name="files", schema="posts")
* @ORM\Entity(repositoryClass="Skobkin\Bundle\PointToolsBundle\Repository\Blogs\FileRepository") * @ORM\Entity(repositoryClass="Skobkin\Bundle\PointToolsBundle\Repository\Blogs\FileRepository")
*/ */
class File class File

View file

@ -9,7 +9,7 @@ use Skobkin\Bundle\PointToolsBundle\Entity\User;
/** /**
* Post * Post
* *
* @ORM\Table(name="posts.posts", schema="posts", indexes={ * @ORM\Table(name="posts", schema="posts", indexes={
* @ORM\Index(name="idx_post_created_at", columns={"created_at"}), * @ORM\Index(name="idx_post_created_at", columns={"created_at"}),
* @ORM\Index(name="idx_post_private", columns={"private"}), * @ORM\Index(name="idx_post_private", columns={"private"}),
* }) * })
@ -83,7 +83,7 @@ class Post
* @var File[]|ArrayCollection * @var File[]|ArrayCollection
* *
* @ORM\ManyToMany(targetEntity="Skobkin\Bundle\PointToolsBundle\Entity\Blogs\File", fetch="EXTRA_LAZY", cascade={"persist"}) * @ORM\ManyToMany(targetEntity="Skobkin\Bundle\PointToolsBundle\Entity\Blogs\File", fetch="EXTRA_LAZY", cascade={"persist"})
* @ORM\JoinTable(name="posts.posts_files", schema="posts", * @ORM\JoinTable(name="posts_files", schema="posts",
* joinColumns={@ORM\JoinColumn(name="post_id")}, * joinColumns={@ORM\JoinColumn(name="post_id")},
* inverseJoinColumns={@ORM\JoinColumn(name="file_id")} * inverseJoinColumns={@ORM\JoinColumn(name="file_id")}
* ) * )

View file

@ -7,7 +7,7 @@ use Doctrine\ORM\Mapping as ORM;
/** /**
* PostTag * PostTag
* *
* @ORM\Table(name="posts.posts_tags", schema="posts") * @ORM\Table(name="posts_tags", schema="posts")
* @ORM\Entity(repositoryClass="Skobkin\Bundle\PointToolsBundle\Repository\Blogs\PostTagRepository") * @ORM\Entity(repositoryClass="Skobkin\Bundle\PointToolsBundle\Repository\Blogs\PostTagRepository")
*/ */
class PostTag class PostTag

View file

@ -7,7 +7,7 @@ use Doctrine\ORM\Mapping as ORM;
/** /**
* Tag * Tag
* *
* @ORM\Table(name="posts.tags", schema="posts", indexes={ * @ORM\Table(name="tags", schema="posts", indexes={
* @ORM\Index(name="idx_tag_text", columns={"text"}) * @ORM\Index(name="idx_tag_text", columns={"text"})
* }) * })
* @ORM\Entity(repositoryClass="Skobkin\Bundle\PointToolsBundle\Repository\Blogs\TagRepository") * @ORM\Entity(repositoryClass="Skobkin\Bundle\PointToolsBundle\Repository\Blogs\TagRepository")

View file

@ -7,7 +7,7 @@ use Doctrine\ORM\Mapping as ORM;
/** /**
* Subscription * Subscription
* *
* @ORM\Table(name="subscriptions.subscriptions", schema="subscriptions", uniqueConstraints={ * @ORM\Table(name="subscriptions", schema="subscriptions", uniqueConstraints={
* @ORM\UniqueConstraint(name="subscription_unique", columns={"author_id", "subscriber_id"})} * @ORM\UniqueConstraint(name="subscription_unique", columns={"author_id", "subscriber_id"})}
* ) * )
* @ORM\Entity(repositoryClass="Skobkin\Bundle\PointToolsBundle\Repository\SubscriptionRepository") * @ORM\Entity(repositoryClass="Skobkin\Bundle\PointToolsBundle\Repository\SubscriptionRepository")

View file

@ -7,7 +7,7 @@ use Doctrine\ORM\Mapping as ORM;
/** /**
* SubscriptionEvent * SubscriptionEvent
* *
* @ORM\Table(name="subscriptions.log", schema="subscriptions", indexes={ * @ORM\Table(name="log", schema="subscriptions", indexes={
* @ORM\Index(name="author_idx", columns={"author_id"}), * @ORM\Index(name="author_idx", columns={"author_id"}),
* @ORM\Index(name="subscriber_idx", columns={"subscriber_id"}), * @ORM\Index(name="subscriber_idx", columns={"subscriber_id"}),
* @ORM\Index(name="date_idx", columns={"date"}) * @ORM\Index(name="date_idx", columns={"date"})

View file

@ -8,7 +8,7 @@ use Doctrine\ORM\Mapping as ORM;
/** /**
* User * User
* *
* @ORM\Table(name="users.users", schema="users") * @ORM\Table(name="users", schema="users")
* @ORM\Entity(repositoryClass="Skobkin\Bundle\PointToolsBundle\Repository\UserRepository") * @ORM\Entity(repositoryClass="Skobkin\Bundle\PointToolsBundle\Repository\UserRepository")
* @ORM\HasLifecycleCallbacks * @ORM\HasLifecycleCallbacks
*/ */

View file

@ -7,7 +7,7 @@ use Doctrine\ORM\Mapping as ORM;
/** /**
* UserRenameEvent * UserRenameEvent
* *
* @ORM\Table(name="users.rename_log", schema="users", indexes={ * @ORM\Table(name="rename_log", schema="users", indexes={
* @ORM\Index(name="idx_rename_log_date", columns={"date"}), * @ORM\Index(name="idx_rename_log_date", columns={"date"}),
* @ORM\Index(name="idx_rename_log_old_login", columns={"old_login"}) * @ORM\Index(name="idx_rename_log_old_login", columns={"old_login"})
* }) * })

View file

@ -18,9 +18,9 @@ class SubscriptionRepository extends EntityRepository
$qb = $this->createQueryBuilder('s'); $qb = $this->createQueryBuilder('s');
return $qb return $qb
->select('COUNT(s)') ->select('COUNT(s.subscriber)')
->innerJoin('s.author', 'a') ->innerJoin('s.author', 'sa')
->where('a.id = :id') ->where('sa.id = :id')
->setParameter('id', $id) ->setParameter('id', $id)
->getQuery()->getSingleScalarResult() ->getQuery()->getSingleScalarResult()
; ;