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

View file

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

View file

@ -9,7 +9,7 @@ use Skobkin\Bundle\PointToolsBundle\Entity\User;
/**
* 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\Entity
@ -80,7 +80,7 @@ class Comment
* @var File[]|ArrayCollection
*
* @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")},
* inverseJoinColumns={@ORM\JoinColumn(name="file_id")}
* )

View file

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

View file

@ -9,7 +9,7 @@ use Skobkin\Bundle\PointToolsBundle\Entity\User;
/**
* 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_private", columns={"private"}),
* })
@ -83,7 +83,7 @@ class Post
* @var File[]|ArrayCollection
*
* @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")},
* inverseJoinColumns={@ORM\JoinColumn(name="file_id")}
* )

View file

@ -7,7 +7,7 @@ use Doctrine\ORM\Mapping as ORM;
/**
* 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")
*/
class PostTag

View file

@ -7,7 +7,7 @@ use Doctrine\ORM\Mapping as ORM;
/**
* 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\Entity(repositoryClass="Skobkin\Bundle\PointToolsBundle\Repository\Blogs\TagRepository")

View file

@ -7,7 +7,7 @@ use Doctrine\ORM\Mapping as ORM;
/**
* 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\Entity(repositoryClass="Skobkin\Bundle\PointToolsBundle\Repository\SubscriptionRepository")

View file

@ -7,7 +7,7 @@ use Doctrine\ORM\Mapping as ORM;
/**
* 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="subscriber_idx", columns={"subscriber_id"}),
* @ORM\Index(name="date_idx", columns={"date"})

View file

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

View file

@ -7,7 +7,7 @@ use Doctrine\ORM\Mapping as ORM;
/**
* 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_old_login", columns={"old_login"})
* })

View file

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