瀏覽代碼

Agregue migraciones, corregi parametros y puse fecha por defecto a update en la entidad device

iksop 8 年之前
父節點
當前提交
f3cfe37e5c
共有 6 個文件被更改,包括 361 次插入7 次删除
  1. 3 0
      app/AppKernel.php
  2. 2 2
      app/config/parameters.yml.dist
  3. 1 1
      app/config/parameters.yml.docker
  4. 25 2
      composer.json
  5. 329 1
      composer.lock
  6. 1 1
      src/StatsBundle/Entity/Device.php

+ 3 - 0
app/AppKernel.php

@@ -27,6 +27,9 @@ class AppKernel extends Kernel
             new Nelmio\CorsBundle\NelmioCorsBundle(),
             new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
             new HWI\Bundle\OAuthBundle\HWIOAuthBundle(),
+
+	    new MigrationsBundle\MigrationsBundle(),
+	    new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
             
             new WebserviceBundle\WebserviceBundle(),
             new Base\AdminBundle\BaseAdminBundle(),

+ 2 - 2
app/config/parameters.yml.dist

@@ -4,7 +4,7 @@
 parameters:
     database_host: 127.0.0.1
     database_port: ~
-    database_name: flowdat_stats
+    database_name: fd3_stats
     database_user: root
     database_password: ~
     # You should uncomment this if you want to use pdo_sqlite
@@ -28,4 +28,4 @@ parameters:
     db_session_name: fd_session
     db_session_user: root
     db_session_password: null
-    app_path: '/var/flowdat/stats'
+    app_path: '/var/flowdat/stats'

+ 1 - 1
app/config/parameters.yml.docker

@@ -5,7 +5,7 @@ parameters:
     database_driver:   pdo_mysql
     database_host:     mysql
     database_port:     ~
-    database_name:     fd3_base
+    database_name:     fd3_stats
     database_user:     root
     database_password: 235r2342gtfsw
     # You should uncomment this if you want use pdo_sqlite

+ 25 - 2
composer.json

@@ -82,16 +82,25 @@
             "options": {
                     "local_pk": "./keys/bitbucket.id_rsa"
             }
+        },
+        {
+            "type": "vcs",
+            "url": "ssh://git@bitbucket.org/ikflowdat/migrations.git",
+            "options": {
+                "local_pk": "./keys/bitbucket.id_rsa"
+            }
         }
     ],
     "require": {
         "php": ">=5.5.9",
         "doctrine/doctrine-bundle": "^1.6",
         "doctrine/doctrine-cache-bundle": "^1.2",
+        "doctrine/doctrine-migrations-bundle": "^1.2",
         "doctrine/orm": "^2.5",
         "ik/base-admin-bundle": "dev-master",
         "ik/device-bundle": "dev-master",
         "ik/extra-data-bundle": "dev-master",
+        "ik/migrations-bundle": "dev-master",
         "ik/oauthclient-bundle": "dev-master",
         "ik/owner-voter-bundle": "dev-master",
         "ik/redis-bundle": "dev-master",
@@ -128,10 +137,24 @@
             "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
             "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
         ],
-        "chmod-dir-cache-sessions-logs":"chmod 777 -R var/cache var/logs var/sessions",
+	"doctrine-update": "php bin/console doctrine:schema:update --force",
+        "doctrine-migrations":"php bin/console doctrine:migrations:migrate --no-interaction",
+        "copy-user-settings":"cp -n app/config/user_settings.yml.dist app/config/user_settings.yml",
+        "chown-user-settings":"chown -f www-data:www-data app/config/user_settings.yml",
+        "mkdir-dir-cache-sessions-logs": "mkdir -p var/cache var/logs var/sessions",
+        "chmod-dir-cache-sessions-logs": "chmod 777 -R var/cache var/logs var/sessions",
+        "migration-alert-type": "php bin/console doctrine:migrations:execute 20170627144029 --no-interaction",
+        "auto-increment": "php bin/console baseadmin:autoincrement",
+
         "post-install-cmd": [
             "@symfony-scripts",
-            "@chmod-dir-cache-sessions-logs"
+            "@chmod-dir-cache-sessions-logs",
+            "@doctrine-update",
+            "@auto-increment",
+            "@doctrine-migrations",
+            "@copy-user-settings",
+            "@chown-user-settings"
+
         ],
         "post-update-cmd": [
             "@symfony-scripts",

+ 329 - 1
composer.lock

@@ -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": "e2fac7f525ddd3ceec7bffbd8f4259b9",
+    "content-hash": "1cd1f64212239b5b6289234519b4822c",
     "packages": [
         {
             "name": "behat/transliterator",
@@ -691,6 +691,67 @@
             ],
             "time": "2016-01-26T17:28:51+00:00"
         },
+        {
+            "name": "doctrine/doctrine-migrations-bundle",
+            "version": "v1.2.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/doctrine/DoctrineMigrationsBundle.git",
+                "reference": "6276139e0b913a4e5120fc36bb5b0eae8ac549bc"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/doctrine/DoctrineMigrationsBundle/zipball/6276139e0b913a4e5120fc36bb5b0eae8ac549bc",
+                "reference": "6276139e0b913a4e5120fc36bb5b0eae8ac549bc",
+                "shasum": ""
+            },
+            "require": {
+                "doctrine/doctrine-bundle": "~1.0",
+                "doctrine/migrations": "^1.1",
+                "php": ">=5.4.0",
+                "symfony/framework-bundle": "~2.3|~3.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.8"
+            },
+            "type": "symfony-bundle",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.2-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Doctrine\\Bundle\\MigrationsBundle\\": ""
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Symfony Community",
+                    "homepage": "http://symfony.com/contributors"
+                },
+                {
+                    "name": "Doctrine Project",
+                    "homepage": "http://www.doctrine-project.org"
+                },
+                {
+                    "name": "Fabien Potencier",
+                    "email": "fabien@symfony.com"
+                }
+            ],
+            "description": "Symfony DoctrineMigrationsBundle",
+            "homepage": "http://www.doctrine-project.org",
+            "keywords": [
+                "dbal",
+                "migrations",
+                "schema"
+            ],
+            "time": "2016-12-05T18:36:37+00:00"
+        },
         {
             "name": "doctrine/inflector",
             "version": "v1.1.0",
@@ -866,6 +927,80 @@
             ],
             "time": "2014-09-09T13:34:57+00:00"
         },
+        {
+            "name": "doctrine/migrations",
+            "version": "v1.5.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/doctrine/migrations.git",
+                "reference": "c81147c0f2938a6566594455367e095150547f72"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/doctrine/migrations/zipball/c81147c0f2938a6566594455367e095150547f72",
+                "reference": "c81147c0f2938a6566594455367e095150547f72",
+                "shasum": ""
+            },
+            "require": {
+                "doctrine/dbal": "~2.2",
+                "ocramius/proxy-manager": "^1.0|^2.0",
+                "php": "^5.5|^7.0",
+                "symfony/console": "~2.3|~3.0",
+                "symfony/yaml": "~2.3|~3.0"
+            },
+            "require-dev": {
+                "doctrine/coding-standard": "dev-master",
+                "doctrine/orm": "2.*",
+                "jdorn/sql-formatter": "~1.1",
+                "johnkary/phpunit-speedtrap": "~1.0@dev",
+                "mikey179/vfsstream": "^1.6",
+                "mockery/mockery": "^0.9.4",
+                "phpunit/phpunit": "~4.7",
+                "satooshi/php-coveralls": "^1.0"
+            },
+            "suggest": {
+                "jdorn/sql-formatter": "Allows to generate formatted SQL with the diff command."
+            },
+            "bin": [
+                "bin/doctrine-migrations"
+            ],
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "v1.6.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Doctrine\\DBAL\\Migrations\\": "lib/Doctrine/DBAL/Migrations"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "LGPL-2.1"
+            ],
+            "authors": [
+                {
+                    "name": "Benjamin Eberlei",
+                    "email": "kontakt@beberlei.de"
+                },
+                {
+                    "name": "Jonathan Wage",
+                    "email": "jonwage@gmail.com"
+                },
+                {
+                    "name": "Michael Simonson",
+                    "email": "contact@mikesimonson.com"
+                }
+            ],
+            "description": "Database Schema migrations using Doctrine DBAL",
+            "homepage": "http://www.doctrine-project.org",
+            "keywords": [
+                "database",
+                "migrations"
+            ],
+            "time": "2016-12-25T22:54:00+00:00"
+        },
         {
             "name": "doctrine/orm",
             "version": "v2.5.6",
@@ -1325,6 +1460,29 @@
             ],
             "time": "2017-07-05 12:20:18"
         },
+        {
+            "name": "ik/migrations-bundle",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "ssh://git@bitbucket.org/ikflowdat/migrations.git",
+                "reference": "d4b78fbdf5a79e09635f0f2c4f8e7d33157b5ce5"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "MigrationsBundle\\": ""
+                }
+            },
+            "description": "Flowdat 3 Migrations Bundle",
+            "keywords": [
+                "Admin Generator",
+                "admin",
+                "bundle",
+                "migrations"
+            ],
+            "time": "2017-08-01 12:51:23"
+        },
         {
             "name": "ik/oauthclient-bundle",
             "version": "dev-master",
@@ -2148,6 +2306,69 @@
             ],
             "time": "2017-04-24T09:12:42+00:00"
         },
+        {
+            "name": "ocramius/proxy-manager",
+            "version": "1.0.2",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/Ocramius/ProxyManager.git",
+                "reference": "57e9272ec0e8deccf09421596e0e2252df440e11"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/Ocramius/ProxyManager/zipball/57e9272ec0e8deccf09421596e0e2252df440e11",
+                "reference": "57e9272ec0e8deccf09421596e0e2252df440e11",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3",
+                "zendframework/zend-code": ">2.2.5,<3.0"
+            },
+            "require-dev": {
+                "ext-phar": "*",
+                "phpunit/phpunit": "~4.0",
+                "squizlabs/php_codesniffer": "1.5.*"
+            },
+            "suggest": {
+                "ocramius/generated-hydrator": "To have very fast object to array to object conversion for ghost objects",
+                "zendframework/zend-json": "To have the JsonRpc adapter (Remote Object feature)",
+                "zendframework/zend-soap": "To have the Soap adapter (Remote Object feature)",
+                "zendframework/zend-stdlib": "To use the hydrator proxy",
+                "zendframework/zend-xmlrpc": "To have the XmlRpc adapter (Remote Object feature)"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "2.0.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-0": {
+                    "ProxyManager\\": "src"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Marco Pivetta",
+                    "email": "ocramius@gmail.com",
+                    "homepage": "http://ocramius.github.com/"
+                }
+            ],
+            "description": "A library providing utilities to generate, instantiate and generally operate with Object Proxies",
+            "homepage": "https://github.com/Ocramius/ProxyManager",
+            "keywords": [
+                "aop",
+                "lazy loading",
+                "proxy",
+                "proxy pattern",
+                "service proxies"
+            ],
+            "time": "2015-08-09T04:28:19+00:00"
+        },
         {
             "name": "opensolutions/oss-snmp",
             "version": "dev-master",
@@ -5548,6 +5769,112 @@
                 "negotiation"
             ],
             "time": "2015-10-01T07:42:40+00:00"
+        },
+        {
+            "name": "zendframework/zend-code",
+            "version": "2.6.3",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/zendframework/zend-code.git",
+                "reference": "95033f061b083e16cdee60530ec260d7d628b887"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/zendframework/zend-code/zipball/95033f061b083e16cdee60530ec260d7d628b887",
+                "reference": "95033f061b083e16cdee60530ec260d7d628b887",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^5.5 || 7.0.0 - 7.0.4 || ^7.0.6",
+                "zendframework/zend-eventmanager": "^2.6 || ^3.0"
+            },
+            "require-dev": {
+                "doctrine/annotations": "~1.0",
+                "fabpot/php-cs-fixer": "1.7.*",
+                "phpunit/phpunit": "^4.8.21",
+                "zendframework/zend-stdlib": "^2.7 || ^3.0"
+            },
+            "suggest": {
+                "doctrine/annotations": "Doctrine\\Common\\Annotations >=1.0 for annotation features",
+                "zendframework/zend-stdlib": "Zend\\Stdlib component"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "2.6-dev",
+                    "dev-develop": "2.7-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Zend\\Code\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "description": "provides facilities to generate arbitrary code using an object oriented interface",
+            "homepage": "https://github.com/zendframework/zend-code",
+            "keywords": [
+                "code",
+                "zf2"
+            ],
+            "time": "2016-04-20T17:26:42+00:00"
+        },
+        {
+            "name": "zendframework/zend-eventmanager",
+            "version": "3.2.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/zendframework/zend-eventmanager.git",
+                "reference": "9d72db10ceb6e42fb92350c0cb54460da61bd79c"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/9d72db10ceb6e42fb92350c0cb54460da61bd79c",
+                "reference": "9d72db10ceb6e42fb92350c0cb54460da61bd79c",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^5.6 || ^7.0"
+            },
+            "require-dev": {
+                "athletic/athletic": "^0.1",
+                "container-interop/container-interop": "^1.1.0",
+                "phpunit/phpunit": "^6.0.7 || ^5.7.14",
+                "zendframework/zend-coding-standard": "~1.0.0",
+                "zendframework/zend-stdlib": "^2.7.3 || ^3.0"
+            },
+            "suggest": {
+                "container-interop/container-interop": "^1.1.0, to use the lazy listeners feature",
+                "zendframework/zend-stdlib": "^2.7.3 || ^3.0, to use the FilterChain feature"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "3.2-dev",
+                    "dev-develop": "3.3-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Zend\\EventManager\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "description": "Trigger and listen to events within a PHP application",
+            "homepage": "https://github.com/zendframework/zend-eventmanager",
+            "keywords": [
+                "event",
+                "eventmanager",
+                "events",
+                "zf2"
+            ],
+            "time": "2017-07-11T19:17:22+00:00"
         }
     ],
     "packages-dev": [
@@ -5620,6 +5947,7 @@
         "ik/base-admin-bundle": 20,
         "ik/device-bundle": 20,
         "ik/extra-data-bundle": 20,
+        "ik/migrations-bundle": 20,
         "ik/oauthclient-bundle": 20,
         "ik/owner-voter-bundle": 20,
         "ik/redis-bundle": 20,

+ 1 - 1
src/StatsBundle/Entity/Device.php

@@ -68,7 +68,7 @@ class Device
     protected $tenancyId = 1;
 
     /**
-     * @ORM\Column(type="datetime")
+     * @ORM\Column(type="datetime", type="datetime", options={"default": 0})
      */
     protected $updated;