Commit 56945a49 by Julien Jorry

Update

parent e5088df8
127.0.0.1 - - [30/Nov/2018:19:54:38 +0100] "GET / HTTP/1.1" 403 209 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:19:54:40 +0100] "GET /favicon.ico HTTP/1.1" 403 220 "http://doume.test/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:19:56:00 +0100] "GET / HTTP/1.1" 404 49152 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:19:56:01 +0100] "GET /_wdt/40eff0 HTTP/1.1" 404 209 "http://doume.test/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:19:56:02 +0100] "GET /_wdt/40eff0 HTTP/1.1" 404 209 "http://doume.test/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:19:56:02 +0100] "GET /favicon.ico HTTP/1.1" 404 209 "http://doume.test/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:19:56:03 +0100] "GET /_wdt/40eff0 HTTP/1.1" 404 209 "http://doume.test/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:19:56:04 +0100] "GET /_wdt/40eff0 HTTP/1.1" 404 209 "http://doume.test/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:19:56:05 +0100] "GET /_wdt/40eff0 HTTP/1.1" 404 209 "http://doume.test/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:19:56:06 +0100] "GET /admin HTTP/1.1" 404 203 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:19:56:09 +0100] "GET /admin/ HTTP/1.1" 404 204 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:19:56:12 +0100] "GET /admin/ogin HTTP/1.1" 404 208 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:19:56:16 +0100] "GET /admin/login HTTP/1.1" 404 209 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:19:56:30 +0100] "GET /admin/login HTTP/1.1" 404 209 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:19:57:21 +0100] "GET /admin/login HTTP/1.1" 404 209 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:19:57:23 +0100] "GET /admin/login HTTP/1.1" 404 209 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:19:57:24 +0100] "GET /favicon.ico HTTP/1.1" 404 209 "http://doume.test/admin/login" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:19:57:25 +0100] "GET / HTTP/1.1" 404 49152 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:19:57:26 +0100] "GET /_wdt/22cf0e HTTP/1.1" 404 209 "http://doume.test/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:19:57:27 +0100] "GET /_wdt/22cf0e HTTP/1.1" 404 209 "http://doume.test/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:19:57:28 +0100] "GET /_wdt/22cf0e HTTP/1.1" 404 209 "http://doume.test/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:19:57:29 +0100] "GET /_wdt/22cf0e HTTP/1.1" 404 209 "http://doume.test/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:19:57:30 +0100] "GET /_wdt/22cf0e HTTP/1.1" 404 209 "http://doume.test/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:19:58:27 +0100] "GET /admin/login HTTP/1.1" 404 209 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:19:58:29 +0100] "GET /favicon.ico HTTP/1.1" 404 209 "http://www.doume.test/admin/login" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:19:58:30 +0100] "GET /admin/ HTTP/1.1" 404 204 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:19:58:57 +0100] "GET /admina/ HTTP/1.1" 404 205 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:19:58:59 +0100] "GET /admin/ HTTP/1.1" 404 204 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:20:42:09 +0100] "GET /admin HTTP/1.1" 404 203 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:20:42:11 +0100] "GET /favicon.ico HTTP/1.1" 404 209 "http://doume.test/admin" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:20:42:11 +0100] "GET /admin/ HTTP/1.1" 404 204 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:20:42:14 +0100] "GET /admin/dashboard HTTP/1.1" 404 213 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:20:43:00 +0100] "GET / HTTP/1.1" 404 49152 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:20:43:00 +0100] "GET /_wdt/b3fbae HTTP/1.1" 404 209 "http://doume.test/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:20:43:02 +0100] "GET /_wdt/b3fbae HTTP/1.1" 404 209 "http://doume.test/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:20:43:03 +0100] "GET /_wdt/b3fbae HTTP/1.1" 404 209 "http://doume.test/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:20:43:04 +0100] "GET /_wdt/b3fbae HTTP/1.1" 404 209 "http://doume.test/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:20:43:05 +0100] "GET /_wdt/b3fbae HTTP/1.1" 404 209 "http://doume.test/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:20:43:20 +0100] "GET / HTTP/1.1" 404 49152 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:20:43:20 +0100] "GET /_wdt/82058d HTTP/1.1" 404 209 "http://doume.test/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:20:43:21 +0100] "GET /_wdt/82058d HTTP/1.1" 404 209 "http://doume.test/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:20:43:22 +0100] "GET /_wdt/82058d HTTP/1.1" 404 209 "http://doume.test/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:20:43:23 +0100] "GET /_wdt/82058d HTTP/1.1" 404 209 "http://doume.test/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:20:43:24 +0100] "GET /_wdt/82058d HTTP/1.1" 404 209 "http://doume.test/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:20:44:03 +0100] "GET / HTTP/1.1" 404 49152 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:20:44:04 +0100] "GET /_wdt/a9b7b0 HTTP/1.1" 404 209 "http://doume.test/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:20:44:05 +0100] "GET /favicon.ico HTTP/1.1" 404 209 "http://doume.test/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:20:44:05 +0100] "GET /_wdt/a9b7b0 HTTP/1.1" 404 209 "http://doume.test/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:20:44:06 +0100] "GET /_wdt/a9b7b0 HTTP/1.1" 404 209 "http://doume.test/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:20:44:07 +0100] "GET /_wdt/a9b7b0 HTTP/1.1" 404 209 "http://doume.test/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:20:44:08 +0100] "GET /admin/ HTTP/1.1" 404 204 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
127.0.0.1 - - [30/Nov/2018:20:44:31 +0100] "GET /admin/ HTTP/1.1" 404 204 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36"
[Fri Nov 30 19:54:38.362098 2018] [authz_core:error] [pid 68481] [client 127.0.0.1:55323] AH01630: client denied by server configuration: /Users/julien/Desktop/DOUME/ledellin/public/
[Fri Nov 30 19:54:40.626560 2018] [authz_core:error] [pid 68481] [client 127.0.0.1:55323] AH01630: client denied by server configuration: /Users/julien/Desktop/DOUME/ledellin/public/favicon.ico, referer: http://doume.test/
body {
background-color: lightgray;
}
/*
* Welcome to your app's main JavaScript file!
*
* We recommend including the built version of this JavaScript file
* (and its CSS file) in your base layout (base.html.twig).
*/
// any CSS you require will output into a single css file (app.css in this case)
require('../css/app.css');
// Need jQuery? Install it with "yarn add jquery", then uncomment to require it.
// var $ = require('jquery');
console.log('Hello Webpack Encore! Edit me in assets/js/app.js');
#!/usr/bin/env php
<?php
use App\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Debug\Debug;
set_time_limit(0);
require dirname(__DIR__).'/vendor/autoload.php';
if (!class_exists(Application::class)) {
throw new \RuntimeException('You need to add "symfony/framework-bundle" as a Composer dependency.');
}
Kernel::bootstrapCli($_SERVER['argv']);
Kernel::bootstrapEnv();
if ($_SERVER['APP_DEBUG']) {
umask(0000);
if (class_exists(Debug::class)) {
Debug::enable();
}
}
$kernel = new Kernel($_SERVER['APP_ENV'], $_SERVER['APP_DEBUG']);
$application = new Application($kernel);
$application->run();
#!/usr/bin/env php
<?php
if (!file_exists(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit')) {
echo "Unable to find the `simple-phpunit` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
exit(1);
}
$classLoader = require dirname(__DIR__).'/vendor/autoload.php';
App\Kernel::bootstrapEnv('test');
$classLoader->unregister();
if (false === getenv('SYMFONY_PHPUNIT_REMOVE')) {
putenv('SYMFONY_PHPUNIT_REMOVE=');
}
if (false === getenv('SYMFONY_PHPUNIT_DIR')) {
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');
}
require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit';
{
"type": "project",
"license": "proprietary",
"require": {
"php": "^7.1.3",
"ext-ctype": "*",
"ext-iconv": "*",
"friendsofsymfony/rest-bundle": "^2.4",
"friendsofsymfony/user-bundle": "^2.1",
"knplabs/knp-paginator-bundle": "^2.8",
"liip/imagine-bundle": "^2.1",
"nelmio/api-doc-bundle": "^3.3",
"pixassociates/sortable-behavior-bundle": "^1.5",
"sensio/framework-extra-bundle": "^5.1",
"sonata-project/admin-bundle": "^3.40",
"sonata-project/block-bundle": "^3.12",
"sonata-project/doctrine-orm-admin-bundle": "^3.6",
"sonata-project/user-bundle": "^4.2",
"stof/doctrine-extensions-bundle": "^1.3",
"symfony/asset": "4.1.*",
"symfony/console": "4.1.*",
"symfony/expression-language": "4.1.*",
"symfony/flex": "^1.1",
"symfony/form": "4.1.*",
"symfony/framework-bundle": "4.1.*",
"symfony/monolog-bundle": "^3.1",
"symfony/orm-pack": "*",
"symfony/process": "4.1.*",
"symfony/security-bundle": "4.1.*",
"symfony/serializer-pack": "*",
"symfony/swiftmailer-bundle": "^3.1",
"symfony/translation": "4.1.*",
"symfony/twig-bundle": "4.1.*",
"symfony/validator": "4.1.*",
"symfony/web-link": "4.1.*",
"symfony/webpack-encore-bundle": "^1.0",
"symfony/yaml": "4.1.*",
"vich/uploader-bundle": "^1.8"
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.0",
"hautelook/alice-bundle": "^2.3",
"sensiolabs/security-checker": "^5.0",
"symfony/debug-pack": "*",
"symfony/dotenv": "4.1.*",
"symfony/maker-bundle": "^1.0",
"symfony/profiler-pack": "*",
"symfony/test-pack": "*",
"symfony/var-dumper": "4.1.*",
"symfony/web-server-bundle": "4.1.*"
},
"config": {
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"paragonie/random_compat": "2.*",
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php56": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd",
"security-checker security:check": "script"
},
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "4.1.*"
}
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
<?php
return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle::class => ['all' => true],
Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle::class => ['all' => true],
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true],
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
Symfony\Bundle\WebServerBundle\WebServerBundle::class => ['dev' => true],
FOS\UserBundle\FOSUserBundle::class => ['all' => true],
Sonata\DatagridBundle\SonataDatagridBundle::class => ['all' => true],
Sonata\CoreBundle\SonataCoreBundle::class => ['all' => true],
Sonata\BlockBundle\SonataBlockBundle::class => ['all' => true],
Knp\Bundle\MenuBundle\KnpMenuBundle::class => ['all' => true],
Sonata\AdminBundle\SonataAdminBundle::class => ['all' => true],
Liip\ImagineBundle\LiipImagineBundle::class => ['all' => true],
Sonata\EasyExtendsBundle\SonataEasyExtendsBundle::class => ['all' => true],
Sonata\UserBundle\SonataUserBundle::class => ['all' => true],
Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle::class => ['all' => true],
Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true],
Vich\UploaderBundle\VichUploaderBundle::class => ['all' => true],
Pix\SortableBehaviorBundle\PixSortableBehaviorBundle::class => ['all' => true],
Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true],
Nelmio\ApiDocBundle\NelmioApiDocBundle::class => ['all' => true],
Knp\Bundle\PaginatorBundle\KnpPaginatorBundle::class => ['all' => true],
Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true],
FOS\RestBundle\FOSRestBundle::class => ['all' => true],
Nelmio\Alice\Bridge\Symfony\NelmioAliceBundle::class => ['dev' => true, 'test' => true],
Fidry\AliceDataFixtures\Bridge\Symfony\FidryAliceDataFixturesBundle::class => ['dev' => true, 'test' => true],
Hautelook\AliceBundle\HautelookAliceBundle::class => ['dev' => true, 'test' => true],
];
framework:
assets:
json_manifest_path: '%kernel.project_dir%/public/build/manifest.json'
debug:
# Forwards VarDumper Data clones to a centralized server allowing to inspect dumps on CLI or in your browser.
# See the "server:dump" command to start a new server.
dump_destination: "tcp://%env(VAR_DUMPER_SERVER)%"
services:
EasyCorp\EasyLog\EasyLogHandler:
public: false
arguments: ['%kernel.logs_dir%/%kernel.environment%.log']
#// FIXME: How to add this configuration automatically without messing up with the monolog configuration?
#monolog:
# handlers:
# buffered:
# type: buffer
# handler: easylog
# channels: ['!event']
# level: debug
# easylog:
# type: service
# id: EasyCorp\EasyLog\EasyLogHandler
hautelook_alice:
fixtures_path: fixtures
root_dirs:
- '%kernel.root_dir%'
- '%kernel.project_dir%'
\ No newline at end of file
monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
channels: ["!event"]
# uncomment to get logging in your browser
# you may have to allow bigger header sizes in your Web server configuration
#firephp:
# type: firephp
# level: info
#chromephp:
# type: chromephp
# level: info
console:
type: console
process_psr_3_messages: false
channels: ["!event", "!doctrine", "!console"]
nelmio_alice:
locale: 'fr_FR'
functions_blacklist:
- 'current'
framework:
router:
strict_requirements: true
# See https://symfony.com/doc/current/email/dev_environment.html
swiftmailer:
# send all emails to a specific address
#delivery_addresses: ['me@example.com']
web_profiler:
toolbar: true
intercept_redirects: false
framework:
profiler: { only_exceptions: false }
parameters:
# Adds a fallback DATABASE_URL if the env var is not set.
# This allows you to run cache:warmup even if your
# environment variables are not available yet.
# You should not need to change this value.
env(DATABASE_URL): ''
doctrine:
dbal:
# configure these for your database server
driver: 'pdo_mysql'
server_version: '5.7'
charset: utf8mb4
default_table_options:
charset: utf8mb4
collate: utf8mb4_unicode_ci
url: '%env(resolve:DATABASE_URL)%'
types:
json: Sonata\Doctrine\Types\JsonType
orm:
auto_generate_proxy_classes: '%kernel.debug%'
naming_strategy: doctrine.orm.naming_strategy.underscore
auto_mapping: true
mappings:
App:
is_bundle: false
type: annotation
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity'
alias: App
dql:
string_functions:
str_to_date: App\DQL\StrToDate
filters:
softdeleteable:
class: Gedmo\SoftDeleteable\Filter\SoftDeleteableFilter
enabled: true
\ No newline at end of file
doctrine_migrations:
dir_name: '%kernel.project_dir%/src/Migrations'
# namespace is arbitrary but should be different from App\Migrations
# as migrations classes should NOT be autoloaded
namespace: DoctrineMigrations
# Read the documentation: https://symfony.com/doc/master/bundles/FOSRestBundle/index.html
fos_rest: ~
# param_fetcher_listener: true
# allowed_methods_listener: true
# routing_loader: true
# view:
# view_response_listener: true
# exception:
# codes:
# App\Exception\MyException: 403
# messages:
# App\Exception\MyException: Forbidden area.
# format_listener:
# rules:
# - { path: ^/api, prefer_extension: true, fallback_format: json, priorities: [ json, html ] }
fos_user:
db_driver: orm
firewall_name: main
user_class: App\Entity\User
from_email:
address: noreply@doume.org
sender_name: Doume
service:
mailer: fos_user.mailer.twig_swift
user_manager: sonata.user.orm.user_manager
group:
group_class: App\Entity\Usergroup
group_manager: sonata.user.orm.group_manager # If you're using doctrine orm (use sonata.user.mongodb.group_manager for mongodb)
# registration:
# form:
# type: osp_person_registration
# confirmation:
# enabled: true
# template: OSPUserBundle:Registration:email.txt.twig
\ No newline at end of file
framework:
secret: '%env(APP_SECRET)%'
#default_locale: en
#csrf_protection: true
#http_method_override: true
# Enables session support. Note that the session will ONLY be started if you read or write from it.
# Remove or comment this section to explicitly disable session support.
session:
handler_id: ~
#esi: true
#fragments: true
php_errors:
log: true
cache:
# Put the unique name of your app here: the prefix seed
# is used to compute stable namespaces for cache keys.
#prefix_seed: your_vendor_name/app_name
# The app cache caches to the filesystem by default.
# Other options include:
# Redis
#app: cache.adapter.redis
#default_redis_provider: redis://localhost
# APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)
#app: cache.adapter.apcu
liip_imagine:
# valid drivers options include "gd" or "gmagick" or "imagick"
driver: "gd"
# resolvers:
# default:
# web_path:
# web_root: "%kernel.project_dir%/public"
# cache_prefix: "images/cache"
# loaders:
# default:
# filesystem:
# data_root: "%kernel.project_dir%/public/"
# define your filter sets under this option
filter_sets:
# an example thumbnail transformation definition
# https://symfony.com/doc/current/bundles/LiipImagineBundle/basic-usage.html#create-thumbnails
squared_thumbnail:
# set your image quality defaults
jpeg_quality: 85
png_compression_level: 8
# setup the filter steps to apply for this transformation
filters:
# auto rotate the image using EXIF metadata
auto_rotate: ~
# strip the image of all metadata
strip: ~
# scale and square the image to the given dimensions
thumbnail:
size: [250, 250]
mode: outbound
allow_upscale: true
# create border by placing image on larger black background
# background:
# size: [256, 256]
# position: center
# color: '#fff'
# nelmio_api_doc:
# areas:
# path_patterns: # an array of regexps
# - ^/api(?!/doc$)
# host_patterns:
# - ^api\.
# documentation:
# host: api.example.com
# schemes: [http, https]
# info:
# title: My App
# description: This is an awesome app!
# version: 1.0.0
# securityDefinitions:
# Bearer:
# type: apiKey
# description: 'Value: Bearer {jwt}'
# name: Authorization
# in: header
# security:
# - Bearer: []
nelmio_api_doc:
documentation:
info:
title: Ledellin
description: Application de gesiton de Monnaie Locale Complémentaire
version: 1.0.0
areas: # to filter documented areas
path_patterns:
- ^/api(?!/doc$) # Accepts routes under /api except /api/doc
\ No newline at end of file
doctrine:
orm:
metadata_cache_driver:
type: service
id: doctrine.system_cache_provider
query_cache_driver:
type: service
id: doctrine.system_cache_provider
result_cache_driver:
type: service
id: doctrine.result_cache_provider
services:
doctrine.result_cache_provider:
class: Symfony\Component\Cache\DoctrineProvider
public: false
arguments:
- '@doctrine.result_cache_pool'
doctrine.system_cache_provider:
class: Symfony\Component\Cache\DoctrineProvider
public: false
arguments:
- '@doctrine.system_cache_pool'
framework:
cache:
pools:
doctrine.result_cache_pool:
adapter: cache.app
doctrine.system_cache_pool:
adapter: cache.system
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
excluded_404s:
# regex: exclude all 404 errors from the logs
- ^/
nested:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
console:
type: console
process_psr_3_messages: false
channels: ["!event", "!doctrine"]
deprecation:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.deprecations.log"
deprecation_filter:
type: filter
handler: deprecation
max_level: info
channels: ["php"]
framework:
router:
strict_requirements: ~
# security:
# # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
# providers:
# in_memory: { memory: ~ }
# firewalls:
# dev:
# pattern: ^/(_(profiler|wdt)|css|images|js)/
# security: false
# main:
# anonymous: true
# # activate different ways to authenticate
# # http_basic: true
# # https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate
# # form_login: true
# # https://symfony.com/doc/current/security/form_login_setup.html
# # Easy way to control access for large sections of your site
# # Note: Only the *first* access control that matches will be used
# access_control:
# # - { path: ^/admin, roles: ROLE_ADMIN }
# # - { path: ^/profile, roles: ROLE_USER }
security:
# https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
providers:
fos_userbundle:
id: fos_user.user_provider.username_email
in_memory: { memory: ~ }
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
# -> custom firewall for the admin area of the URL
admin:
pattern: /admin(.*)
context: user
form_login:
provider: fos_userbundle
login_path: /admin/login
check_path: /admin/login_check
use_forward: false
failure_path: null
success_handler: redirect.after.login
logout:
path: /admin/logout
target: /admin/login
anonymous: true
# -> end custom configuration
main:
pattern: ^/
form_login:
provider: fos_userbundle
login_path: fos_user_security_login
check_path: fos_user_security_check
csrf_token_generator: security.csrf.token_manager
success_handler: redirect.after.login
logout:
path: fos_user_security_logout
target: fos_user_security_login
anonymous: true
remember_me:
secret: "%kernel.secret%"
lifetime: 31536000
path: /
domain: ~
user_provider: fos_userbundle
always_remember_me: true
encoders:
FOS\UserBundle\Model\UserInterface: bcrypt
role_hierarchy:
ROLE_ADHERENT: ROLE_USER
ROLE_PRESTATAIRE: ROLE_USER
ROLE_ADMIN_SIEGE: ROLE_USER
ROLE_REDACTEUR: ROLE_USER
ROLE_TRESORIER: ROLE_USER
ROLE_GESTION_GROUPE: ROLE_USER
ROLE_COMPTOIR: ROLE_USER
ROLE_CONTACT: ROLE_USER
ROLE_ADMIN: [ROLE_USER, ROLE_SONATA_ADMIN]
ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
# Easy way to control access for large sections of your site
# Note: Only the *first* access control that matches will be used
access_control:
# Admin login page needs to be accessed without credential
- { path: ^/admin/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/admin/logout$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/admin/login_check$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/admin/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
# Secured part of the site
# This config requires being logged for the whole site and having the admin role for the admin part.
# Change these rules to adapt them to your needs
- { path: ^/admin/, role: [ROLE_ADMIN, ROLE_SUPER_ADMIN, ROLE_SONATA_ADMIN] }
- { path: ^/.*, role: IS_AUTHENTICATED_ANONYMOUSLY }
services:
SensioLabs\Security\SecurityChecker:
public: false
SensioLabs\Security\Command\SecurityCheckerCommand:
arguments: ['@SensioLabs\Security\SecurityChecker']
public: false
tags:
- { name: console.command, command: 'security:check' }
sensio_framework_extra:
router:
annotations: false
sonata_user:
# security_acl: true
manager_type: orm # can be orm or mongodb
class:
user: App\Entity\User
group: App\Entity\Usergroup
profile:
default_avatar: 'images/admin/default_avatar.png' # Default avatar displayed if the user doesn't have one
sonata_block:
default_contexts: [sonata_page_bundle]
blocks:
sonata.admin.block.admin_list:
contexts: [admin]
#sonata.admin_doctrine_orm.block.audit:
# contexts: [admin]
sonata.block.service.text:
\ No newline at end of file
sonata_admin:
security:
handler: sonata.admin.security.handler.role
role_admin: ROLE_ADMIN
role_super_admin: ROLE_SUPER_ADMIN
title: 'MLC Admin'
title_logo: /images/admin/logo.png
dashboard:
# DASHBOARD de l'admin
#
# Layout :
#
# TOP TOP TOP
# LEFT CENTER RIGHT
# LEFT CENTER RIGHT
# LEFT CENTER RIGHT
# BOTTOM BOTTOM BOTTOM
blocks:
- { type: sonata.admin.block.admin_list, position: left }
-
type: sonata.block.service.text
position: right
settings:
content: >
<h2>Bienvenue sur l'administration de votre Monnaie Locale Complémentaire !</h2>
:
# Exemple de block de stats
# -
# class: col-lg-3 col-xs-6 # twitter bootstrap responsive code
# position: top # zone in the dashboard
# type: sonata.admin.block.stats # block id
# settings:
# code: sonata.page.admin.page # admin code - service id
# icon: fa-magic # font awesome icon
# text: Edited Pages
# color: bg-yellow # colors: bg-green, bg-red and bg-aqua
# filters: # filter values
# edited: { value: 1 } # filtre on admin (settings:code)
# Gérer l'affichage du menu de l'admin en fonction des roles
# groups:
# app.admin.group.content:
# label: app.admin.group.content
# label_catalogue: App
# items:
# - app.admin.post
# roles: [ ROLE_ONE, ROLE_TWO ]
sonata_block:
blocks:
sonata.admin.block.admin_list:
contexts: [admin]
sonata_core:
form:
mapping:
enabled: false
# Read the documentation: https://symfony.com/doc/current/bundles/StofDoctrineExtensionsBundle/index.html
# See the official DoctrineExtensions documentation for more details: https://github.com/Atlantic18/DoctrineExtensions/tree/master/doc/
stof_doctrine_extensions:
default_locale: en_US
orm:
default:
sortable: true
timestampable: true
sluggable: true
softdeleteable: true
\ No newline at end of file
swiftmailer:
url: '%env(MAILER_URL)%'
spool: { type: 'memory' }
framework:
test: true
session:
storage_id: session.storage.mock_file
imports:
- { resource: ../dev/hautelook_alice.yaml }
monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
channels: ["!event"]
imports:
- { resource: ../dev/nelmio_alice.yaml }
framework:
router:
strict_requirements: true
swiftmailer:
disable_delivery: true
web_profiler:
toolbar: false
intercept_redirects: false
framework:
profiler: { collect: false }
framework:
# default_locale: '%locale%'
default_locale: 'fr'
translator:
default_path: '%kernel.project_dir%/translations'
fallbacks:
# - '%locale%'
- 'fr'
- 'en'
twig:
default_path: '%kernel.project_dir%/templates'
debug: '%kernel.debug%'
strict_variables: '%kernel.debug%'
services:
_defaults:
public: false
autowire: true
autoconfigure: true
# Uncomment any lines below to activate that Twig extension
#Twig\Extensions\ArrayExtension: ~
#Twig\Extensions\DateExtension: ~
#Twig\Extensions\IntlExtension: ~
#Twig\Extensions\TextExtension: ~
framework:
validation:
email_validation_mode: html5
vich_uploader:
db_driver: orm
mappings:
annonce:
uri_prefix: /images/annonces
upload_destination: '%kernel.project_dir%/public/images/annonces'
# delete_on_update: true
# delete_on_remove: true
\ No newline at end of file
webpack_encore:
# The path where Encore is building the assets.
# This should match Encore.setOutputPath() in webpack.config.js.
output_path: '%kernel.project_dir%/public/build'
# This file is the entry point to configure your own HTTP routes.
# Files in the routes/ subdirectory configure the routes for your dependencies.
#index:
# path: /
# controller: App\Controller\DefaultController::index
sonata_user_admin_security:
resource: '@SonataUserBundle/Resources/config/routing/admin_security.xml'
prefix: /admin
sonata_user_admin_resetting:
resource: '@SonataUserBundle/Resources/config/routing/admin_resetting.xml'
prefix: /admin/resetting
fos_user:
resource: "@FOSUserBundle/Resources/config/routing/all.xml"
\ No newline at end of file
controllers:
resource: ../../src/Controller/
type: annotation
_errors:
resource: '@TwigBundle/Resources/config/routing/errors.xml'
prefix: /_error
web_profiler_wdt:
resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml'
prefix: /_wdt
web_profiler_profiler:
resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml'
prefix: /_profiler
_liip_imagine:
resource: "@LiipImagineBundle/Resources/config/routing.yaml"
# Expose your documentation as JSON swagger compliant
app.swagger:
path: /api/doc.json
methods: GET
defaults: { _controller: nelmio_api_doc.controller.swagger }
## Requires the Asset component and the Twig bundle
## $ composer require twig asset
#app.swagger_ui:
# path: /api/doc
# methods: GET
# defaults: { _controller: nelmio_api_doc.controller.swagger_ui }
admin_area:
resource: "@SonataAdminBundle/Resources/config/routing/sonata_admin.xml"
prefix: /admin
_sonata_admin:
resource: .
type: sonata_admin
prefix: /admin
# This file is the entry point to configure your own services.
# Files in the packages/ subdirectory configure your dependencies.
# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters:
locale: 'en'
sonata.user.admin.user.class: 'App\Admin\UserAdmin'
services:
# default configuration for services in *this* file
_defaults:
autowire: true # Automatically injects dependencies in your services.
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
public: false # Allows optimizing the container by removing unused services; this also means
# fetching services directly from the container via $container->get() won't work.
# The best practice is to be explicit about your dependencies anyway.
# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
App\:
resource: '../src/*'
exclude: '../src/{DependencyInjection,Listener,Entity,Migrations,Tests,Kernel.php}'
# controllers are imported separately to make sure services can be injected
# as action arguments even if you don't extend any base controller class
App\Controller\:
resource: '../src/Controller'
tags: ['controller.service_arguments']
# add more service definitions when explicit configuration is needed
# please note that last definitions always *replace* previous ones
# add more service definitions when explicit configuration is needed
# please note that last definitions always *replace* previous ones
redirect.after.login:
class: App\Listener\AfterLoginRedirection
autowire: false
arguments: ['@router']
App\Controller\RegistrationController:
autowire: false
# Configuration de l'admin
admin.adherent.gerer:
class: App\Admin\AdherentAdmin
# arguments: [~, App\Entity\OBJECT, 'PixSortableBehaviorBundle:SortableAdmin']
arguments: [~, App\Entity\Adherent, ~]
tags:
- name: sonata.admin
manager_type: orm
group: "Adherent"
label: "Gérer"
# - group: "Contenu"
# - label: "Adhérents"
# - label_catalogue: "App"
public: true
admin.adherent.cotisations:
class: App\Admin\CotisationAdherentAdmin
arguments: [~, App\Entity\Cotisation, ~]
tags:
- name: sonata.admin
manager_type: orm
group: "Adherent"
label: "Cotisation"
public: true
admin.prestataire.gerer:
class: App\Admin\PrestataireAdmin
arguments: [~, App\Entity\Prestataire, ~]
tags:
- name: sonata.admin
manager_type: orm
group: "Prestataire"
label: "Gérer"
public: true
admin.prestataire.cotisations:
class: App\Admin\CotisationPrestataireAdmin
arguments: [~, App\Entity\Cotisation, ~]
tags:
- name: sonata.admin
manager_type: orm
group: "Prestataire"
label: "Cotisation"
public: true
admin.groupe.gerer:
class: App\Admin\GroupeAdmin
arguments: [~, App\Entity\Groupe, ~]
tags:
- name: sonata.admin
manager_type: orm
group: "Groupe"
label: "Gérer"
public: true
admin.groupepresta.gerer:
class: App\Admin\GroupeprestataireAdmin
arguments: [~, App\Entity\Groupeprestataire, ~]
tags:
- name: sonata.admin
manager_type: orm
group: "Amap / Marché"
label: "Gérer"
public: true
App\Entity\Siege:
siege:
name: 'Siege MLC'
content: 'MLC'
App\Entity\Groupe:
groupe{1..10}:
name: <text(10)>
content: <text(10)>
siege: '@siege'
App\Entity\Geoloc:
geoloc{1..70}:
adresse: <address()>
# cpostal: <postcode()>
ville: <city()>
lat: <randomFloat(6, 45, 46)>
lon: <randomFloat(6, 2, 5)>
enabled: true
App\Entity\Comptoir:
comptoir{1..50}:
name: <text(10)>
enabled: true
tel: '<phoneNumber()>'
email: <email()>
groupe: '@groupe*'
geoloc (unique): '@geoloc*'
App\Entity\Groupeprestataire:
amap{1..10}:
__construct: []
type: 'amap'
name: <text(10)>
horaires: "<dayOfWeek()> de <time('H')>h à <time('H')>h"
enabled: true
geoloc: '@geoloc*'
tel: '<phoneNumber()>'
email: <email()>
prestataires: '5x @prestataire*'
marche{1..10}:
__construct: []
type: 'marche'
name: <text(10)>
horaires: "<dayOfWeek()> de time('H')h à time('H')h"
enabled: true
geoloc: '@geoloc*'
tel: '<phoneNumber()>'
email: <email()>
prestataires: '5x @prestataire*'
App\Entity\TypePrestataire:
typepresta_prestataire:
name: 'Prestataire'
typepresta_partenaire:
name: 'Partenaire'
typepresta_amap:
name: 'Amap'
typepresta_marche:
name: 'Marché'
App\Entity\Usergroup:
usergroup_adherent:
__construct: ['Adherent', 'ROLE_ADHERENT']
usergroup_prestataire:
__construct: ['Prestataire', 'ROLE_PRESTATAIRE']
usergroup_adminsiege:
__construct: ['Administrateur du Siege', 'ROLE_ADMIN_SIEGE']
usergroup_redacteur:
__construct: ['Rédacteur', 'ROLE_REDACTEUR']
usergroup_tresorier:
__construct: ['Trésorier', 'ROLE_TRESORIER']
usergroup_gestiongroupe:
__construct: ['Gestionnaire de Groupe', 'ROLE_GESTION_GROUPE']
usergroup_comptoir:
__construct: ['Comptoir', 'ROLE_COMPTOIR']
usergroup_contact:
__construct: ['Contact', 'ROLE_CONTACT']
usergroup_admin:
__construct: ['Admin', 'ROLE_ADMIN']
usergroup_superadmin:
__construct: ['Super Admin', 'ROLE_SUPER_ADMIN']
App\Entity\User:
usersuperadmin:
username: 'adminuser'
email: 'julien.jorry@gmail.com'
plainPassword: 'Fyeevuio22'
enabled: true
groups: ['@usergroup_superadmin']
roles: ['ROLE_SUPER_ADMIN']
useradmin:
username: 'user_admin'
email: <email()>
plainPassword: 'test'
enabled: true
groups: ['@usergroup_admin']
roles: ['ROLE_ADMIN']
usercontact:
username: 'user_contact'
email: <email()>
plainPassword: 'test'
enabled: true
groups: ['@usergroup_contact']
roles: ['ROLE_CONTACT']
usercomptoir:
username: 'user_comptoir'
email: <email()>
plainPassword: 'test'
enabled: true
groups: ['@usergroup_comptoir']
roles: ['ROLE_COMPTOIR']
usergestiongroupe:
username: 'user_gestiongroupe'
email: <email()>
plainPassword: 'test'
enabled: true
groups: ['@usergroup_gestiongroupe']
roles: ['ROLE_GESTION_GROUPE']
usertresorier:
username: 'user_tresorier'
email: <email()>
plainPassword: 'test'
enabled: true
groups: ['@usergroup_tresorier']
roles: ['ROLE_TRESORIER']
userredacteur:
username: 'user_redacteur'
email: <email()>
plainPassword: 'test'
enabled: true
groups: ['@usergroup_redacteur']
roles: ['ROLE_REDACTEUR']
useradminsiege:
username: 'user_adminsiege'
email: <email()>
plainPassword: 'test'
enabled: true
groups: ['@usergroup_adminsiege']
roles: ['ROLE_ADMIN_SIEGE']
userprestataire:
username: 'user_prestataire'
email: <email()>
plainPassword: 'test'
enabled: true
groups: ['@usergroup_prestataire']
roles: ['ROLE_PRESTATAIRE']
useradherent:
username: 'user_adherent'
email: <email()>
plainPassword: 'test'
enabled: true
groups: ['@usergroup_adherent']
roles: ['ROLE_ADHERENT']
App\Entity\User:
user{1..15}:
username: <userName()>
email: <email()>
plainPassword: 'test'
enabled: true
groups: ['@usergroup_adherent']
App\Entity\Adherent:
adherent{1..15}:
ecompte: '0'
user: '@user<current()>'
App\Entity\User:
user{1..15}:
username: <userName()>
email: <email()>
plainPassword: 'test'
enabled: true
groups: ['@usergroup_prestataire']
App\Entity\Prestataire:
prestataire{1..15}:
raison: <text(10)>
metier: <text(10)>
iban: <text(10)>
statut: <text(10)>
siret: <text(10)>
user: '@user<current()>'
typeprestataire: '@typepresta_prestataire'
App\Entity\User:
user{1..15}:
username: <userName()>
email: <email()>
plainPassword: 'test'
enabled: true
groups: ['@usergroup_prestataire']
App\Entity\Prestataire:
prestataire{1..15}:
raison: <text(10)>
metier: <text(10)>
iban: <text(10)>
statut: <text(10)>
siret: <text(10)>
user: '@user<current()>'
typeprestataire: '@typepresta_partenaire'
{
"devDependencies": {
"@symfony/webpack-encore": "^0.21.0",
"node-sass": "^4.10.0",
"sass-loader": "^7.1.0",
"webpack-notifier": "^1.6.0"
},
"license": "UNLICENSED",
"private": true,
"scripts": {
"dev-server": "encore dev-server",
"dev": "encore dev",
"watch": "encore dev --watch",
"build": "encore production --progress"
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
>
<php>
<ini name="error_reporting" value="-1" />
</php>
<testsuites>
<testsuite name="Project Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory>src</directory>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>
</phpunit>
<?php
use App\Kernel;
use Symfony\Component\Debug\Debug;
use Symfony\Component\HttpFoundation\Request;
require dirname(__DIR__).'/vendor/autoload.php';
Kernel::bootstrapEnv();
if ($_SERVER['APP_DEBUG']) {
umask(0000);
Debug::enable();
}
if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {
Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);
}
if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {
Request::setTrustedHosts(explode(',', $trustedHosts));
}
$kernel = new Kernel($_SERVER['APP_ENV'], $_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
<?php
namespace App\Admin;
use App\Admin\UserAdmin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
class AdherentAdmin extends UserAdmin
{
public function configure()
{
parent::configure();
// $this->classnameLabel = "Utilisateurs";
}
/**
* {@inheritdoc}
*/
protected function configureFormFields(FormMapper $formMapper): void
{
parent::configureFormFields($formMapper);
$user = $this->getSubject();
}
protected function configureListFields(ListMapper $listMapper): void
{
parent::configureListFields($listMapper);
}
}
<?php
namespace App\Admin;
use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Show\ShowMapper;
class ComptoirAdmin extends AbstractAdmin
{
/**
* {@inheritdoc}
*/
protected function configureShowFields(ShowMapper $showMapper)
{
}
/**
* {@inheritdoc}
*/
protected function configureFormFields(FormMapper $formMapper)
{
$comptoir = $this->getSubject();
}
/**
* {@inheritdoc}
*/
protected function configureListFields(ListMapper $listMapper)
{
}
}
<?php
namespace App\Admin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Show\ShowMapper;
class CotisationAdherentAdmin extends CotisationAdmin
{
/**
* {@inheritdoc}
*/
public function createQuery($context = 'list')
{
$query = parent::createQuery($context);
// $query->leftJoin($query->getRootAliases()[0] . '.user', 'u')
// ->andWhere(
// $query->expr()->eq($query->getRootAliases()[0] . '.my_field', ':my_param')
// );
// $query->setParameter('my_param', 'my_value');
return $query;
}
/**
* {@inheritdoc}
*/
protected function configureShowFields(ShowMapper $showMapper)
{
parent::configureShowFields($showMapper);
}
/**
* {@inheritdoc}
*/
protected function configureFormFields(FormMapper $formMapper): void
{
parent::configureFormFields($formMapper);
$cotisation = $this->getSubject();
}
/**
* {@inheritdoc}
*/
protected function configureListFields(ListMapper $listMapper): void
{
parent::configureListFields($listMapper);
}
}
<?php
namespace App\Admin;
use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Show\ShowMapper;
class CotisationAdmin extends AbstractAdmin
{
/**
* {@inheritdoc}
*/
protected function configureShowFields(ShowMapper $showMapper)
{
}
/**
* {@inheritdoc}
*/
protected function configureFormFields(FormMapper $formMapper)
{
$cotisation = $this->getSubject();
}
/**
* {@inheritdoc}
*/
protected function configureListFields(ListMapper $listMapper)
{
}
}
<?php
namespace App\Admin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Show\ShowMapper;
class CotisationPrestataireAdmin extends CotisationAdmin
{
public function createQuery($context = 'list')
{
$query = parent::createQuery($context);
// $query->andWhere(
// $query->expr()->eq($query->getRootAliases()[0] . '.my_field', ':my_param')
// );
// $query->setParameter('my_param', 'my_value');
return $query;
}
/**
* {@inheritdoc}
*/
protected function configureShowFields(ShowMapper $showMapper)
{
parent::configureShowFields($showMapper);
}
/**
* {@inheritdoc}
*/
protected function configureFormFields(FormMapper $formMapper): void
{
parent::configureFormFields($formMapper);
$cotisation = $this->getSubject();
}
/**
* {@inheritdoc}
*/
protected function configureListFields(ListMapper $listMapper): void
{
parent::configureListFields($listMapper);
}
}
<?php
namespace App\Admin;
use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Show\ShowMapper;
class DocumentAdmin extends AbstractAdmin
{
/**
* {@inheritdoc}
*/
protected function configureShowFields(ShowMapper $showMapper)
{
}
/**
* {@inheritdoc}
*/
protected function configureFormFields(FormMapper $formMapper)
{
$document = $this->getSubject();
}
/**
* {@inheritdoc}
*/
protected function configureListFields(ListMapper $listMapper)
{
}
}
<?php
namespace App\Admin;
use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Show\ShowMapper;
class GroupeAdmin extends AbstractAdmin
{
/**
* {@inheritdoc}
*/
protected function configureShowFields(ShowMapper $showMapper)
{
}
/**
* {@inheritdoc}
*/
protected function configureFormFields(FormMapper $formMapper)
{
$groupe = $this->getSubject();
$formMapper
->add('siege')
->add('comptoir')
;
}
/**
* {@inheritdoc}
*/
protected function configureListFields(ListMapper $listMapper)
{
}
}
<?php
namespace App\Admin;
use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Show\ShowMapper;
class GroupeprestataireAdmin extends AbstractAdmin
{
protected $datagridValues = [
// reverse order (default = 'ASC')
'_sort_order' => 'DESC',
// name of the ordered field (default = the model's id field, if any)
'_sort_by' => 'updatedAt',
];
/**
* {@inheritdoc}
*/
protected function configureShowFields(ShowMapper $showMapper)
{
}
/**
* {@inheritdoc}
*/
protected function configureFormFields(FormMapper $formMapper)
{
$comptoir = $this->getSubject();
}
/**
* {@inheritdoc}
*/
protected function configureListFields(ListMapper $listMapper)
{
}
}
<?php
namespace App\Admin;
use App\Admin\UserAdmin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Show\ShowMapper;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
class PrestataireAdmin extends UserAdmin
{
public function configure()
{
parent::configure();
// $this->classnameLabel = "Utilisateurs";
}
/**
* {@inheritdoc}
*/
protected function configureFormFields(FormMapper $formMapper): void
{
parent::configureFormFields($formMapper);
$user = $this->getSubject();
}
protected function configureListFields(ListMapper $listMapper): void
{
parent::configureListFields($listMapper);
}
}
<?php
namespace App\Admin;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Route\RouteCollection;
use Sonata\AdminBundle\Show\ShowMapper;
use Sonata\UserBundle\Admin\Model\UserAdmin as SonataUserAdmin;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
class UserAdmin extends SonataUserAdmin
{
protected $datagridValues = [
// reverse order (default = 'ASC')
'_sort_order' => 'DESC',
// name of the ordered field (default = the model's id field, if any)
'_sort_by' => 'updatedAt',
];
public function configure()
{
parent::configure();
// $this->classnameLabel = "Utilisateurs";
}
/**
* {@inheritdoc}
*/
protected function configureFormFields(FormMapper $formMapper): void
{
parent::configureFormFields($formMapper);
$user = $this->getSubject();
}
/**
* {@inheritdoc}
*/
protected function configureListFields(ListMapper $listMapper): void
{
parent::configureListFields($listMapper);
// unset($this->listModes['mosaic']);
}
/**
* {@inheritdoc}
*/
// protected function configureDatagridFilters(DatagridMapper $datagridMapper)
// {
// $datagridMapper
// ->add('phone')
// ->add('email', null, [
// 'show_filter' => true
// ])
// ;
// }
/**
* {@inheritdoc}
*/
protected function configureRoutes(RouteCollection $collection)
{
// $collection->remove('create');
// if (!$this->isGranted('ROLE_SUPER_ADMIN')) {
// $collection->clearExcept([]);
// }
}
}
<?php
namespace App\Application\Sonata\UserBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
/**
* This file has been generated by the SonataEasyExtendsBundle.
*
* @link https://sonata-project.org/easy-extends
*
* References:
* @link http://symfony.com/doc/current/book/bundles.html
*/
class ApplicationSonataUserBundle extends Bundle
{
/**
* {@inheritdoc}
*/
public function getParent()
{
return 'SonataUserBundle';
}
}
\ No newline at end of file
<?php
namespace App\Application\Sonata\UserBundle\Document;
use Sonata\UserBundle\Document\BaseGroup as BaseGroup;
/**
* This file has been generated by the SonataEasyExtendsBundle.
*
* @link https://sonata-project.org/easy-extends
*
* References:
* @link http://www.doctrine-project.org/docs/mongodb_odm/1.0/en/reference/working-with-objects.html
*/
class Group extends BaseGroup
{
/**
* @var int $id
*/
protected $id;
/**
* Get id.
*
* @return int $id
*/
public function getId()
{
return $this->id;
}
}
\ No newline at end of file
<?php
namespace App\Application\Sonata\UserBundle\Document;
use Sonata\UserBundle\Document\BaseUser as BaseUser;
/**
* This file has been generated by the SonataEasyExtendsBundle.
*
* @link https://sonata-project.org/easy-extends
*
* References:
* @link http://www.doctrine-project.org/docs/mongodb_odm/1.0/en/reference/working-with-objects.html
*/
class User extends BaseUser
{
/**
* @var int $id
*/
protected $id;
/**
* Get id.
*
* @return int $id
*/
public function getId()
{
return $this->id;
}
}
\ No newline at end of file
<?php
namespace App\Application\Sonata\UserBundle\Entity;
use Sonata\UserBundle\Entity\BaseGroup as BaseGroup;
/**
* This file has been generated by the SonataEasyExtendsBundle.
*
* @link https://sonata-project.org/easy-extends
*
* References:
* @link http://www.doctrine-project.org/projects/orm/2.0/docs/reference/working-with-objects/en
*/
class Group extends BaseGroup
{
/**
* @var int $id
*/
protected $id;
/**
* Get id.
*
* @return int $id
*/
public function getId()
{
return $this->id;
}
}
<?php
namespace App\Application\Sonata\UserBundle\Entity;
use Sonata\UserBundle\Entity\BaseUser as BaseUser;
/**
* This file has been generated by the SonataEasyExtendsBundle.
*
* @link https://sonata-project.org/easy-extends
*
* References:
* @link http://www.doctrine-project.org/projects/orm/2.0/docs/reference/working-with-objects/en
*/
class User extends BaseUser
{
/**
* @var int $id
*/
protected $id;
/**
* Get id.
*
* @return int $id
*/
public function getId()
{
return $this->id;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<doctrine-mongo-mapping xmlns="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping
http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping.xsd">
<document name="App\Application\Sonata\UserBundle\Document\Group" collection="fos_user_group">
<field fieldName="id" id="true" strategy="INCREMENT" />
</document>
</doctrine-mongo-mapping>
<?xml version="1.0" encoding="UTF-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<entity name="App\Application\Sonata\UserBundle\Entity\Group" table="fos_user_group">
<id name="id" column="id" type="integer">
<generator strategy="AUTO" />
</id>
</entity>
</doctrine-mapping>
<?xml version="1.0" encoding="UTF-8"?>
<doctrine-mongo-mapping xmlns="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping
http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping.xsd">
<document name="App\Application\Sonata\UserBundle\Document\User" collection="fos_user_user" customId="true">
<field fieldName="id" id="true" strategy="INCREMENT" />
</document>
</doctrine-mongo-mapping>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<entity name="App\Application\Sonata\UserBundle\Entity\User" table="fos_user_user">
<id name="id" column="id" type="integer">
<generator strategy="AUTO" />
</id>
</entity>
</doctrine-mapping>
<?xml version="1.0" encoding="UTF-8"?>
<serializer>
<!-- This file has been generated by the SonataEasyExtendsBundle: https://sonata-project.org/bundles/easy-extends -->
<class name="App\Application\Sonata\UserBundle\Document\Group" exclusion-policy="all" xml-root-name="_group">
<property xml-attribute-map="true" name="id" type="integer" expose="true" since-version="1.0" groups="sonata_api_read,sonata_api_write,sonata_search"/>
</class>
</serializer>
<?xml version="1.0" encoding="UTF-8"?>
<serializer>
<!-- This file has been generated by the SonataEasyExtendsBundle: https://sonata-project.org/bundles/easy-extends -->
<class name="App\Application\Sonata\UserBundle\Document\User" exclusion-policy="all" xml-root-name="_user">
<property xml-attribute-map="true" name="id" type="integer" expose="true" since-version="1.0" groups="sonata_api_read,sonata_api_write,sonata_search"/>
</class>
</serializer>
<?xml version="1.0" encoding="UTF-8"?>
<serializer>
<!-- This file has been generated by the SonataEasyExtendsBundle: https://sonata-project.org/bundles/easy-extends -->
<class name="App\Application\Sonata\UserBundle\Entity\Group" exclusion-policy="all" xml-root-name="_group">
<property xml-attribute-map="true" name="id" type="integer" expose="true" since-version="1.0" groups="sonata_api_read,sonata_api_write,sonata_search"/>
</class>
</serializer>
<?xml version="1.0" encoding="UTF-8"?>
<serializer>
<!-- This file has been generated by the SonataEasyExtendsBundle: https://sonata-project.org/bundles/easy-extends -->
<class name="App\Application\Sonata\UserBundle\Entity\User" exclusion-policy="all" xml-root-name="_user">
<property xml-attribute-map="true" name="id" type="integer" expose="true" since-version="1.0" groups="sonata_api_read,sonata_api_write,sonata_search"/>
</class>
</serializer>
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
/** @Route("/admina", name="admina_") */
class AdminController extends AbstractController
{
/**
* Voir tous les dashboards
* Route admin_index
* @Route("/", name="settings")
*/
public function settings()
{
return $this->render('admin/settings.html.twig', [
'controller_name' => 'AdminController',
]);
}
}
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
class IndexController extends AbstractController
{
/**
* @Route("/index", name="index")
*/
// public function index(TranslatorInterface $translator)
public function index()
{
// Exemple pour la traduction :
// $translated = $translator->trans('Symfony is great');
// $translator->transChoice(
// 'Hurry up %name%! There is one apple left.|There are %count% apples left.',
// 10,
// // no need to include %count% here; Symfony does that for you
// array('%name%' => $user->getName())
// );
return $this->render('index/index.html.twig', [
'controller_name' => 'IndexController',
]);
}
}
<?php
namespace App\Controller;
use FOS\UserBundle\Controller\RegistrationController as BaseController;
use FOS\UserBundle\Event\FilterUserResponseEvent;
use FOS\UserBundle\Event\FormEvent;
use FOS\UserBundle\Event\GetResponseUserEvent;
use FOS\UserBundle\FOSUserEvents;
use FOS\UserBundle\Form\Factory\FactoryInterface;
use FOS\UserBundle\Model\UserManagerInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
class RegistrationController extends BaseController
{
/**
* @param Request $request
*
* @return Response
*/
public function registerAction(Request $request)
{
$user = $this->userManager->createUser();
$user->setEnabled(true);
$event = new GetResponseUserEvent($user, $request);
$this->eventDispatcher->dispatch(FOSUserEvents::REGISTRATION_INITIALIZE, $event);
if (null !== $event->getResponse()) {
return $event->getResponse();
}
$form = $this->formFactory->createForm();
$form->setData($user);
$form->handleRequest($request);
if ($form->isSubmitted()) {
if ($form->isValid()) {
$event = new FormEvent($form, $request);
$this->eventDispatcher->dispatch(FOSUserEvents::REGISTRATION_SUCCESS, $event);
$this->userManager->updateUser($user);
if (null === $response = $event->getResponse()) {
$url = $this->generateUrl('fos_user_registration_confirmed');
$response = new RedirectResponse($url);
}
$this->eventDispatcher->dispatch(FOSUserEvents::REGISTRATION_COMPLETED, new FilterUserResponseEvent($user, $request, $response));
return $response;
}
$event = new FormEvent($form, $request);
$this->eventDispatcher->dispatch(FOSUserEvents::REGISTRATION_FAILURE, $event);
if (null !== $response = $event->getResponse()) {
return $response;
}
}
return $this->render('@FOSUser/Registration/register.html.twig', array(
'form' => $form->createView(),
));
}
}
<?php
namespace App\DQL
;
use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\Lexer;
class StrToDate extends FunctionNode
{
public $dateString = null;
public $dateFormat = null;
public function parse(\Doctrine\ORM\Query\Parser $parser)
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$this->dateString = $parser->ArithmeticPrimary();
$parser->match(Lexer::T_COMMA);
$this->dateFormat = $parser->ArithmeticPrimary();
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
}
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
{
return 'STR_TO_DATE(' .
$this->dateString->dispatch($sqlWalker) . ', ' .
$this->dateFormat->dispatch($sqlWalker) .
')';
}
}
<?php
namespace App\DataFixtures;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\Persistence\ObjectManager;
class AppFixtures extends Fixture
{
public function load(ObjectManager $manager)
{
// $manager->flush();
}
}
<?php
namespace AppBundle\DataFixtures\ORM;
use Hautelook\AliceBundle\Alice\DataFixtureLoader;
use Nelmio\Alice\Fixtures;
class AppFixtures extends DataFixtureLoader
{
/**
* {@inheritDoc}
*/
protected function getFixtures()
{
return array(
__DIR__ . '/user.yaml',
);
}
}
App\Entity\User:
user{1..30}:
username: <userName()>
email: <email()>
plainPassword: 'test'
enabled: true
App\Entity\Prestataire:
prestataire{1..5}:
raison: <text(10)>
metier: <text(10)>
iban: <randomNumber(20)>
statut: <text(10)>
siret: <randomNumber(10)>
user: '@user<current()>'
typeprestataire: 'prestataire'
App\Entity\Prestataire:
prestataire{1..5}:
raison: <text(10)>
metier: <text(10)>
iban: <randomNumber(20)>
statut: <text(10)>
siret: <randomNumber(10)>
user: '@user<current()>'
typeprestataire: 'partenaire'
App\Entity\Comptoir:
comptoir{1..15}:
name: <text(10)>
user: '@user<current()>'
App\Entity\Groupe:
groupe{1..3}:
__construct: [<text(10)>]
users: '10x @user*'
gestionnaires: '2x @user*'
redacteurs: '2x @user*'
tresoriers: '1x @user*'
contacts: '2x @user*'
prestataires: '5x @prestataire*'
comptoirs: '5x @comptoir*'
\ No newline at end of file
<?php
namespace App\Entity;
use App\Entity\User;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\AdherentRepository")
*/
class Adherent
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="decimal", precision=7, scale=2)
*/
private $ecompte;
/**
* @var User
*
* @ORM\OneToOne(targetEntity="User", cascade={"persist"}, inversedBy="adherent")
*/
protected $user;
public function getId(): ?int
{
return $this->id;
}
public function getEcompte()
{
return $this->ecompte;
}
public function setEcompte($ecompte): self
{
$this->ecompte = $ecompte;
return $this;
}
/**
* @return User
*/
public function getUser(): User
{
return $this->user;
}
/**
* @param User $user
* @return Prestataire
*/
public function setUser(User $user): self
{
$this->user = $user;
return $this;
}
}
<?php
namespace App\Entity;
use App\Entity\EntityTrait\NameSlugContentEntityTrait;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\HasLifecycleCallbacks()
* @ORM\Table(name="charte")
*/
class Charte
{
use NameSlugContentEntityTrait;
const UPLOAD_DIR = "charte";
/**
* @var int
*
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue
*/
protected $id;
/**
* @var null|Image
*
* @Assert\Valid()
* @ORM\OneToOne(targetEntity="Image", cascade={"all"}, orphanRemoval=true, fetch="EAGER")
*/
private $image;
/**
* @var null|Fichier
*
* @Assert\Valid()
* @ORM\OneToOne(targetEntity="Fichier", cascade={"all"}, orphanRemoval=true, fetch="EAGER")
*/
protected $fichier;
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* @return Image|null
*/
public function getImage(): ?Image
{
return $this->image;
}
/**
* @param Image|null $image
* @return Charte
*/
public function setImage(?Image $image)
{
$image->setType(self::UPLOAD_DIR);
$this->image = $image;
return $this;
}
/**
* @return Fichier|null
*/
public function getFichier(): ?Fichier
{
return $this->fichier;
}
/**
* @param Fichier|null $fichier
* @return Charte
*/
public function setFichier(?Fichier $fichier)
{
$fichier->setType(self::UPLOAD_DIR);
$this->fichier = $fichier;
return $this;
}
}
<?php
namespace App\Entity;
use App\Entity\EntityTrait\ContactEmailTelTrait;
use App\Entity\EntityTrait\EnablableEntityTrait;
use App\Entity\EntityTrait\GeolocEntityTrait;
use App\Entity\EntityTrait\HasCompteEntity;
use App\Entity\EntityTrait\NameSlugContentEntityTrait;
use App\Entity\Groupe;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\HasLifecycleCallbacks()
* @ORM\Table(name="comptoir")
*/
class Comptoir
{
use NameSlugContentEntityTrait,
TimestampableEntity,
EnablableEntityTrait,
GeolocEntityTrait,
ContactEmailTelTrait,
HasCompteEntity;
const UPLOAD_DIR = "comptoir";
/**
* @var int
*
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue
*/
protected $id;
/**
* @var null|Fichier
*
* @Assert\Valid()
* @ORM\OneToOne(targetEntity="Fichier", cascade={"all"}, orphanRemoval=true, fetch="EAGER")
*/
protected $fichier;
/**
* @var Groupe $comptoirGroup
*
* @ORM\ManyToOne(targetEntity="Groupe", inversedBy="comptoirs")
*/
private $groupe;
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* @return User
*/
public function getUser(): User
{
return $this->user;
}
/**
* @param User $user
* @return Comptoir
*/
public function setUser(User $user)
{
$this->user = $user;
return $this;
}
/**
* @return Fichier
*/
public function getFichier(): ?Fichier
{
return $this->fichier;
}
/**
* @param Fichier $fichier
* @return Comptoir
*/
public function setFichier(?Fichier $fichier)
{
$fichier->setType(self::UPLOAD_DIR);
$this->fichier = $fichier;
return $this;
}
/**
* @param null|Groupe $groupes
* @return $this
*/
public function setGroupe(?Groupe $groupe)
{
$this->groupe = $groupe;
return $this;
}
/**
* @return null|Groupe
*/
public function getGroupe(): ?Groupe
{
return $this->groupe;
}
}
<?php
namespace App\Entity;
use App\Entity\User;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\Table(name="cotisation")
*/
class Cotisation
{
use TimestampableEntity;
/**
* @var int
*
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue
*/
protected $id;
/**
* @var string
*
* @ORM\Column(name="type", type="string", length=12)
*/
private $type;
/**
* @var int
*
* @ORM\Column(name="annee", type="integer", length=4)
*/
private $annee;
/**
* @var \DateTime
*
* @ORM\Column(name="debut", type="date")
*/
private $debut;
/**
* @var \DateTime
*
* @ORM\Column(name="fin", type="date")
*/
private $fin;
/**
* @var float
*
* @ORM\Column(name="montant", type="decimal", precision=6, scale=2)
*/
private $montant;
/**
* @var string
*
* @ORM\Column(name="moyen", type="string", length=20)
*/
private $moyen;
/**
* @var bool
*
* @ORM\Column(name="recu", type="boolean", nullable=false)
*/
private $recu;
/**
* @var User
*
* @ORM\ManyToOne(targetEntity="User", inversedBy="cotisations")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
*/
private $user;
/**
* @return mixed
*/
public function getId(): int
{
return $this->id;
}
/**
* @return User
*/
public function getUser(): User
{
return $this->user;
}
/**
* @param User $user
* @return $this
*/
public function setUser(User $user)
{
$this->user = $user;
return $this;
}
/**
* @return string
*/
public function getType(): string
{
return $this->type;
}
/**
* @param string $type
* @return Cotisation
*/
public function setType(string $type)
{
$this->type = $type;
return $this;
}
/**
* @return int
*/
public function getAnnee(): int
{
return $this->annee;
}
/**
* @param int $annee
* @return Cotisation
*/
public function setAnnee(int $annee)
{
$this->annee = $annee;
return $this;
}
/**
* @return \DateTime
*/
public function getDebut(): \DateTime
{
return $this->debut;
}
/**
* @param \DateTime $debut
* @return Cotisation
*/
public function setDebut(\DateTime $debut)
{
$this->debut = $debut;
return $this;
}
/**
* @return \DateTime
*/
public function getFin(): \DateTime
{
return $this->fin;
}
/**
* @param \DateTime $fin
* @return Cotisation
*/
public function setFin(\DateTime $fin)
{
$this->fin = $fin;
return $this;
}
/**
* @return float
*/
public function getMontant(): float
{
return $this->montant;
}
/**
* @param float $montant
* @return Cotisation
*/
public function setMontant(float $montant)
{
$this->montant = $montant;
return $this;
}
/**
* @return string
*/
public function getMoyen(): string
{
return $this->moyen;
}
/**
* @param string $moyen
* @return Cotisation
*/
public function setMoyen(string $moyen)
{
$this->moyen = $moyen;
return $this;
}
/**
* @return bool
*/
public function isRecu(): bool
{
return $this->recu;
}
/**
* @param bool $recu
* @return Cotisation
*/
public function setRecu(bool $recu)
{
$this->recu = $recu;
return $this;
}
}
<?php
namespace App\Entity;
use App\Entity\EntityTrait\EnablableEntityTrait;
use App\Entity\EntityTrait\NameSlugContentEntityTrait;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\HasLifecycleCallbacks()
* @ORM\Table(name="document")
*/
class Document
{
use EnablableEntityTrait,
TimestampableEntity,
NameSlugContentEntityTrait;
const UPLOAD_DIR = "document";
/**
* @var int
*
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @var null|Fichier
*
* @Assert\Valid()
* @ORM\OneToOne(targetEntity="Fichier", cascade={"all"}, orphanRemoval=true, fetch="EAGER")
*/
protected $fichier;
/**
* @var User
*
* @ORM\ManyToOne(targetEntity="User", inversedBy="documents", cascade={"persist"})
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=true)
*/
private $user;
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* @return null|User
*/
public function getUser(): ?User
{
return $this->user;
}
/**
* @param null|User $user
* @return $this
*/
public function setUser(?User $user)
{
$this->user = $user;
return $this;
}
/**
* @return Fichier|null
*/
public function getFichier(): ?Fichier
{
return $this->fichier;
}
/**
* @param Fichier|null $fichier
* @return Document
*/
public function setFichier(?Fichier $fichier)
{
$fichier->setType(self::UPLOAD_DIR);
$this->fichier = $fichier;
return $this;
}
}
<?php
namespace App\Entity\EntityTrait;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
trait ContactEmailTelTrait
{
/**
* @var null|string
*
* @ORM\Column(name="tel", type="string", length=20, nullable=true)
*/
protected $tel;
/**
* @var null|string
*
* @ORM\Column(name="email", type="string", length=100, nullable=true)
*/
protected $email;
public function getTel(): ?string
{
return $this->tel;
}
public function setTel(?string $tel)
{
$this->tel = $tel;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(?string $email)
{
$this->email = $email;
return $this;
}
}
\ No newline at end of file
<?php
namespace App\Traits;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
trait DeleteableEntityTrait
{
/**
* @var \DateTime $deletedAt
*
* @ORM\Column(name="deletedAt", type="datetime", nullable=true)
*/
private $deletedAt;
/**
* Get deletedAt
* @return DateTime
*/
public function getDeletedAt()
{
return $this->deletedAt;
}
/**
* Set deletedAt
* @return $this
*/
public function setDeletedAt($deletedAt)
{
$this->deletedAt = $deletedAt;
return $this;
}
}
<?php
namespace App\Entity\EntityTrait;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
trait EnablableEntityTrait
{
/**
* @var boolean
* @Assert\Type("bool")
* @ORM\Column(type="boolean")
*/
protected $enabled = true;
public function isEnabled(): bool
{
return $this->enabled;
}
public function setEnabled(bool $enabled)
{
$this->enabled = $enabled;
return $this;
}
}
\ No newline at end of file
<?php
namespace App\Entity\EntityTrait;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Validator\Constraints as Assert;
trait FileEntityTrait
{
/**
* @var null|File|UploadedFile
*/
protected $file;
/**
* @var null|string
*/
protected $oldPath = null;
/**
* @var null|int
*
* @ORM\Column(type="integer", length=255, nullable=true)
*/
protected $size;
/**
* @var null|string
*
* @ORM\Column(type="string", length=10, nullable=true)
*/
protected $extension;
/**
* @var null|string
*
* @ORM\Column(type="string", length=255, nullable=true)
*/
protected $type;
/**
* @var null|string
*
* @ORM\Column(name="file", type="string", length=255, nullable=true)
*/
protected $path = null;
/**
* @param File|null $file
* @return $this
*/
public function setFile(File $file = null)
{
$this->file = $file;
return $this;
}
/**
* @return null|File|UploadedFile
*/
public function getFile(): ?File
{
return $this->file;
}
/**
* @return null|string
*/
public function getOldPath(): ?string
{
return $this->oldPath;
}
/**
* @param null|string $oldPath
* @return $this
*/
public function setOldPath(?string $oldPath)
{
$this->oldPath = $oldPath;
return $this;
}
/**
* @return int|null
*/
public function getSize(): ?int
{
return $this->size;
}
/**
* @param int|null $size
* @return $this
*/
public function setSize(?int $size)
{
$this->size = $size;
return $this;
}
/**
* @return null|string
*/
public function getExtension(): ?string
{
return $this->extension;
}
/**
* @param null|string $extension
* @return $this
*/
public function setExtension(?string $extension)
{
$this->extension = $extension;
return $this;
}
/**
* @return null|string
*/
public function getType(): ?string
{
return $this->type;
}
/**
* @param null|string $type
* @return $this
*/
public function setType(?string $type)
{
$this->type = $type;
return $this;
}
/**
* @return null|string
*/
public function getPath(): ?string
{
return $this->path;
}
/**
* @param null|string $path
* @return $this
*/
public function setPath(?string $path)
{
$this->path = $path;
return $this;
}
public function getAbsolutePath()
{
return null === $this->getPath()
? null
: $this->getUploadRootDir().'/'.$this->getPath();
}
public function getWebPath()
{
return null === $this->getPath()
? null
: $this->getUploadDir().'/'.$this->getPath();
}
public function getUploadRootDir()
{
return __DIR__.'/../../../../web/'.$this->getUploadDir();
}
public function getUploadDir()
{
return 'uploads/'.strtolower($this->getType());
}
/**
* Au chargement de l'entité génération d'un objet File stocker dans la proprieté file
* @ORM\PostLoad()
*/
public function postLoadFile()
{
if($this->getPath() != null) {
try {
$this->setFile(new File($this->getAbsolutePath()));
} catch (\Exception $e){
}
}
}
/**
* A la modification ou création de l'entité je vérifie qu'il y a un UploadedFile dans la proprieté file
* @ORM\PreFlush()
*/
public function upload()
{
if (null === $this->getFile() || !$this->getFile() instanceof UploadedFile) {
return;
}
$file_name = date('m-d-Y_his') . '-' . $this->getFile()->getClientOriginalName();
if($this->getPath() != null) {
$this->setOldPath($this->getPath());
}
$this->setPath($file_name);
$this->setSize($this->getFile()->getSize());
$this->setExtension($this->getFile()->getClientOriginalExtension());
$fs = new Filesystem();
if (!$fs->exists($this->getUploadRootDir())) {
$fs->mkdir($this->getUploadRootDir(), 0775);
}
$this->file->move(
$this->getUploadRootDir(), $this->getPath()
);
}
/**
* Après la création ou la modification de l'entité, si le fichier à été remplacé je supprime l'ancien
* @ORM\PostPersist()
* @ORM\PostUpdate()
*/
public function cleanOldFile()
{
if($this->getOldPath() !== null) {
$fs = new Filesystem();
try {
$fs->remove($this->getUploadRootDir().'/'. $this->getOldPath());
} catch(\Exception $exception) {
}
}
}
}
\ No newline at end of file
<?php
namespace App\Entity\EntityTrait;
use App\Entity\Geoloc;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
trait GeolocEntityTrait
{
/**
* @var Geoloc
*
* @ORM\OneToOne(targetEntity="Geoloc", cascade={"persist"}, orphanRemoval=true)
*/
private $geoloc;
public function getGeoloc(): Geoloc
{
return $this->geoloc;
}
public function setGeoloc(Geoloc $geoloc)
{
$this->geoloc = $geoloc;
return $this;
}
}
\ No newline at end of file
<?php
namespace App\Entity\EntityTrait;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
trait HasCompteEntity
{
/**
* @var int
*
* @ORM\Column(name="compte", type="decimal", precision=7, scale=2)
*/
private $compte = 0;
/**
* @return int
*/
public function getCompte(): float
{
return $this->compte;
}
/**
* @param int $compte
* @return $this
*/
public function setCompte(float $compte)
{
$this->compte = $compte;
return $this;
}
}
<?php
namespace App\Entity\EntityTrait;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
trait NameSlugContentEntityTrait
{
/**
* @var string|null
*
* @ORM\Column(length=150)
* @Assert\NotBlank
* @Assert\Length(max=150)
*/
protected $name;
/**
* @var string|null
*
* @Gedmo\Slug(fields={"name"})
* @ORM\Column(length=150, unique=true)
*/
protected $slug;
/**
* @var string|null
*
* @ORM\Column(type="text", nullable=true)
*/
private $content;
public function getContent(): ?string
{
return $this->content;
}
public function setDescription(?string $content)
{
$this->setContent($content);
return $this;
}
public function getDescription(): ?string
{
return $this->getContent();
}
public function setContent(?string $content)
{
$this->content = $content;
return $this;
}
public function __toString(): string
{
return $this->name;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name)
{
$this->name = $name;
return $this;
}
public function getTitle(): ?string
{
return $this->getName();
}
public function setTitle(?string $name)
{
$this->setName($name);
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(?string $slug)
{
$this->slug = $slug;
return $this;
}
}
\ No newline at end of file
<?php
namespace App\Entity\EntityTrait;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Validator\Constraints as Assert;
trait OldFileEntityTrait
{
/**
* @var null|File|UploadedFile
*/
protected $file;
/**
* @var null|string
*/
protected $oldPath = null;
/**
* @var null|int
*
* @ORM\Column(type="integer", length=255, nullable=true)
*/
protected $size;
/**
* @var null|string
*
* @ORM\Column(type="string", length=10, nullable=true)
*/
protected $extension;
/**
* @var null|string
*
* @ORM\Column(type="string", length=255, nullable=true)
*/
protected $type;
/**
* @var null|string
*
* @ORM\Column(name="file", type="string", length=255, nullable=true)
*/
protected $path = null;
/**
* @param File|null $file
* @return $this
*/
public function setFile(File $file = null)
{
$this->file = $file;
return $this;
}
/**
* @return null|File|UploadedFile
*/
public function getFile(): ?File
{
return $this->file;
}
/**
* @return null|string
*/
public function getOldPath(): ?string
{
return $this->oldPath;
}
/**
* @param null|string $oldPath
* @return $this
*/
public function setOldPath(?string $oldPath)
{
$this->oldPath = $oldPath;
return $this;
}
/**
* @return int|null
*/
public function getSize(): ?int
{
return $this->size;
}
/**
* @param int|null $size
* @return $this
*/
public function setSize(?int $size)
{
$this->size = $size;
return $this;
}
/**
* @return null|string
*/
public function getExtension(): ?string
{
return $this->extension;
}
/**
* @param null|string $extension
* @return $this
*/
public function setExtension(?string $extension)
{
$this->extension = $extension;
return $this;
}
/**
* @return null|string
*/
public function getType(): ?string
{
return $this->type;
}
/**
* @param null|string $type
* @return $this
*/
public function setType(?string $type)
{
$this->type = $type;
return $this;
}
/**
* @return null|string
*/
public function getPath(): ?string
{
return $this->path;
}
/**
* @param null|string $path
* @return $this
*/
public function setPath(?string $path)
{
$this->path = $path;
return $this;
}
public function getAbsolutePath()
{
return null === $this->getPath()
? null
: $this->getUploadRootDir().'/'.$this->getPath();
}
public function getWebPath()
{
return null === $this->getPath()
? null
: $this->getUploadDir().'/'.$this->getPath();
}
public function getUploadRootDir()
{
return __DIR__.'/../../../../web/'.$this->getUploadDir();
}
public function getUploadDir()
{
return 'uploads/'.strtolower($this->getType());
}
/**
* Au chargement de l'entité génération d'un objet File stocker dans la proprieté file
* @ORM\PostLoad()
*/
public function postLoadFile()
{
if($this->getPath() != null) {
try {
$this->setFile(new File($this->getAbsolutePath()));
} catch (\Exception $e){
}
}
}
/**
* A la modification ou création de l'entité je vérifie qu'il y a un UploadedFile dans la proprieté file
* @ORM\PreFlush()
*/
public function upload()
{
if (null === $this->getFile() || !$this->getFile() instanceof UploadedFile) {
return;
}
$file_name = date('m-d-Y_his') . '-' . $this->getFile()->getClientOriginalName();
if($this->getPath() != null) {
$this->setOldPath($this->getPath());
}
$this->setPath($file_name);
$this->setSize($this->getFile()->getSize());
$this->setExtension($this->getFile()->getClientOriginalExtension());
$fs = new Filesystem();
if (!$fs->exists($this->getUploadRootDir())) {
$fs->mkdir($this->getUploadRootDir(), 0775);
}
$this->file->move(
$this->getUploadRootDir(), $this->getPath()
);
}
/**
* Après la création ou la modification de l'entité, si le fichier à été remplacé je supprime l'ancien
* @ORM\PostPersist()
* @ORM\PostUpdate()
*/
public function cleanOldFile()
{
if($this->getOldPath() !== null) {
$fs = new Filesystem();
try {
$fs->remove($this->getUploadRootDir().'/'. $this->getOldPath());
} catch(\Exception $exception) {
}
}
}
}
\ No newline at end of file
<?php
namespace App\Entity\EntityTrait;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
trait SoftDeletableEntityTrait
{
/**
* @var \DateTime|null
*
* @ORM\Column(type="datetime", nullable=true)
* @Assert\DateTime()
*/
private $deletedAt;
/**
* @param \DateTime|null $deletedAt
*
* @return $this
*/
public function setDeletedAt(?\DateTime $deletedAt = null)
{
$this->deletedAt = $deletedAt;
return $this;
}
public function getDeletedAt(): ?\DateTime
{
return $this->deletedAt;
}
public function isDeleted(): bool
{
return null !== $this->deletedAt;
}
}
<?php
namespace App\Entity;
use App\Entity\EntityTrait\EnablableEntityTrait;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\HasLifecycleCallbacks()
* @ORM\Table(name="faq")
*/
class Faq
{
use TimestampableEntity,
EnablableEntityTrait;
const UPLOAD_DIR = "faq";
/**
* @var int
*
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @var null|Fichier
*
* @Assert\Valid()
* @ORM\OneToOne(targetEntity="Fichier", cascade={"all"}, orphanRemoval=true, fetch="EAGER")
*/
protected $fichier;
/**
* @var null|User
*
* @ORM\ManyToOne(targetEntity="User", inversedBy="faqs", cascade={"persist"})
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=true)
*/
private $user;
/**
* @return mixed
*/
public function getId(): int
{
return $this->id;
}
/**
* @return null|User
*/
public function getUser(): ?User
{
return $this->user;
}
/**
* @param null|User $user
* @return $this
*/
public function setUser(?User $user)
{
$this->user = $user;
return $this;
}
/**
* @return Fichier|null
*/
public function getFichier(): ?Fichier
{
return $this->fichier;
}
/**
* @param Fichier|null $fichier
* @return Faq
*/
public function setFichier(?Fichier $fichier)
{
$this->fichier = $fichier;
return $this;
}
}
<?php
namespace App\Entity;
use App\Entity\EntityTrait\EnablableEntityTrait;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\Validator\Constraints as Assert;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* @ORM\Entity
* @ORM\InheritanceType("SINGLE_TABLE")
* @ORM\DiscriminatorColumn(name="discr", type="string")
* @ORM\DiscriminatorMap({"fichier" = "Fichier", "image" = "Image"})
* @Vich\Uploadable
* @ORM\HasLifecycleCallbacks()
* @ORM\Table(name="fichier")
*/
class Fichier
{
use EnablableEntityTrait;
/**
* @var int
*
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @Vich\UploadableField(mapping="balls", fileNameProperty="path")
* @Assert\File(maxSize="2M", mimeTypes={"image/png"})
*/
protected $file;
/**
* @var string
*
* @ORM\Column(name="path", type="text", nullable=true)
*/
private $path;
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* If manually uploading a file (i.e. not using Symfony Form) ensure an instance
* of 'UploadedFile' is injected into this setter to trigger the update. If this
* bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
* must be able to accept an instance of 'File' as the bundle will inject one here
* during Doctrine hydration.
*
* @param File|\Symfony\Component\HttpFoundation\File\UploadedFile $image
*/
public function setfile(File $image = null)
{
$this->file = $image;
if ($image) {
// It is required that at least one field changes if you are using doctrine
// otherwise the event listeners won't be called and the file is lost
$this->updated = new \DateTimeImmutable();
}
}
public function getFile()
{
return $this->file;
}
/**
* Set path
*
* @param string $path
* @return Photo
*/
public function setPath($path)
{
$this->path = $path;
return $this;
}
/**
* Get path
*
* @return string
*/
public function getPath()
{
return $this->path;
}
}
<?php
namespace App\Entity;
use App\Entity\EntityTrait\EnablableEntityTrait;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\Table(name="geoloc")
*/
class Geoloc
{
use EnablableEntityTrait;
/**
* @var int
*
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue
*/
protected $id;
/**
* @var null|string
*
* @ORM\Column(name="adresse", type="string", length=255, nullable=true)
*/
private $adresse;
/**
* @var null|int
*
* @ORM\Column(name="cpostal", type="integer", length=5, nullable=true)
*/
private $cpostal;
/**
* @var null|string
*
* @ORM\Column(name="ville", type="string", length=100, nullable=true)
*/
private $ville;
/**
* @var null|float
*
* @ORM\Column(name="lat", type="decimal", precision=10, scale=8, nullable=true)
*/
private $lat;
/**
* @var null|float
*
* @ORM\Column(name="lon", type="decimal", precision=10, scale=8, nullable=true)
*/
private $lon;
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* @return null|string
*/
public function getAdresse(): ?string
{
return $this->adresse;
}
/**
* @param null|string $adresse
* @return Geoloc
*/
public function setAdresse(?string $adresse)
{
$this->adresse = $adresse;
return $this;
}
/**
* @return int|null
*/
public function getCpostal(): ?int
{
return $this->cpostal;
}
/**
* @param int|null $cpostal
* @return Geoloc
*/
public function setCpostal(?int $cpostal)
{
$this->cpostal = $cpostal;
return $this;
}
/**
* @return null|string
*/
public function getVille(): ?string
{
return $this->ville;
}
/**
* @param null|string $ville
* @return Geoloc
*/
public function setVille(?string $ville)
{
$this->ville = $ville;
return $this;
}
/**
* @return float|null
*/
public function getLat(): ?float
{
return $this->lat;
}
/**
* @param float|null $lat
* @return Geoloc
*/
public function setLat(?float $lat)
{
$this->lat = $lat;
return $this;
}
/**
* @return float|null
*/
public function getLon(): ?float
{
return $this->lon;
}
/**
* @param float|null $lon
* @return Geoloc
*/
public function setLon(?float $lon)
{
$this->lon = $lon;
return $this;
}
}
<?php
namespace App\Entity;
use App\Entity\Comptoir;
use App\Entity\EntityTrait\EnablableEntityTrait;
use App\Entity\EntityTrait\HasCompteEntity;
use App\Entity\EntityTrait\NameSlugContentEntityTrait;
use App\Entity\Siege;
use App\Entity\User;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\Table(name="groupe")
*/
class Groupe
{
use NameSlugContentEntityTrait,
EnablableEntityTrait;
/**
* @var int
*
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @var Siege
*
* @ORM\ManyToOne(targetEntity="Siege", inversedBy="groupes")
* @ORM\JoinColumn(name="siege_id", referencedColumnName="id", nullable=false)
*/
private $siege;
/**
* @var ArrayCollection|Comptoir[]
* @ORM\OneToMany(targetEntity="Comptoir", mappedBy="groupe", cascade={"persist"})
*/
private $comptoirs;
public function __construct()
{
$this->users = new ArrayCollection();
}
/**
* Get siege
* @return Siege
*/
public function getSiege()
{
return $this->siege;
}
/**
* Set siege
* @return $this
*/
public function setSiege($siege)
{
$this->siege = $siege;
return $this;
}
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* Set id
* @param string $id [description]
*/
public function setId(string $id): self
{
$this->id = $id;
return $this;
}
/**
* @return Comptoir[]|ArrayCollection
*/
public function getComptoirs()
{
return $this->comptoirs;
}
/**
* @param Comptoir $comptoir
* @return $this
*/
public function addComptoir(Comptoir $comptoir)
{
if (!$this->comptoirs->contains($comptoir)) {
$this->comptoirs[] = $comptoir;
$comptoir->setComptoirGroup($this);
}
return $this;
}
/**
* @param Comptoir $comptoir
* @return $this
*/
public function removeComptoir(Comptoir $comptoir)
{
if ($this->comptoirs->contains($comptoir)) {
$this->comptoirs->removeElement($comptoir);
$comptoir->setComptoirGroup(null);
}
return $this;
}
}
<?php
/**
* AMAP class
*
* @package Default
* @author
**/
namespace App\Entity;
use App\Entity\EntityTrait\ContactEmailTelTrait;
use App\Entity\EntityTrait\EnablableEntityTrait;
use App\Entity\EntityTrait\GeolocEntityTrait;
use App\Entity\EntityTrait\NameSlugContentEntityTrait;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\Table(name="groupeprestaire")
*/
class Groupeprestataire
{
use NameSlugContentEntityTrait,
TimestampableEntity,
GeolocEntityTrait,
ContactEmailTelTrait,
EnablableEntityTrait;
/**
* @var int
*
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @var null|string (amap, marche, ...)
*
* @ORM\Column(name="type", type="string", length=20, nullable=false)
*/
protected $type;
/**
* @var ArrayCollection|Prestataire[]
*
* @ORM\ManyToMany(targetEntity="Prestataire", inversedBy="groupeprestataires", cascade={"persist"}, fetch="EXTRA_LAZY")
*/
protected $prestataires;
/**
* @var null|string (champ libre)
*
* @ORM\Column(name="horaires", type="string", length=200, nullable=true)
*/
private $horaires;
public function __construct()
{
$this->prestataires = new ArrayCollection();
}
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* Get type
* @return string type
*/
public function getType(): ?string
{
return $this->type;
}
/**
* Set type
* @return $this
*/
public function setType($type): self
{
$this->type = $type;
return $this;
}
/**
* @return Prestataire[]|ArrayCollection
*/
public function getPrestataires()
{
return $this->prestataires;
}
/**
* @param Prestataire $prestataire
* @return $this
*/
public function addPrestataire(Prestataire $prestataire): self
{
if (!$this->prestataires->contains($prestataire)) {
$this->prestataires[] = $prestataire;
$prestataire->addGroupeprestataire($this);
}
return $this;
}
/**
* @param Prestataire $prestataire
* @return $this
*/
public function removePrestataire(Prestataire $prestataire): self
{
if ($this->prestataires->contains($prestataire)) {
$this->prestataires->removeElement($prestataire);
$prestataire->removeGroupeprestataire($this);
}
return $this;
}
/**
* Get horaires
* @return string Horaires
*/
public function getHoraires(): ?string
{
return $this->horaires;
}
/**
* Set horaires
* @return $this
*/
public function setHoraires($horaires): self
{
$this->horaires = $horaires;
return $this;
}
}
<?php
namespace App\Entity;
use App\Entity\EntityTrait\EnablableEntityTrait;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\HasLifecycleCallbacks()
*/
class Image extends Fichier
{
use EnablableEntityTrait;
/**
* @Assert\Image()
*/
protected $file;
/**
* @var null|int
*
* @ORM\Column(type="integer", nullable=true)
*/
protected $width;
/**
* @var null|int
*
* @ORM\Column(type="integer", nullable=true)
*/
protected $height;
/**
* @return int|null
*/
public function getWidth(): ?int
{
return $this->width;
}
/**
* @param int|null $width
* @return $this
*/
public function setWidth(?int $width)
{
$this->width = $width;
return $this;
}
/**
* @return int|null
*/
public function getHeight(): ?int
{
return $this->height;
}
/**
* @param int|null $height
* @return $this
*/
public function setHeight(?int $height)
{
$this->height = $height;
return $this;
}
/**
* @ORM\PreFlush()
*/
public function upload()
{
if ($this->getFile() != null) {
list($width, $height) = getimagesize($this->getAbsolutePath());
$this->setWidth($width)->setHeight($height);
}
parent::upload();
}
}
<?php
namespace App\Entity;
use App\Entity\EntityTrait\EnablableEntityTrait;
use App\Entity\EntityTrait\NameSlugContentEntityTrait;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\Table(name="lien")
*/
class Lien
{
use TimestampableEntity,
EnablableEntityTrait,
NameSlugContentEntityTrait;
/**
* @var int
*
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @var string
*
* @ORM\Column(name="url", type="string", length=255)
*/
private $url;
/**
* @var null|User
*
* @ORM\ManyToOne(targetEntity="User", inversedBy="liens")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=true)
*/
private $user;
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @return string
*/
public function getUrl(): string
{
return $this->url;
}
/**
* @param string $url
* @return Lien
*/
public function setUrl(string $url)
{
$this->url = $url;
return $this;
}
/**
* @param null|User $user
* @return $this
*/
public function setUser(?User $user)
{
$this->user = $user;
return $this;
}
/**
* @return null|User
*/
public function getUser(): ?User
{
return $this->user;
}
}
<?php
namespace App\Entity;
use App\Entity\EntityTrait\EnablableEntityTrait;
use App\Entity\EntityTrait\NameSlugContentEntityTrait;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\Table(name="message")
*/
class Message
{
use NameSlugContentEntityTrait,
EnablableEntityTrait,
TimestampableEntity;
/**
* @var int
*
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @var User
*
* @ORM\ManyToOne(targetEntity="User", inversedBy="messagesSend", cascade={"persist"})
*/
private $expediteur;
/**
* @var User
*
* @ORM\ManyToOne(targetEntity="User", inversedBy="messagesReceived", cascade={"persist"})
*/
private $destinataire;
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* @param User $destinataire
* @return $this
*/
public function setDestinataire(User $destinataire)
{
$this->destinataire = $destinataire;
return $this;
}
/**
* @return User
*/
public function getDestinataire(): User
{
return $this->destinataire;
}
/**
* @param User $expediteur
* @return $this
*/
public function setExpediteur(User $expediteur)
{
$this->expediteur = $expediteur;
return $this;
}
/**
* @return User
*/
public function getExpediteur(): User
{
return $this->expediteur;
}
}
<?php
namespace App\Entity;
use App\Entity\EntityTrait\EnablableEntityTrait;
use App\Entity\EntityTrait\NameSlugContentEntityTrait;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\HasLifecycleCallbacks()
* @ORM\Table(name="news")
*/
class News
{
use TimestampableEntity,
NameSlugContentEntityTrait,
EnablableEntityTrait;
const UPLOAD_DIR = "news";
/**
* @var int
*
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @var null|Fichier
*
* @Assert\Valid()
* @ORM\OneToOne(targetEntity="Fichier", cascade={"all"}, orphanRemoval=true, fetch="EAGER")
*/
protected $fichier;
/**
* @var User
*
* @ORM\ManyToOne(targetEntity="User", inversedBy="news")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
*/
private $user;
/**
* @var bool
*
* @ORM\Column(type="boolean", name="visible_by_all_groups")
*/
private $visibleByAllGroups = true;
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* @param User $user
* @return $this
*/
public function setuser(User $user)
{
$this->user = $user;
return $this;
}
/**
* @return User
*/
public function getuser(): User
{
return $this->user;
}
/**
* @return Fichier|null
*/
public function getFichier(): ?Fichier
{
return $this->fichier;
}
/**
* @param Fichier|null $fichier
* @return News
*/
public function setFichier(?Fichier $fichier)
{
$fichier->setType(self::UPLOAD_DIR);
$this->fichier = $fichier;
return $this;
}
/**
* @return bool
*/
public function isVisibleByAllGroups(): bool
{
return $this->visibleByAllGroups;
}
/**
* @param bool $visibleByAllGroups
* @return News
*/
public function setVisibleByAllGroups(bool $visibleByAllGroups)
{
$this->visibleByAllGroups = $visibleByAllGroups;
return $this;
}
}
<?php
namespace App\Entity;
use App\Entity\User;
use App\Entity\EntityTrait\EnablableEntityTrait;
use App\Entity\EntityTrait\NameSlugContentEntityTrait;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\Table(name="page")
*/
class Page
{
use NameSlugContentEntityTrait,
TimestampableEntity,
EnablableEntityTrait;
/**
* @var int
*
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue
*/
protected $id;
/**
* @var null|string
*
* @ORM\Column(name="js", type="text", nullable=true)
*/
private $js;
/**
* @var null|string
*
* @ORM\Column(name="css", type="text", nullable=true)
*/
private $css;
/**
* @var null|string
*
* @ORM\Column(name="description", type="string", length=255, nullable=true)
*/
private $metaDescription;
/**
* @var null|string
*
* @ORM\Column(name="tag", type="string", length=255, nullable=true)
*/
private $metaTags;
/**
* @var null|string
*
* @ORM\Column(name="template", type="string", length=255, nullable=true)
*/
private $template;
/**
* @var User
*
* @ORM\ManyToOne(targetEntity="User", cascade={"persist"}, inversedBy="pages")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
*/
private $user;
/**
* @return null|string
*/
public function getJs(): ?string
{
return $this->js;
}
/**
* @param null|string $js
* @return Page
*/
public function setJs(?string $js)
{
$this->js = $js;
return $this;
}
/**
* @return null|string
*/
public function getCss(): ?string
{
return $this->css;
}
/**
* @param null|string $css
* @return Page
*/
public function setCss(?string $css)
{
$this->css = $css;
return $this;
}
/**
* @return null|string
*/
public function getMetaDescription(): ?string
{
return $this->metaDescription;
}
/**
* @param null|string $metaDescription
* @return Page
*/
public function setMetaDescription(?string $metaDescription)
{
$this->metaDescription = $metaDescription;
return $this;
}
/**
* @return null|string
*/
public function getMetaTags(): ?string
{
return $this->metaTags;
}
/**
* @param null|string $metaTags
* @return Page
*/
public function setMetaTags(?string $metaTags)
{
$this->metaTags = $metaTags;
return $this;
}
/**
* @return null|string
*/
public function getTemplate(): ?string
{
return $this->template;
}
/**
* @param null|string $template
* @return Page
*/
public function setTemplate(?string $template)
{
$this->template = $template;
return $this;
}
/**
* @return User
*/
public function getUser(): User
{
return $this->user;
}
/**
* @param User $user
* @return Page
*/
public function setUser(User $user)
{
$this->user = $user;
return $this;
}
}
<?php
namespace App\Entity;
use App\Entity\EntityTrait\EnablableEntityTrait;
use App\Entity\EntityTrait\GeolocEntityTrait;
use App\Entity\EntityTrait\HasCompteEntity;
use App\Entity\Image;
use App\Entity\User;
use App\Entity\TypePrestataire;
use App\Entity\Groupeprestataire;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\Table(name="prestataire")
*/
class Prestataire
{
use EnablableEntityTrait,
GeolocEntityTrait,
HasCompteEntity;
const UPLOAD_DIR = "prestataire";
/**
* @var int
*
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue
*/
protected $id;
/**
* @var string
*
* @ORM\Column(name="raison", type="string", length=100)
*/
private $raison;
/**
* @var string
*
* @ORM\Column(name="metier", type="string", length=100)
*/
private $metier;
/**
* @var null|string
*
* @ORM\Column(name="statut", type="string", length=50, nullable=true)
*/
private $statut;
/**
* @var null|string
*
* @ORM\Column(name="responsable", type="string", length=200, nullable=true)
*/
private $responsable;
/**
* @var string
*
* @ORM\Column(name="iban", type="string", length=100)
*/
private $iban;
/**
* @var string
*
* @ORM\Column(name="siret", type="string", length=50)
*/
private $siret;
/**
* @var null|string
*
* @ORM\Column(name="web", type="string", length=255, nullable=true)
*/
private $web;
/**
* @var bool
*
* @ORM\Column(name="accept", type="boolean", nullable=false)
*/
private $accept = false;
/**
* @var TypePrestataire
*
* @ORM\ManyToOne(targetEntity="TypePrestataire", cascade={"persist"}, inversedBy="prestataires")
*/
private $typeprestataire;
/**
* @var null|Image
*
* @Assert\Valid()
* @ORM\OneToOne(targetEntity="Image", cascade={"all"}, orphanRemoval=true, fetch="EAGER")
*/
private $image;
/**
* @var User
*
* @ORM\OneToOne(targetEntity="User", cascade={"persist"}, inversedBy="prestataire")
*/
protected $user;
/**
* @var Groupe $prestataireGroup
*
* @ORM\ManyToOne(targetEntity="Groupe", inversedBy="prestataires")
*/
private $prestataireGroup;
/**
* @var ArrayCollection|Amap[]
* @ORM\ManyToMany(targetEntity="Groupeprestataire", mappedBy="prestataires", cascade={"persist"}, fetch="EXTRA_LAZY")
* @ORM\JoinTable(name="amap_prestataire")
*/
private $groupeprestataires;
public function __construct()
{
$this->users = new ArrayCollection();
$this->groupeprestataires = new ArrayCollection();
}
/**
* @return mixed
*/
public function getId(): int
{
return $this->id;
}
/**
* @return string
*/
public function getRaison(): string
{
return $this->raison;
}
/**
* @param string $raison
* @return Prestataire
*/
public function setRaison(string $raison)
{
$this->raison = $raison;
return $this;
}
/**
* @return string
*/
public function getMetier(): string
{
return $this->metier;
}
/**
* @param string $metier
* @return Prestataire
*/
public function setMetier(string $metier)
{
$this->metier = $metier;
return $this;
}
/**
* @return null|string
*/
public function getStatut(): ?string
{
return $this->statut;
}
/**
* @param null|string $statut
* @return Prestataire
*/
public function setStatut(?string $statut)
{
$this->statut = $statut;
return $this;
}
/**
* @return null|string
*/
public function getResponsable(): ?string
{
return $this->responsable;
}
/**
* @param null|string $responsable
* @return Prestataire
*/
public function setResponsable(?string $responsable)
{
$this->responsable = $responsable;
return $this;
}
/**
* @return string
*/
public function getIban(): string
{
return $this->iban;
}
/**
* @param string $iban
* @return Prestataire
*/
public function setIban(string $iban)
{
$this->iban = $iban;
return $this;
}
/**
* @return string
*/
public function getSiret(): string
{
return $this->siret;
}
/**
* @param string $siret
* @return Prestataire
*/
public function setSiret(string $siret)
{
$this->siret = $siret;
return $this;
}
/**
* @return null|string
*/
public function getWeb(): ?string
{
return $this->web;
}
/**
* @param null|string $web
* @return Prestataire
*/
public function setWeb(?string $web)
{
$this->web = $web;
return $this;
}
/**
* @return bool
*/
public function isAccept(): bool
{
return $this->accept;
}
/**
* @param bool $accept
* @return Prestataire
*/
public function setAccept(bool $accept)
{
$this->accept = $accept;
return $this;
}
/**
* @return bool
*/
public function isPartenaire(): bool
{
return $this->partenaire;
}
/**
* @param bool $partenaire
* @return Prestataire
*/
public function setPartenaire(bool $partenaire)
{
$this->partenaire = $partenaire;
return $this;
}
/**
* @return Image|null
*/
public function getImage(): ?Image
{
return $this->image;
}
/**
* @param Image|null $image
* @return Prestataire
*/
public function setImage(?Image $image)
{
$image->setType(self::UPLOAD_DIR);
$this->image = $image;
return $this;
}
/**
* @return User
*/
public function getUser(): User
{
return $this->user;
}
/**
* @param User $user
* @return Prestataire
*/
public function setUser(User $user): self
{
$this->user = $user;
return $this;
}
/**
* @param null|Groupe $prestataireGroup
* @return $this
*/
public function setPrestataireGroup(?Groupe $prestataireGroup)
{
$this->prestataireGroup = $prestataireGroup;
return $this;
}
/**
* @return null|Groupe
*/
public function getPrestataireGroup(): ?Groupe
{
return $this->prestataireGroup;
}
/**
* Get typeprestataire
* @return
*/
public function getTypeprestataire()
{
return $this->typeprestataire;
}
/**
* Set typeprestataire
* @return $this
*/
public function setTypeprestataire($typeprestataire)
{
$this->typeprestataire = $typeprestataire;
return $this;
}
/**
* @return Amap[]|ArrayCollection
*/
public function getGroupeprestataires()
{
return $this->groupeprestataires;
}
/**
* @param Amap $amap
* @return $this
*/
public function addGroupeprestataire(Groupeprestataire $groupeprestataire)
{
if (!$this->groupeprestataires->contains($groupeprestataire)) {
$this->groupeprestataires[] = $groupeprestataire;
$groupeprestataire->addPrestataire($this);
}
return $this;
}
/**
* @param Amap $amap
* @return $this
*/
public function removeGroupeprestataire(Groupeprestataire $groupeprestataires)
{
if ($this->groupeprestataires->contains($groupeprestataire)) {
$this->groupeprestataires->removeElement($groupeprestataire);
$groupeprestataire->removePrestataire($this);
}
return $this;
}
}
<?php
namespace App\Entity;
use App\Entity\EntityTrait\EnablableEntityTrait;
use App\Entity\EntityTrait\NameSlugContentEntityTrait;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\Table(name="rubrique")
*/
class Rubrique
{
use NameSlugContentEntityTrait,
EnablableEntityTrait;
/**
* @var int
*
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue
*/
protected $id;
/**
* @var ArrayCollection|Prestataire[]
*
* @ORM\ManyToMany(targetEntity="Prestataire", inversedBy="rubriques", cascade={"persist"}, fetch="EXTRA_LAZY")
*/
private $prestataires;
/**
* @return mixed
*/
public function getId(): int
{
return $this->id;
}
/**
* @return Prestataire[]|ArrayCollection
*/
public function getPrestataires()
{
return $this->prestataires;
}
/**
* @param Prestataire $prestataire
* @return $this
*/
public function addPrestataire(Prestataire $prestataire)
{
if (!$this->prestataires->contains($prestataire)) {
$this->prestataires[] = $prestataire;
$prestataire->addRubrique($this);
}
return $this;
}
/**
* @param Prestataire $prestataire
* @return $this
*/
public function removePrestataire(Prestataire $prestataire)
{
if ($this->prestataires->contains($prestataire)) {
$this->prestataires->removeElement($prestataire);
$prestataire->removeRubrique($this);
}
return $this;
}
}
<?php
namespace App\Entity;
use App\Entity\EntityTrait\HasCompteEntity;
use App\Entity\EntityTrait\NameSlugContentEntityTrait;
use App\Entity\Groupe;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\Table(name="siege")
*/
class Siege
{
use NameSlugContentEntityTrait,
HasCompteEntity;
/**
* @var int
*
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @var ArrayCollection|Groupe[]
* @ORM\OneToMany(targetEntity="Groupe", mappedBy="siege", cascade={"persist"})
*/
private $groupes;
public function __construct()
{
$this->groupes = new ArrayCollection();
}
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* @return Groupe[]|ArrayCollection
*/
public function getGroupes()
{
return $this->groupes;
}
/**
* @param Groupe $groupe
* @return $this
*/
public function addGroupe(Groupe $groupe)
{
if (!$this->groupes->contains($groupe)) {
$this->groupes[] = $groupe;
$groupe->setSiege($this);
}
return $this;
}
/**
* @param Groupe $groupe
* @return $this
*/
public function removeGroupe(Groupe $groupe)
{
if ($this->groupes->contains($groupe)) {
$this->groupes->removeElement($groupe);
$groupe->setSiege(null);
}
return $this;
}
}
<?php
namespace App\Entity;
use App\Entity\EntityTrait\EnablableEntityTrait;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\Table(name="transaction")
*/
class Transaction
{
use TimestampableEntity,
EnablableEntityTrait;
/**
* @var int
*
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @var string
*
* @ORM\Column(name="type", type="string", length=3)
*/
private $type;
/**
* @var float
*
* @ORM\Column(name="montant", type="decimal", precision=7, scale=2)
*/
private $montant;
/**
* @var null|string
*
* @ORM\Column(name="titre", type="string", length=255, nullable=true)
*/
private $reference;
/**
* @var User
*
* @ORM\ManyToOne(targetEntity="User", inversedBy="transactionsSend", cascade={"persist"})
*/
private $expediteur;
/**
* @var User
*
* @ORM\ManyToOne(targetEntity="User", inversedBy="transactionsReceived", cascade={"persist"})
*/
private $destinataire;
/**
* @return mixed
*/
public function getId(): int
{
return $this->id;
}
/**
* @param User $destinataire
* @return $this
*/
public function setDestinataire(User $destinataire)
{
$this->destinataire = $destinataire;
return $this;
}
/**
* @return User
*/
public function getDestinataire(): User
{
return $this->destinataire;
}
/**
* @param User $expediteur
* @return $this
*/
public function setExpediteur(User $expediteur)
{
$this->expediteur = $expediteur;
return $this;
}
/**
* @return User
*/
public function getExpediteur(): User
{
return $this->expediteur;
}
/**
* @return string
*/
public function getType(): string
{
return $this->type;
}
/**
* @param string $type
* @return Transaction
*/
public function setType(string $type)
{
$this->type = $type;
return $this;
}
/**
* @return float
*/
public function getMontant(): float
{
return $this->montant;
}
/**
* @param float $montant
* @return Transaction
*/
public function setMontant(float $montant)
{
$this->montant = $montant;
return $this;
}
/**
* @return null|string
*/
public function getReference(): ?string
{
return $this->reference;
}
/**
* @param null|string $reference
* @return Transaction
*/
public function setReference(?string $reference)
{
$this->reference = $reference;
return $this;
}
}
<?php
namespace App\Entity;
use App\Entity\EntityTrait\EnablableEntityTrait;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use Symfony\Component\Validator\Constraints as Assert;
/**
* QUESTION
* @ORM\Entity
* @ORM\Table(name="transfert")
*/
class Transfert
{
use TimestampableEntity, EnablableEntityTrait;
/**
* @var int
*
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @var string
*
* @ORM\Column(name="operateur", type="string", length=20)
*/
private $operateur;
/**
* @var string
*
* @ORM\Column(name="type", type="string", length=3)
*/
private $type;
/**
* @var string
* QUESTION
* @ORM\Column(name="expediteur", type="string", length=100)
*/
private $expediteur;
/**
* @var string
* QUESTION
* @ORM\Column(name="destinataire", type="string", length=100)
*/
private $destinataire;
/**
* @var float
*
* @ORM\Column(name="montant", type="decimal", precision=7, scale=2)
*/
private $montant;
/**
* @var null|string
*
* @ORM\Column(name="reference", type="string", length=255, nullable=true)
*/
private $reference;
}
<?php
namespace App\Entity;
use App\Entity\EntityTrait\NameSlugContentEntityTrait;
use App\Entity\EntityTrait\EnablableEntityTrait;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use App\Entity\Prestataire;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Entity
* @ORM\Table(name="typepresta")
*/
class TypePrestataire
{
use NameSlugContentEntityTrait,
TimestampableEntity,
EnablableEntityTrait;
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @var ArrayCollection|Prestataire[]
* @ORM\OneToMany(targetEntity="Prestataire", mappedBy="typeprestataire")
*/
private $prestataires;
public function getId(): ?int
{
return $this->id;
}
}
<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Event\LifecycleEventArgs;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Sonata\UserBundle\Entity\BaseUser as BaseUser;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass="App\Repository\UserRepository")
* @ORM\Table(name="user")
* @UniqueEntity(
* fields={"firstname", "lastname", "email"},
* errorPath="lastname",
* message="Ce nom avec cet email est déjà utilisé !"
* )
*/
class User extends BaseUser
{
/**
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @var null|string
*
* @ORM\Column(name="etat", type="string", length=10, nullable=true)
*/
protected $etat;
/**
* @ORM\Column(type="string", length=15, nullable=true)
*/
protected $mobile;
/**
* @var User
*
* @ORM\OneToOne(targetEntity="User", cascade={"persist"}, inversedBy="adherent")
*/
protected $user;
/**
* @ORM\OneToOne(targetEntity="App\Entity\Adherent", inversedBy="user", cascade={"persist"})
* @ORM\JoinColumn(name="adherent", referencedColumnName="id", nullable=true)
*/
protected $adherent;
/**
* @ORM\OneToOne(targetEntity="App\Entity\Prestataire", inversedBy="user", cascade={"persist"})
* @ORM\JoinColumn(name="prestataire", referencedColumnName="id", nullable=true)
*/
protected $prestataire;
public function __construct()
{
parent::__construct();
}
public function getCommonName(): ?string
{
return $this->getFirstname()." ".$this->getLastname();
}
/**
* @return null|string
*/
public function getEtat(): ?string
{
return $this->etat;
}
/**
* @param null|string $etat
* @return Prestataire
*/
public function setEtat(?string $etat)
{
$this->etat = $etat;
return $this;
}
/**
* Get mobile number
* @return [type] [description]
*/
public function getMobile(): ?string
{
return $this->mobile;
}
/**
* Set mobile number
* @param string $mobile [description]
*/
public function setMobile(?string $mobile): self
{
$this->mobile = $mobile;
return $this;
}
public function isGranted($role)
{
return in_array($role, $this->getRoles());
}
public function isAdmin()
{
if ($this->isSuperAdmin()) {
return true;
}
$isAdmin = false;
foreach ($this->getRoles() as $role) {
if ((is_object($role) && $role->getRole() == 'ROLE_ADMIN') || $role == 'ROLE_ADMIN') {
$isAdmin = true;
break;
}
}
return $isAdmin;
}
public function isSuperAdmin()
{
return $this->getSuperAdmin();
}
public function getSuperAdmin()
{
$isSuperAdmin = false;
foreach ($this->getRoles() as $role) {
if ((is_object($role) && $role->getRole() == 'ROLE_SUPER_ADMIN') || $role == 'ROLE_SUPER_ADMIN') {
$isSuperAdmin = true;
break;
}
}
return $isSuperAdmin;
}
}
<?php
namespace App\Entity;
use Sonata\UserBundle\Entity\BaseGroup as BaseGroup;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="usergroup")
*/
class Usergroup extends BaseGroup
{
/**
* @var integer
*
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* Get id
*
* @return integer $id
*/
public function getId()
{
return $this->id;
}
}
<?php
namespace App\Form\Type;
use App\Entity\User;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityRepository;
use FOS\UserBundle\Form\Type\RegistrationFormType as FOSRegistrationFormType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormError;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\OptionsResolver\OptionsResolver;
class RegistrationFormType extends AbstractRegistrationFormType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->remove('username')
->add('email', TextType::class, array('label' => 'form_label_email'))
->add('firstname', TextType::class, array('label' => 'form_label_first_name'))
->add('lastname', TextType::class, array('label' => 'form_label_family_name'))
->add('plainPassword', RepeatedType::class, array(
'type' => 'password',
'options' => array('translation_domain' => 'FOSUserBundle'),
'first_options' => array('label' => 'form.password'),
'second_options' => array('label' => 'form.password_confirmation'),
'invalid_message' => 'fos_user.password.mismatch',
'error_bubbling' => true
))
->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) use ($builder) {
$repo = $this->em->getRepository(User::class);
$emailExist = $repo->findBy(array('email' => $event->getForm()->get('email')->getData()));
if (count($emailExist) > 0) {
$event->getForm()->get('email')->addError(new FormError('form_label_email_used'));
}
})
;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'cascade_validation' => true,
'type' => null
));
}
public function getParent()
{
return FOSRegistrationFormType::class;
}
public function getBlockPrefix()
{
return 'app_user_registration';
}
}
<?php
namespace App;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\Config\Resource\FileResource;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Dotenv\Dotenv;
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
use Symfony\Component\Routing\RouteCollectionBuilder;
class Kernel extends BaseKernel
{
use MicroKernelTrait;
const CONFIG_EXTS = '.{php,xml,yaml,yml}';
public function getCacheDir()
{
return $this->getProjectDir().'/var/cache/'.$this->environment;
}
public function getLogDir()
{
return $this->getProjectDir().'/var/log';
}
public function registerBundles()
{
$contents = require $this->getProjectDir().'/config/bundles.php';
foreach ($contents as $class => $envs) {
if (isset($envs['all']) || isset($envs[$this->environment])) {
yield new $class();
}
}
}
protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)
{
$container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));
// Feel free to remove the "container.autowiring.strict_mode" parameter
// if you are using symfony/dependency-injection 4.0+ as it's the default behavior
$container->setParameter('container.autowiring.strict_mode', true);
$container->setParameter('container.dumper.inline_class_loader', true);
$confDir = $this->getProjectDir().'/config';
$loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob');
$loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');
$loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');
$loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');
}
protected function configureRoutes(RouteCollectionBuilder $routes)
{
$confDir = $this->getProjectDir().'/config';
$routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');
$routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');
$routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');
}
public static function bootstrapCli(array &$argv)
{
// consume --env and --no-debug from the command line
// when using symfony/console v4.2 or higher, this should
// be replaced by a call to Application::bootstrapEnv()
for ($i = 0; $i < \count($argv) && '--' !== $v = $argv[$i]; ++$i) {
if ('--no-debug' === $v) {
putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');
$argvUnset[$i] = true;
break;
}
}
for ($i = 0; $i < \count($argv) && '--' !== $v = $argv[$i]; ++$i) {
if (!$v || '-' !== $v[0] || !preg_match('/^-(?:-env(?:=|$)|e=?)(.*)$/D', $v, $v)) {
continue;
}
if (!empty($v[1]) || !empty($argv[1 + $i])) {
putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = empty($v[1]) ? $argv[1 + $i] : $v[1]);
$argvUnset[$i] = $argvUnset[$i + empty($v[1])] = true;
}
break;
}
if (!empty($argvUnset)) {
$argv = array_values(array_diff_key($argv, $argvUnset));
}
}
public static function bootstrapEnv($env = null)
{
if (null !== $env) {
putenv('APP_ENV='.$_SERVER['APP_ENV'] = $env);
}
if ('prod' !== $_SERVER['APP_ENV'] = isset($_SERVER['APP_ENV']) ? $_SERVER['APP_ENV'] : (isset($_ENV['APP_ENV']) ? $_ENV['APP_ENV'] : null)) {
if (!class_exists(Dotenv::class)) {
throw new \RuntimeException('The "APP_ENV" environment variable is not defined. You need to set it or run "composer require symfony/dotenv" to load it from a ".env" file.');
}
// when using symfony/dotenv v4.2 or higher, this call and the related methods
// below should be replaced by a call to the new Dotenv::loadEnv() method
self::loadEnv(new Dotenv(), \dirname(__DIR__).'/.env');
}
$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = isset($_SERVER['APP_ENV']) ? $_SERVER['APP_ENV'] : 'dev';
$_SERVER['APP_DEBUG'] = isset($_SERVER['APP_DEBUG']) ? $_SERVER['APP_DEBUG'] : (isset($_ENV['APP_DEBUG']) ? $_ENV['APP_DEBUG'] : 'prod' !== $_SERVER['APP_ENV']);
$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], FILTER_VALIDATE_BOOLEAN) ? '1' : '0';
}
private static function loadEnv(Dotenv $dotenv, $path)
{
if (file_exists($path) || !file_exists($p = "$path.dist")) {
$dotenv->load($path);
} else {
$dotenv->load($p);
}
if (null === $env = isset($_SERVER['APP_ENV']) ? $_SERVER['APP_ENV'] : (isset($_ENV['APP_ENV']) ? $_ENV['APP_ENV'] : null)) {
$dotenv->populate(array('APP_ENV' => $env = 'dev'));
}
if ('test' !== $env && file_exists($p = "$path.local")) {
$dotenv->load($p);
$env = isset($_SERVER['APP_ENV']) ? $_SERVER['APP_ENV'] : (isset($_ENV['APP_ENV']) ? $_ENV['APP_ENV'] : $env);
}
if (file_exists($p = "$path.$env")) {
$dotenv->load($p);
}
if (file_exists($p = "$path.$env.local")) {
$dotenv->load($p);
}
}
}
<?php
namespace App\Listener;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface;
/**
* Class AfterLoginRedirection
*
* @package App\AppListener
*/
class AfterLoginRedirection implements AuthenticationSuccessHandlerInterface
{
private $router;
/**
* AfterLoginRedirection constructor.
*
* @param RouterInterface $router
*/
public function __construct(RouterInterface $router)
{
$this->router = $router;
}
/**
* @param Request $request
*
* @param TokenInterface $token
*
* @return RedirectResponse
*/
public function onAuthenticationSuccess(Request $request, TokenInterface $token)
{
$roles = $token->getRoles();
$rolesTab = array_map(function ($role) {
return $role->getRole();
}, $roles);
if (in_array('ROLE_SUPER_ADMIN', $rolesTab, true)) {
// c'est un aministrateur : on le rediriger vers l'espace admin
$redirection = new RedirectResponse($this->router->generate('sonata_admin_dashboard'));
} else {
$redirection = new RedirectResponse($this->router->generate('index'));
}
return $redirection;
}
}
<?php
namespace App\Listener;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
class Flash implements EventSubscriberInterface
{
protected $session;
public function __construct(SessionInterface $session)
{
$this->session = $session;
}
public function onKernelResponse(FilterResponseEvent $event)
{
$response = $event->getResponse();
// modify JSON response object
if ($response instanceof JsonResponse) {
// Embed flash messages to the JSON response if there are any
$flashMessages = $this->session->getFlashBag()->all();
if (!empty($flashMessages)) {
// Decode the JSON response before encoding it again with additional data
$data = json_decode($response->getContent(), true);
$data['messages'] = $flashMessages;
$response->setData($data);
}
}
}
public static function getSubscribedEvents()
{
return array(
KernelEvents::RESPONSE => 'onKernelResponse',
);
}
}
\ No newline at end of file
<?php declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20181123175337 extends AbstractMigration
{
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, adherent INT DEFAULT NULL, prestataire INT DEFAULT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled TINYINT(1) NOT NULL, salt VARCHAR(255) DEFAULT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, confirmation_token VARCHAR(180) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\', created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, date_of_birth DATETIME DEFAULT NULL, firstname VARCHAR(64) DEFAULT NULL, lastname VARCHAR(64) DEFAULT NULL, website VARCHAR(64) DEFAULT NULL, biography VARCHAR(1000) DEFAULT NULL, gender VARCHAR(1) DEFAULT NULL, locale VARCHAR(8) DEFAULT NULL, timezone VARCHAR(64) DEFAULT NULL, phone VARCHAR(64) DEFAULT NULL, facebook_uid VARCHAR(255) DEFAULT NULL, facebook_name VARCHAR(255) DEFAULT NULL, facebook_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', twitter_uid VARCHAR(255) DEFAULT NULL, twitter_name VARCHAR(255) DEFAULT NULL, twitter_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', gplus_uid VARCHAR(255) DEFAULT NULL, gplus_name VARCHAR(255) DEFAULT NULL, gplus_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', token VARCHAR(255) DEFAULT NULL, two_step_code VARCHAR(255) DEFAULT NULL, etat VARCHAR(50) DEFAULT NULL, mobile VARCHAR(15) DEFAULT NULL, deleted_at DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_8D93D64992FC23A8 (username_canonical), UNIQUE INDEX UNIQ_8D93D649A0D96FBF (email_canonical), UNIQUE INDEX UNIQ_8D93D649C05FB297 (confirmation_token), UNIQUE INDEX UNIQ_8D93D649A76ED395 (user_id), UNIQUE INDEX UNIQ_8D93D64990D3F060 (adherent), UNIQUE INDEX UNIQ_8D93D64960A26480 (prestataire), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE news (id INT AUTO_INCREMENT NOT NULL, fichier_id INT DEFAULT NULL, user_id INT NOT NULL, visible_by_all_groups TINYINT(1) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, name VARCHAR(150) NOT NULL, slug VARCHAR(150) NOT NULL, content LONGTEXT DEFAULT NULL, enabled TINYINT(1) NOT NULL, deleted_at DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_1DD39950989D9B62 (slug), UNIQUE INDEX UNIQ_1DD39950F915CFE (fichier_id), INDEX IDX_1DD39950A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE rubrique (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(150) NOT NULL, slug VARCHAR(150) NOT NULL, content LONGTEXT DEFAULT NULL, deleted_at DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_8FA4097C989D9B62 (slug), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE rubrique_prestataire (rubrique_id INT NOT NULL, prestataire_id INT NOT NULL, INDEX IDX_7D4D41BB3BD38833 (rubrique_id), INDEX IDX_7D4D41BBBE3DB2B7 (prestataire_id), PRIMARY KEY(rubrique_id, prestataire_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE cotisation (id INT AUTO_INCREMENT NOT NULL, type VARCHAR(12) NOT NULL, annee INT NOT NULL, debut DATE NOT NULL, fin DATE NOT NULL, montant NUMERIC(6, 2) NOT NULL, moyen VARCHAR(20) NOT NULL, recu TINYINT(1) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE document (id INT AUTO_INCREMENT NOT NULL, fichier_id INT DEFAULT NULL, user_id INT DEFAULT NULL, enabled TINYINT(1) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, name VARCHAR(150) NOT NULL, slug VARCHAR(150) NOT NULL, content LONGTEXT DEFAULT NULL, UNIQUE INDEX UNIQ_D8698A76989D9B62 (slug), UNIQUE INDEX UNIQ_D8698A76F915CFE (fichier_id), INDEX IDX_D8698A76A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE transaction (id INT AUTO_INCREMENT NOT NULL, expediteur_id INT DEFAULT NULL, destinataire_id INT DEFAULT NULL, type VARCHAR(3) NOT NULL, montant NUMERIC(7, 2) NOT NULL, titre VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, enabled TINYINT(1) NOT NULL, INDEX IDX_723705D110335F61 (expediteur_id), INDEX IDX_723705D1A4F84F6E (destinataire_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE typepresta (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(150) NOT NULL, slug VARCHAR(150) NOT NULL, content LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_966F48A2989D9B62 (slug), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE siege (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(150) NOT NULL, slug VARCHAR(150) NOT NULL, content LONGTEXT DEFAULT NULL, compte NUMERIC(7, 2) NOT NULL, UNIQUE INDEX UNIQ_6706B4F7989D9B62 (slug), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE marche (id INT AUTO_INCREMENT NOT NULL, geoloc_id INT DEFAULT NULL, contact VARCHAR(100) NOT NULL, jour VARCHAR(255) NOT NULL, name VARCHAR(150) NOT NULL, slug VARCHAR(150) NOT NULL, content LONGTEXT DEFAULT NULL, enabled TINYINT(1) NOT NULL, tel VARCHAR(15) DEFAULT NULL, email VARCHAR(100) DEFAULT NULL, deleted_at DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_BAA18ACC989D9B62 (slug), UNIQUE INDEX UNIQ_BAA18ACCEF390162 (geoloc_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE marche_prestataire (marche_id INT NOT NULL, prestataire_id INT NOT NULL, INDEX IDX_652F05189E494911 (marche_id), INDEX IDX_652F0518BE3DB2B7 (prestataire_id), PRIMARY KEY(marche_id, prestataire_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE adherent (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, ecompte NUMERIC(7, 2) NOT NULL, UNIQUE INDEX UNIQ_90D3F060A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE comptoir (id INT AUTO_INCREMENT NOT NULL, fichier_id INT DEFAULT NULL, groupe_id INT DEFAULT NULL, geoloc_id INT DEFAULT NULL, name VARCHAR(150) NOT NULL, slug VARCHAR(150) NOT NULL, content LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, enabled TINYINT(1) NOT NULL, tel VARCHAR(15) DEFAULT NULL, email VARCHAR(100) DEFAULT NULL, compte NUMERIC(7, 2) NOT NULL, UNIQUE INDEX UNIQ_A6E2C35E989D9B62 (slug), UNIQUE INDEX UNIQ_A6E2C35EF915CFE (fichier_id), INDEX IDX_A6E2C35E7A45358C (groupe_id), UNIQUE INDEX UNIQ_A6E2C35EEF390162 (geoloc_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE charte (id INT AUTO_INCREMENT NOT NULL, image_id INT DEFAULT NULL, fichier_id INT DEFAULT NULL, name VARCHAR(150) NOT NULL, slug VARCHAR(150) NOT NULL, content LONGTEXT DEFAULT NULL, UNIQUE INDEX UNIQ_3484E5A6989D9B62 (slug), UNIQUE INDEX UNIQ_3484E5A63DA5256D (image_id), UNIQUE INDEX UNIQ_3484E5A6F915CFE (fichier_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE transfert (id INT AUTO_INCREMENT NOT NULL, operateur VARCHAR(20) NOT NULL, type VARCHAR(3) NOT NULL, expediteur VARCHAR(100) NOT NULL, destinataire VARCHAR(100) NOT NULL, montant NUMERIC(7, 2) NOT NULL, reference VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, enabled TINYINT(1) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE lien (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, url VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, enabled TINYINT(1) NOT NULL, name VARCHAR(150) NOT NULL, slug VARCHAR(150) NOT NULL, content LONGTEXT DEFAULT NULL, deleted_at DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_A532B4B5989D9B62 (slug), INDEX IDX_A532B4B5A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE prestataire (id INT AUTO_INCREMENT NOT NULL, typeprestataire_id INT DEFAULT NULL, image_id INT DEFAULT NULL, user_id INT DEFAULT NULL, prestataire_group_id INT DEFAULT NULL, geoloc_id INT DEFAULT NULL, raison VARCHAR(100) NOT NULL, metier VARCHAR(100) NOT NULL, statut VARCHAR(50) DEFAULT NULL, responsable VARCHAR(200) DEFAULT NULL, iban VARCHAR(100) NOT NULL, siret VARCHAR(50) NOT NULL, web VARCHAR(255) DEFAULT NULL, accept TINYINT(1) NOT NULL, enabled TINYINT(1) NOT NULL, compte NUMERIC(7, 2) NOT NULL, deleted_at DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_60A26480618045AC (typeprestataire_id), UNIQUE INDEX UNIQ_60A264803DA5256D (image_id), UNIQUE INDEX UNIQ_60A26480A76ED395 (user_id), INDEX IDX_60A264803AA0FF34 (prestataire_group_id), UNIQUE INDEX UNIQ_60A26480EF390162 (geoloc_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE geoloc (id INT AUTO_INCREMENT NOT NULL, adresse VARCHAR(255) DEFAULT NULL, cpostal INT DEFAULT NULL, ville VARCHAR(100) DEFAULT NULL, lat NUMERIC(10, 7) DEFAULT NULL, lon NUMERIC(10, 7) DEFAULT NULL, deleted_at DATETIME DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE faq (id INT AUTO_INCREMENT NOT NULL, fichier_id INT DEFAULT NULL, user_id INT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, enabled TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_E8FF75CCF915CFE (fichier_id), INDEX IDX_E8FF75CCA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE page (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, js LONGTEXT DEFAULT NULL, css LONGTEXT DEFAULT NULL, description VARCHAR(255) DEFAULT NULL, tag VARCHAR(255) DEFAULT NULL, template VARCHAR(255) DEFAULT NULL, name VARCHAR(150) NOT NULL, slug VARCHAR(150) NOT NULL, content LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, enabled TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_140AB620989D9B62 (slug), INDEX IDX_140AB620A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE groupe (id INT AUTO_INCREMENT NOT NULL, deleted_at DATETIME DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE message (id INT AUTO_INCREMENT NOT NULL, expediteur_id INT DEFAULT NULL, destinataire_id INT DEFAULT NULL, name VARCHAR(150) NOT NULL, slug VARCHAR(150) NOT NULL, content LONGTEXT DEFAULT NULL, enabled TINYINT(1) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_B6BD307F989D9B62 (slug), INDEX IDX_B6BD307F10335F61 (expediteur_id), INDEX IDX_B6BD307FA4F84F6E (destinataire_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE fichier (id INT AUTO_INCREMENT NOT NULL, path LONGTEXT DEFAULT NULL, deleted_at DATETIME DEFAULT NULL, discr VARCHAR(255) NOT NULL, width INT DEFAULT NULL, height INT DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE usergroup (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(180) NOT NULL, roles LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\', UNIQUE INDEX UNIQ_4A6478175E237E06 (name), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE user ADD CONSTRAINT FK_8D93D649A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE user ADD CONSTRAINT FK_8D93D64990D3F060 FOREIGN KEY (adherent) REFERENCES adherent (id)');
$this->addSql('ALTER TABLE user ADD CONSTRAINT FK_8D93D64960A26480 FOREIGN KEY (prestataire) REFERENCES prestataire (id)');
$this->addSql('ALTER TABLE news ADD CONSTRAINT FK_1DD39950F915CFE FOREIGN KEY (fichier_id) REFERENCES fichier (id)');
$this->addSql('ALTER TABLE news ADD CONSTRAINT FK_1DD39950A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE rubrique_prestataire ADD CONSTRAINT FK_7D4D41BB3BD38833 FOREIGN KEY (rubrique_id) REFERENCES rubrique (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE rubrique_prestataire ADD CONSTRAINT FK_7D4D41BBBE3DB2B7 FOREIGN KEY (prestataire_id) REFERENCES prestataire (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE cotisation ADD CONSTRAINT FK_AE64D2EDBF396750 FOREIGN KEY (id) REFERENCES user (id)');
$this->addSql('ALTER TABLE document ADD CONSTRAINT FK_D8698A76F915CFE FOREIGN KEY (fichier_id) REFERENCES fichier (id)');
$this->addSql('ALTER TABLE document ADD CONSTRAINT FK_D8698A76A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE transaction ADD CONSTRAINT FK_723705D110335F61 FOREIGN KEY (expediteur_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE transaction ADD CONSTRAINT FK_723705D1A4F84F6E FOREIGN KEY (destinataire_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE marche ADD CONSTRAINT FK_BAA18ACCEF390162 FOREIGN KEY (geoloc_id) REFERENCES geoloc (id)');
$this->addSql('ALTER TABLE marche_prestataire ADD CONSTRAINT FK_652F05189E494911 FOREIGN KEY (marche_id) REFERENCES marche (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE marche_prestataire ADD CONSTRAINT FK_652F0518BE3DB2B7 FOREIGN KEY (prestataire_id) REFERENCES prestataire (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE adherent ADD CONSTRAINT FK_90D3F060A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE comptoir ADD CONSTRAINT FK_A6E2C35EF915CFE FOREIGN KEY (fichier_id) REFERENCES fichier (id)');
$this->addSql('ALTER TABLE comptoir ADD CONSTRAINT FK_A6E2C35E7A45358C FOREIGN KEY (groupe_id) REFERENCES groupe (id)');
$this->addSql('ALTER TABLE comptoir ADD CONSTRAINT FK_A6E2C35EEF390162 FOREIGN KEY (geoloc_id) REFERENCES geoloc (id)');
$this->addSql('ALTER TABLE charte ADD CONSTRAINT FK_3484E5A63DA5256D FOREIGN KEY (image_id) REFERENCES fichier (id)');
$this->addSql('ALTER TABLE charte ADD CONSTRAINT FK_3484E5A6F915CFE FOREIGN KEY (fichier_id) REFERENCES fichier (id)');
$this->addSql('ALTER TABLE lien ADD CONSTRAINT FK_A532B4B5A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE prestataire ADD CONSTRAINT FK_60A26480618045AC FOREIGN KEY (typeprestataire_id) REFERENCES typepresta (id)');
$this->addSql('ALTER TABLE prestataire ADD CONSTRAINT FK_60A264803DA5256D FOREIGN KEY (image_id) REFERENCES fichier (id)');
$this->addSql('ALTER TABLE prestataire ADD CONSTRAINT FK_60A26480A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE prestataire ADD CONSTRAINT FK_60A264803AA0FF34 FOREIGN KEY (prestataire_group_id) REFERENCES groupe (id)');
$this->addSql('ALTER TABLE prestataire ADD CONSTRAINT FK_60A26480EF390162 FOREIGN KEY (geoloc_id) REFERENCES geoloc (id)');
$this->addSql('ALTER TABLE faq ADD CONSTRAINT FK_E8FF75CCF915CFE FOREIGN KEY (fichier_id) REFERENCES fichier (id)');
$this->addSql('ALTER TABLE faq ADD CONSTRAINT FK_E8FF75CCA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB620A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE groupe ADD CONSTRAINT FK_4B98C21BF396750 FOREIGN KEY (id) REFERENCES siege (id)');
$this->addSql('ALTER TABLE message ADD CONSTRAINT FK_B6BD307F10335F61 FOREIGN KEY (expediteur_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE message ADD CONSTRAINT FK_B6BD307FA4F84F6E FOREIGN KEY (destinataire_id) REFERENCES user (id)');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649A76ED395');
$this->addSql('ALTER TABLE news DROP FOREIGN KEY FK_1DD39950A76ED395');
$this->addSql('ALTER TABLE cotisation DROP FOREIGN KEY FK_AE64D2EDBF396750');
$this->addSql('ALTER TABLE document DROP FOREIGN KEY FK_D8698A76A76ED395');
$this->addSql('ALTER TABLE transaction DROP FOREIGN KEY FK_723705D110335F61');
$this->addSql('ALTER TABLE transaction DROP FOREIGN KEY FK_723705D1A4F84F6E');
$this->addSql('ALTER TABLE adherent DROP FOREIGN KEY FK_90D3F060A76ED395');
$this->addSql('ALTER TABLE lien DROP FOREIGN KEY FK_A532B4B5A76ED395');
$this->addSql('ALTER TABLE prestataire DROP FOREIGN KEY FK_60A26480A76ED395');
$this->addSql('ALTER TABLE faq DROP FOREIGN KEY FK_E8FF75CCA76ED395');
$this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB620A76ED395');
$this->addSql('ALTER TABLE message DROP FOREIGN KEY FK_B6BD307F10335F61');
$this->addSql('ALTER TABLE message DROP FOREIGN KEY FK_B6BD307FA4F84F6E');
$this->addSql('ALTER TABLE rubrique_prestataire DROP FOREIGN KEY FK_7D4D41BB3BD38833');
$this->addSql('ALTER TABLE prestataire DROP FOREIGN KEY FK_60A26480618045AC');
$this->addSql('ALTER TABLE groupe DROP FOREIGN KEY FK_4B98C21BF396750');
$this->addSql('ALTER TABLE marche_prestataire DROP FOREIGN KEY FK_652F05189E494911');
$this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D64990D3F060');
$this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D64960A26480');
$this->addSql('ALTER TABLE rubrique_prestataire DROP FOREIGN KEY FK_7D4D41BBBE3DB2B7');
$this->addSql('ALTER TABLE marche_prestataire DROP FOREIGN KEY FK_652F0518BE3DB2B7');
$this->addSql('ALTER TABLE marche DROP FOREIGN KEY FK_BAA18ACCEF390162');
$this->addSql('ALTER TABLE comptoir DROP FOREIGN KEY FK_A6E2C35EEF390162');
$this->addSql('ALTER TABLE prestataire DROP FOREIGN KEY FK_60A26480EF390162');
$this->addSql('ALTER TABLE comptoir DROP FOREIGN KEY FK_A6E2C35E7A45358C');
$this->addSql('ALTER TABLE prestataire DROP FOREIGN KEY FK_60A264803AA0FF34');
$this->addSql('ALTER TABLE news DROP FOREIGN KEY FK_1DD39950F915CFE');
$this->addSql('ALTER TABLE document DROP FOREIGN KEY FK_D8698A76F915CFE');
$this->addSql('ALTER TABLE comptoir DROP FOREIGN KEY FK_A6E2C35EF915CFE');
$this->addSql('ALTER TABLE charte DROP FOREIGN KEY FK_3484E5A63DA5256D');
$this->addSql('ALTER TABLE charte DROP FOREIGN KEY FK_3484E5A6F915CFE');
$this->addSql('ALTER TABLE prestataire DROP FOREIGN KEY FK_60A264803DA5256D');
$this->addSql('ALTER TABLE faq DROP FOREIGN KEY FK_E8FF75CCF915CFE');
$this->addSql('DROP TABLE user');
$this->addSql('DROP TABLE news');
$this->addSql('DROP TABLE rubrique');
$this->addSql('DROP TABLE rubrique_prestataire');
$this->addSql('DROP TABLE cotisation');
$this->addSql('DROP TABLE document');
$this->addSql('DROP TABLE transaction');
$this->addSql('DROP TABLE typepresta');
$this->addSql('DROP TABLE siege');
$this->addSql('DROP TABLE marche');
$this->addSql('DROP TABLE marche_prestataire');
$this->addSql('DROP TABLE adherent');
$this->addSql('DROP TABLE comptoir');
$this->addSql('DROP TABLE charte');
$this->addSql('DROP TABLE transfert');
$this->addSql('DROP TABLE lien');
$this->addSql('DROP TABLE prestataire');
$this->addSql('DROP TABLE geoloc');
$this->addSql('DROP TABLE faq');
$this->addSql('DROP TABLE page');
$this->addSql('DROP TABLE groupe');
$this->addSql('DROP TABLE message');
$this->addSql('DROP TABLE fichier');
$this->addSql('DROP TABLE usergroup');
}
}
<?php declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20181129171623 extends AbstractMigration
{
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE news CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE rubrique CHANGE deleted_at deleted_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE document CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE transaction CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE titre titre VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE typepresta CHANGE deleted_at deleted_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE marche CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(15) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE adherent CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE comptoir CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE groupe_id groupe_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(15) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL');
$this->addSql('ALTER TABLE user CHANGE user_id user_id INT DEFAULT NULL, CHANGE adherent adherent INT DEFAULT NULL, CHANGE prestataire prestataire INT DEFAULT NULL, CHANGE salt salt VARCHAR(255) DEFAULT NULL, CHANGE last_login last_login DATETIME DEFAULT NULL, CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT NULL, CHANGE password_requested_at password_requested_at DATETIME DEFAULT NULL, CHANGE date_of_birth date_of_birth DATETIME DEFAULT NULL, CHANGE firstname firstname VARCHAR(64) DEFAULT NULL, CHANGE lastname lastname VARCHAR(64) DEFAULT NULL, CHANGE website website VARCHAR(64) DEFAULT NULL, CHANGE biography biography VARCHAR(1000) DEFAULT NULL, CHANGE gender gender VARCHAR(1) DEFAULT NULL, CHANGE locale locale VARCHAR(8) DEFAULT NULL, CHANGE timezone timezone VARCHAR(64) DEFAULT NULL, CHANGE phone phone VARCHAR(64) DEFAULT NULL, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT NULL, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT NULL, CHANGE facebook_data facebook_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT NULL, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT NULL, CHANGE twitter_data twitter_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT NULL, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT NULL, CHANGE gplus_data gplus_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT NULL, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT NULL, CHANGE etat etat VARCHAR(50) DEFAULT NULL, CHANGE mobile mobile VARCHAR(15) DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE charte CHANGE image_id image_id INT DEFAULT NULL, CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE transfert CHANGE reference reference VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE lien CHANGE user_id user_id INT DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE prestataire DROP INDEX UNIQ_60A26480618045AC, ADD INDEX IDX_60A26480618045AC (typeprestataire_id)');
$this->addSql('ALTER TABLE prestataire CHANGE typeprestataire_id typeprestataire_id INT DEFAULT NULL, CHANGE image_id image_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE prestataire_group_id prestataire_group_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE statut statut VARCHAR(50) DEFAULT NULL, CHANGE responsable responsable VARCHAR(200) DEFAULT NULL, CHANGE web web VARCHAR(255) DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE geoloc CHANGE adresse adresse VARCHAR(255) DEFAULT NULL, CHANGE cpostal cpostal INT DEFAULT NULL, CHANGE ville ville VARCHAR(100) DEFAULT NULL, CHANGE lat lat NUMERIC(10, 7) DEFAULT NULL, CHANGE lon lon NUMERIC(10, 7) DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE faq CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE page CHANGE description description VARCHAR(255) DEFAULT NULL, CHANGE tag tag VARCHAR(255) DEFAULT NULL, CHANGE template template VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE groupe CHANGE deleted_at deleted_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE message CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE fichier CHANGE deleted_at deleted_at DATETIME DEFAULT NULL, CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE adherent CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE charte CHANGE image_id image_id INT DEFAULT NULL, CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE comptoir CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE groupe_id groupe_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(15) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE document CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE faq CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE fichier CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\', CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL');
$this->addSql('ALTER TABLE geoloc CHANGE adresse adresse VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE cpostal cpostal INT DEFAULT NULL, CHANGE ville ville VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE lat lat NUMERIC(10, 7) DEFAULT \'NULL\', CHANGE lon lon NUMERIC(10, 7) DEFAULT \'NULL\', CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE groupe CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE lien CHANGE user_id user_id INT DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE marche CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(15) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE message CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE news CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE page CHANGE description description VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE tag tag VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE template template VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE prestataire DROP INDEX IDX_60A26480618045AC, ADD UNIQUE INDEX UNIQ_60A26480618045AC (typeprestataire_id)');
$this->addSql('ALTER TABLE prestataire CHANGE typeprestataire_id typeprestataire_id INT DEFAULT NULL, CHANGE image_id image_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE prestataire_group_id prestataire_group_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE statut statut VARCHAR(50) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE responsable responsable VARCHAR(200) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE web web VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE rubrique CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE transaction CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE titre titre VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE transfert CHANGE reference reference VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE typepresta CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE user CHANGE user_id user_id INT DEFAULT NULL, CHANGE adherent adherent INT DEFAULT NULL, CHANGE prestataire prestataire INT DEFAULT NULL, CHANGE salt salt VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE last_login last_login DATETIME DEFAULT \'NULL\', CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE password_requested_at password_requested_at DATETIME DEFAULT \'NULL\', CHANGE date_of_birth date_of_birth DATETIME DEFAULT \'NULL\', CHANGE firstname firstname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE lastname lastname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE website website VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE biography biography VARCHAR(1000) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gender gender VARCHAR(1) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE locale locale VARCHAR(8) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE timezone timezone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE phone phone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_data facebook_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_data twitter_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_data gplus_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE etat etat VARCHAR(50) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE mobile mobile VARCHAR(15) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\'');
}
}
<?php declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20181129181408 extends AbstractMigration
{
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('CREATE TABLE fos_user_user_group (user_id INT NOT NULL, group_id INT NOT NULL, INDEX IDX_B3C77447A76ED395 (user_id), INDEX IDX_B3C77447FE54D947 (group_id), PRIMARY KEY(user_id, group_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE fos_user_user_group ADD CONSTRAINT FK_B3C77447A76ED395 FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE fos_user_user_group ADD CONSTRAINT FK_B3C77447FE54D947 FOREIGN KEY (group_id) REFERENCES usergroup (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE user CHANGE user_id user_id INT DEFAULT NULL, CHANGE adherent adherent INT DEFAULT NULL, CHANGE prestataire prestataire INT DEFAULT NULL, CHANGE salt salt VARCHAR(255) DEFAULT NULL, CHANGE last_login last_login DATETIME DEFAULT NULL, CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT NULL, CHANGE password_requested_at password_requested_at DATETIME DEFAULT NULL, CHANGE date_of_birth date_of_birth DATETIME DEFAULT NULL, CHANGE firstname firstname VARCHAR(64) DEFAULT NULL, CHANGE lastname lastname VARCHAR(64) DEFAULT NULL, CHANGE website website VARCHAR(64) DEFAULT NULL, CHANGE biography biography VARCHAR(1000) DEFAULT NULL, CHANGE gender gender VARCHAR(1) DEFAULT NULL, CHANGE locale locale VARCHAR(8) DEFAULT NULL, CHANGE timezone timezone VARCHAR(64) DEFAULT NULL, CHANGE phone phone VARCHAR(64) DEFAULT NULL, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT NULL, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT NULL, CHANGE facebook_data facebook_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT NULL, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT NULL, CHANGE twitter_data twitter_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT NULL, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT NULL, CHANGE gplus_data gplus_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT NULL, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT NULL, CHANGE etat etat VARCHAR(50) DEFAULT NULL, CHANGE mobile mobile VARCHAR(15) DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE news CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE rubrique CHANGE deleted_at deleted_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE document CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE transaction CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE titre titre VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE typepresta CHANGE deleted_at deleted_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE marche CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(15) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE adherent CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE comptoir CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE groupe_id groupe_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(15) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL');
$this->addSql('ALTER TABLE charte CHANGE image_id image_id INT DEFAULT NULL, CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE transfert CHANGE reference reference VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE lien CHANGE user_id user_id INT DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE prestataire CHANGE typeprestataire_id typeprestataire_id INT DEFAULT NULL, CHANGE image_id image_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE prestataire_group_id prestataire_group_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE statut statut VARCHAR(50) DEFAULT NULL, CHANGE responsable responsable VARCHAR(200) DEFAULT NULL, CHANGE web web VARCHAR(255) DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE geoloc CHANGE adresse adresse VARCHAR(255) DEFAULT NULL, CHANGE cpostal cpostal INT DEFAULT NULL, CHANGE ville ville VARCHAR(100) DEFAULT NULL, CHANGE lat lat NUMERIC(10, 7) DEFAULT NULL, CHANGE lon lon NUMERIC(10, 7) DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE faq CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE page CHANGE description description VARCHAR(255) DEFAULT NULL, CHANGE tag tag VARCHAR(255) DEFAULT NULL, CHANGE template template VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE groupe CHANGE deleted_at deleted_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE message CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE fichier CHANGE deleted_at deleted_at DATETIME DEFAULT NULL, CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('DROP TABLE fos_user_user_group');
$this->addSql('ALTER TABLE adherent CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE charte CHANGE image_id image_id INT DEFAULT NULL, CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE comptoir CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE groupe_id groupe_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(15) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE document CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE faq CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE fichier CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\', CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL');
$this->addSql('ALTER TABLE geoloc CHANGE adresse adresse VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE cpostal cpostal INT DEFAULT NULL, CHANGE ville ville VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE lat lat NUMERIC(10, 7) DEFAULT \'NULL\', CHANGE lon lon NUMERIC(10, 7) DEFAULT \'NULL\', CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE groupe CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE lien CHANGE user_id user_id INT DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE marche CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(15) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE message CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE news CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE page CHANGE description description VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE tag tag VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE template template VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE prestataire CHANGE typeprestataire_id typeprestataire_id INT DEFAULT NULL, CHANGE image_id image_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE prestataire_group_id prestataire_group_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE statut statut VARCHAR(50) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE responsable responsable VARCHAR(200) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE web web VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE rubrique CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE transaction CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE titre titre VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE transfert CHANGE reference reference VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE typepresta CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE user CHANGE user_id user_id INT DEFAULT NULL, CHANGE adherent adherent INT DEFAULT NULL, CHANGE prestataire prestataire INT DEFAULT NULL, CHANGE salt salt VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE last_login last_login DATETIME DEFAULT \'NULL\', CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE password_requested_at password_requested_at DATETIME DEFAULT \'NULL\', CHANGE date_of_birth date_of_birth DATETIME DEFAULT \'NULL\', CHANGE firstname firstname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE lastname lastname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE website website VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE biography biography VARCHAR(1000) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gender gender VARCHAR(1) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE locale locale VARCHAR(8) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE timezone timezone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE phone phone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_data facebook_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_data twitter_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_data gplus_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE etat etat VARCHAR(50) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE mobile mobile VARCHAR(15) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\'');
}
}
<?php declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20181129191410 extends AbstractMigration
{
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE news CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE rubrique CHANGE deleted_at deleted_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE document CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE transaction CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE titre titre VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE typepresta CHANGE deleted_at deleted_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE marche CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(15) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE adherent CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE comptoir CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE groupe_id groupe_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(15) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL');
$this->addSql('ALTER TABLE user CHANGE user_id user_id INT DEFAULT NULL, CHANGE adherent adherent INT DEFAULT NULL, CHANGE prestataire prestataire INT DEFAULT NULL, CHANGE salt salt VARCHAR(255) DEFAULT NULL, CHANGE last_login last_login DATETIME DEFAULT NULL, CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT NULL, CHANGE password_requested_at password_requested_at DATETIME DEFAULT NULL, CHANGE date_of_birth date_of_birth DATETIME DEFAULT NULL, CHANGE firstname firstname VARCHAR(64) DEFAULT NULL, CHANGE lastname lastname VARCHAR(64) DEFAULT NULL, CHANGE website website VARCHAR(64) DEFAULT NULL, CHANGE biography biography VARCHAR(1000) DEFAULT NULL, CHANGE gender gender VARCHAR(1) DEFAULT NULL, CHANGE locale locale VARCHAR(8) DEFAULT NULL, CHANGE timezone timezone VARCHAR(64) DEFAULT NULL, CHANGE phone phone VARCHAR(64) DEFAULT NULL, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT NULL, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT NULL, CHANGE facebook_data facebook_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT NULL, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT NULL, CHANGE twitter_data twitter_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT NULL, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT NULL, CHANGE gplus_data gplus_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT NULL, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT NULL, CHANGE etat etat VARCHAR(50) DEFAULT NULL, CHANGE mobile mobile VARCHAR(15) DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE charte CHANGE image_id image_id INT DEFAULT NULL, CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE transfert CHANGE reference reference VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE lien CHANGE user_id user_id INT DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE prestataire CHANGE typeprestataire_id typeprestataire_id INT DEFAULT NULL, CHANGE image_id image_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE prestataire_group_id prestataire_group_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE statut statut VARCHAR(50) DEFAULT NULL, CHANGE responsable responsable VARCHAR(200) DEFAULT NULL, CHANGE web web VARCHAR(255) DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE geoloc CHANGE adresse adresse VARCHAR(255) DEFAULT NULL, CHANGE cpostal cpostal INT DEFAULT NULL, CHANGE ville ville VARCHAR(100) DEFAULT NULL, CHANGE lat lat NUMERIC(10, 7) DEFAULT NULL, CHANGE lon lon NUMERIC(10, 7) DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE faq CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE page CHANGE description description VARCHAR(255) DEFAULT NULL, CHANGE tag tag VARCHAR(255) DEFAULT NULL, CHANGE template template VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE groupe ADD name VARCHAR(150) NOT NULL, ADD slug VARCHAR(150) NOT NULL, ADD content LONGTEXT DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT NULL');
$this->addSql('CREATE UNIQUE INDEX UNIQ_4B98C21989D9B62 ON groupe (slug)');
$this->addSql('ALTER TABLE message CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE fichier CHANGE deleted_at deleted_at DATETIME DEFAULT NULL, CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE adherent CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE charte CHANGE image_id image_id INT DEFAULT NULL, CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE comptoir CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE groupe_id groupe_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(15) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE document CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE faq CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE fichier CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\', CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL');
$this->addSql('ALTER TABLE geoloc CHANGE adresse adresse VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE cpostal cpostal INT DEFAULT NULL, CHANGE ville ville VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE lat lat NUMERIC(10, 7) DEFAULT \'NULL\', CHANGE lon lon NUMERIC(10, 7) DEFAULT \'NULL\', CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\'');
$this->addSql('DROP INDEX UNIQ_4B98C21989D9B62 ON groupe');
$this->addSql('ALTER TABLE groupe DROP name, DROP slug, DROP content, CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE lien CHANGE user_id user_id INT DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE marche CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(15) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE message CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE news CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE page CHANGE description description VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE tag tag VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE template template VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE prestataire CHANGE typeprestataire_id typeprestataire_id INT DEFAULT NULL, CHANGE image_id image_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE prestataire_group_id prestataire_group_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE statut statut VARCHAR(50) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE responsable responsable VARCHAR(200) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE web web VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE rubrique CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE transaction CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE titre titre VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE transfert CHANGE reference reference VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE typepresta CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE user CHANGE user_id user_id INT DEFAULT NULL, CHANGE adherent adherent INT DEFAULT NULL, CHANGE prestataire prestataire INT DEFAULT NULL, CHANGE salt salt VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE last_login last_login DATETIME DEFAULT \'NULL\', CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE password_requested_at password_requested_at DATETIME DEFAULT \'NULL\', CHANGE date_of_birth date_of_birth DATETIME DEFAULT \'NULL\', CHANGE firstname firstname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE lastname lastname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE website website VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE biography biography VARCHAR(1000) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gender gender VARCHAR(1) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE locale locale VARCHAR(8) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE timezone timezone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE phone phone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_data facebook_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_data twitter_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_data gplus_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE etat etat VARCHAR(50) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE mobile mobile VARCHAR(15) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE deleted_at deleted_at DATETIME DEFAULT \'NULL\'');
}
}
<?php declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20181130153058 extends AbstractMigration
{
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('CREATE TABLE amap (id INT AUTO_INCREMENT NOT NULL, geoloc_id INT DEFAULT NULL, name VARCHAR(150) NOT NULL, slug VARCHAR(150) NOT NULL, content LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, tel VARCHAR(15) DEFAULT NULL, email VARCHAR(100) DEFAULT NULL, enabled TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_CE323CD3989D9B62 (slug), UNIQUE INDEX UNIQ_CE323CD3EF390162 (geoloc_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE amap ADD CONSTRAINT FK_CE323CD3EF390162 FOREIGN KEY (geoloc_id) REFERENCES geoloc (id)');
$this->addSql('ALTER TABLE user DROP deleted_at, CHANGE user_id user_id INT DEFAULT NULL, CHANGE adherent adherent INT DEFAULT NULL, CHANGE prestataire prestataire INT DEFAULT NULL, CHANGE salt salt VARCHAR(255) DEFAULT NULL, CHANGE last_login last_login DATETIME DEFAULT NULL, CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT NULL, CHANGE password_requested_at password_requested_at DATETIME DEFAULT NULL, CHANGE date_of_birth date_of_birth DATETIME DEFAULT NULL, CHANGE firstname firstname VARCHAR(64) DEFAULT NULL, CHANGE lastname lastname VARCHAR(64) DEFAULT NULL, CHANGE website website VARCHAR(64) DEFAULT NULL, CHANGE biography biography VARCHAR(1000) DEFAULT NULL, CHANGE gender gender VARCHAR(1) DEFAULT NULL, CHANGE locale locale VARCHAR(8) DEFAULT NULL, CHANGE timezone timezone VARCHAR(64) DEFAULT NULL, CHANGE phone phone VARCHAR(64) DEFAULT NULL, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT NULL, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT NULL, CHANGE facebook_data facebook_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT NULL, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT NULL, CHANGE twitter_data twitter_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT NULL, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT NULL, CHANGE gplus_data gplus_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT NULL, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT NULL, CHANGE etat etat VARCHAR(10) DEFAULT NULL, CHANGE mobile mobile VARCHAR(15) DEFAULT NULL');
$this->addSql('ALTER TABLE news DROP deleted_at, CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE rubrique ADD enabled TINYINT(1) NOT NULL, DROP deleted_at');
$this->addSql('ALTER TABLE document CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE transaction CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE titre titre VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE typepresta ADD enabled TINYINT(1) NOT NULL, DROP deleted_at');
$this->addSql('ALTER TABLE marche DROP deleted_at, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(15) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL');
$this->addSql('ALTER TABLE adherent CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE comptoir CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE groupe_id groupe_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(15) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL');
$this->addSql('ALTER TABLE charte CHANGE image_id image_id INT DEFAULT NULL, CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE transfert CHANGE reference reference VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE lien DROP deleted_at, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE prestataire DROP deleted_at, CHANGE typeprestataire_id typeprestataire_id INT DEFAULT NULL, CHANGE image_id image_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE prestataire_group_id prestataire_group_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE statut statut VARCHAR(50) DEFAULT NULL, CHANGE responsable responsable VARCHAR(200) DEFAULT NULL, CHANGE web web VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE geoloc ADD enabled TINYINT(1) NOT NULL, DROP deleted_at, CHANGE adresse adresse VARCHAR(255) DEFAULT NULL, CHANGE cpostal cpostal INT DEFAULT NULL, CHANGE ville ville VARCHAR(100) DEFAULT NULL, CHANGE lat lat NUMERIC(10, 7) DEFAULT NULL, CHANGE lon lon NUMERIC(10, 7) DEFAULT NULL');
$this->addSql('ALTER TABLE faq CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE page CHANGE description description VARCHAR(255) DEFAULT NULL, CHANGE tag tag VARCHAR(255) DEFAULT NULL, CHANGE template template VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE groupe ADD enabled TINYINT(1) NOT NULL, DROP deleted_at');
$this->addSql('ALTER TABLE message DROP deleted_at, CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE fichier ADD enabled TINYINT(1) NOT NULL, DROP deleted_at, CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('DROP TABLE amap');
$this->addSql('ALTER TABLE adherent CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE charte CHANGE image_id image_id INT DEFAULT NULL, CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE comptoir CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE groupe_id groupe_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(15) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE document CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE faq CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE fichier ADD deleted_at DATETIME DEFAULT \'NULL\', DROP enabled, CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL');
$this->addSql('ALTER TABLE geoloc ADD deleted_at DATETIME DEFAULT \'NULL\', DROP enabled, CHANGE adresse adresse VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE cpostal cpostal INT DEFAULT NULL, CHANGE ville ville VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE lat lat NUMERIC(10, 7) DEFAULT \'NULL\', CHANGE lon lon NUMERIC(10, 7) DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE groupe ADD deleted_at DATETIME DEFAULT \'NULL\', DROP enabled');
$this->addSql('ALTER TABLE lien ADD deleted_at DATETIME DEFAULT \'NULL\', CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE marche ADD deleted_at DATETIME DEFAULT \'NULL\', CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(15) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE message ADD deleted_at DATETIME DEFAULT \'NULL\', CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE news ADD deleted_at DATETIME DEFAULT \'NULL\', CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE page CHANGE description description VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE tag tag VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE template template VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE prestataire ADD deleted_at DATETIME DEFAULT \'NULL\', CHANGE typeprestataire_id typeprestataire_id INT DEFAULT NULL, CHANGE image_id image_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE prestataire_group_id prestataire_group_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE statut statut VARCHAR(50) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE responsable responsable VARCHAR(200) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE web web VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE rubrique ADD deleted_at DATETIME DEFAULT \'NULL\', DROP enabled');
$this->addSql('ALTER TABLE transaction CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE titre titre VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE transfert CHANGE reference reference VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE typepresta ADD deleted_at DATETIME DEFAULT \'NULL\', DROP enabled');
$this->addSql('ALTER TABLE user ADD deleted_at DATETIME DEFAULT \'NULL\', CHANGE user_id user_id INT DEFAULT NULL, CHANGE adherent adherent INT DEFAULT NULL, CHANGE prestataire prestataire INT DEFAULT NULL, CHANGE salt salt VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE last_login last_login DATETIME DEFAULT \'NULL\', CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE password_requested_at password_requested_at DATETIME DEFAULT \'NULL\', CHANGE date_of_birth date_of_birth DATETIME DEFAULT \'NULL\', CHANGE firstname firstname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE lastname lastname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE website website VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE biography biography VARCHAR(1000) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gender gender VARCHAR(1) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE locale locale VARCHAR(8) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE timezone timezone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE phone phone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_data facebook_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_data twitter_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_data gplus_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE etat etat VARCHAR(50) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE mobile mobile VARCHAR(15) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
}
}
<?php declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20181130153652 extends AbstractMigration
{
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE news CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE document CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE transaction CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE titre titre VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE marche CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(15) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL');
$this->addSql('ALTER TABLE adherent CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE comptoir CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE groupe_id groupe_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(15) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL');
$this->addSql('ALTER TABLE user CHANGE user_id user_id INT DEFAULT NULL, CHANGE adherent adherent INT DEFAULT NULL, CHANGE prestataire prestataire INT DEFAULT NULL, CHANGE salt salt VARCHAR(255) DEFAULT NULL, CHANGE last_login last_login DATETIME DEFAULT NULL, CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT NULL, CHANGE password_requested_at password_requested_at DATETIME DEFAULT NULL, CHANGE date_of_birth date_of_birth DATETIME DEFAULT NULL, CHANGE firstname firstname VARCHAR(64) DEFAULT NULL, CHANGE lastname lastname VARCHAR(64) DEFAULT NULL, CHANGE website website VARCHAR(64) DEFAULT NULL, CHANGE biography biography VARCHAR(1000) DEFAULT NULL, CHANGE gender gender VARCHAR(1) DEFAULT NULL, CHANGE locale locale VARCHAR(8) DEFAULT NULL, CHANGE timezone timezone VARCHAR(64) DEFAULT NULL, CHANGE phone phone VARCHAR(64) DEFAULT NULL, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT NULL, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT NULL, CHANGE facebook_data facebook_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT NULL, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT NULL, CHANGE twitter_data twitter_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT NULL, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT NULL, CHANGE gplus_data gplus_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT NULL, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT NULL, CHANGE etat etat VARCHAR(10) DEFAULT NULL, CHANGE mobile mobile VARCHAR(15) DEFAULT NULL');
$this->addSql('ALTER TABLE charte CHANGE image_id image_id INT DEFAULT NULL, CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE transfert CHANGE reference reference VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE lien CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE amap CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(15) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL');
$this->addSql('ALTER TABLE prestataire CHANGE typeprestataire_id typeprestataire_id INT DEFAULT NULL, CHANGE image_id image_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE prestataire_group_id prestataire_group_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE statut statut VARCHAR(50) DEFAULT NULL, CHANGE responsable responsable VARCHAR(200) DEFAULT NULL, CHANGE web web VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE geoloc CHANGE adresse adresse VARCHAR(255) DEFAULT NULL, CHANGE cpostal cpostal INT DEFAULT NULL, CHANGE ville ville VARCHAR(100) DEFAULT NULL, CHANGE lat lat NUMERIC(10, 7) DEFAULT NULL, CHANGE lon lon NUMERIC(10, 7) DEFAULT NULL');
$this->addSql('ALTER TABLE faq CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE page CHANGE description description VARCHAR(255) DEFAULT NULL, CHANGE tag tag VARCHAR(255) DEFAULT NULL, CHANGE template template VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE groupe DROP FOREIGN KEY FK_4B98C21BF396750');
$this->addSql('ALTER TABLE groupe ADD siege_id INT NOT NULL');
$this->addSql('ALTER TABLE groupe ADD CONSTRAINT FK_4B98C21BF006E8B FOREIGN KEY (siege_id) REFERENCES siege (id)');
$this->addSql('CREATE INDEX IDX_4B98C21BF006E8B ON groupe (siege_id)');
$this->addSql('ALTER TABLE message CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE fichier CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE adherent CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE amap CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(15) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE charte CHANGE image_id image_id INT DEFAULT NULL, CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE comptoir CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE groupe_id groupe_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(15) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE document CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE faq CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE fichier CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL');
$this->addSql('ALTER TABLE geoloc CHANGE adresse adresse VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE cpostal cpostal INT DEFAULT NULL, CHANGE ville ville VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE lat lat NUMERIC(10, 7) DEFAULT \'NULL\', CHANGE lon lon NUMERIC(10, 7) DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE groupe DROP FOREIGN KEY FK_4B98C21BF006E8B');
$this->addSql('DROP INDEX IDX_4B98C21BF006E8B ON groupe');
$this->addSql('ALTER TABLE groupe DROP siege_id');
$this->addSql('ALTER TABLE groupe ADD CONSTRAINT FK_4B98C21BF396750 FOREIGN KEY (id) REFERENCES siege (id)');
$this->addSql('ALTER TABLE lien CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE marche CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(15) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE message CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE news CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE page CHANGE description description VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE tag tag VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE template template VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE prestataire CHANGE typeprestataire_id typeprestataire_id INT DEFAULT NULL, CHANGE image_id image_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE prestataire_group_id prestataire_group_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE statut statut VARCHAR(50) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE responsable responsable VARCHAR(200) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE web web VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE transaction CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE titre titre VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE transfert CHANGE reference reference VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE user CHANGE user_id user_id INT DEFAULT NULL, CHANGE adherent adherent INT DEFAULT NULL, CHANGE prestataire prestataire INT DEFAULT NULL, CHANGE salt salt VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE last_login last_login DATETIME DEFAULT \'NULL\', CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE password_requested_at password_requested_at DATETIME DEFAULT \'NULL\', CHANGE date_of_birth date_of_birth DATETIME DEFAULT \'NULL\', CHANGE firstname firstname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE lastname lastname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE website website VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE biography biography VARCHAR(1000) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gender gender VARCHAR(1) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE locale locale VARCHAR(8) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE timezone timezone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE phone phone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_data facebook_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_data twitter_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_data gplus_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE etat etat VARCHAR(10) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE mobile mobile VARCHAR(15) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
}
}
<?php declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20181130153737 extends AbstractMigration
{
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE news CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE cotisation DROP FOREIGN KEY FK_AE64D2EDBF396750');
$this->addSql('ALTER TABLE cotisation ADD user_id INT NOT NULL');
$this->addSql('ALTER TABLE cotisation ADD CONSTRAINT FK_AE64D2EDA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('CREATE INDEX IDX_AE64D2EDA76ED395 ON cotisation (user_id)');
$this->addSql('ALTER TABLE document CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE transaction CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE titre titre VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE marche CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(15) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL');
$this->addSql('ALTER TABLE adherent CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE comptoir CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE groupe_id groupe_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(15) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL');
$this->addSql('ALTER TABLE user CHANGE user_id user_id INT DEFAULT NULL, CHANGE adherent adherent INT DEFAULT NULL, CHANGE prestataire prestataire INT DEFAULT NULL, CHANGE salt salt VARCHAR(255) DEFAULT NULL, CHANGE last_login last_login DATETIME DEFAULT NULL, CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT NULL, CHANGE password_requested_at password_requested_at DATETIME DEFAULT NULL, CHANGE date_of_birth date_of_birth DATETIME DEFAULT NULL, CHANGE firstname firstname VARCHAR(64) DEFAULT NULL, CHANGE lastname lastname VARCHAR(64) DEFAULT NULL, CHANGE website website VARCHAR(64) DEFAULT NULL, CHANGE biography biography VARCHAR(1000) DEFAULT NULL, CHANGE gender gender VARCHAR(1) DEFAULT NULL, CHANGE locale locale VARCHAR(8) DEFAULT NULL, CHANGE timezone timezone VARCHAR(64) DEFAULT NULL, CHANGE phone phone VARCHAR(64) DEFAULT NULL, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT NULL, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT NULL, CHANGE facebook_data facebook_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT NULL, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT NULL, CHANGE twitter_data twitter_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT NULL, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT NULL, CHANGE gplus_data gplus_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT NULL, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT NULL, CHANGE etat etat VARCHAR(10) DEFAULT NULL, CHANGE mobile mobile VARCHAR(15) DEFAULT NULL');
$this->addSql('ALTER TABLE charte CHANGE image_id image_id INT DEFAULT NULL, CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE transfert CHANGE reference reference VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE lien CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE amap CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(15) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL');
$this->addSql('ALTER TABLE prestataire CHANGE typeprestataire_id typeprestataire_id INT DEFAULT NULL, CHANGE image_id image_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE prestataire_group_id prestataire_group_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE statut statut VARCHAR(50) DEFAULT NULL, CHANGE responsable responsable VARCHAR(200) DEFAULT NULL, CHANGE web web VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE geoloc CHANGE adresse adresse VARCHAR(255) DEFAULT NULL, CHANGE cpostal cpostal INT DEFAULT NULL, CHANGE ville ville VARCHAR(100) DEFAULT NULL, CHANGE lat lat NUMERIC(10, 7) DEFAULT NULL, CHANGE lon lon NUMERIC(10, 7) DEFAULT NULL');
$this->addSql('ALTER TABLE faq CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE page CHANGE description description VARCHAR(255) DEFAULT NULL, CHANGE tag tag VARCHAR(255) DEFAULT NULL, CHANGE template template VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE message CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE fichier CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE adherent CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE amap CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(15) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE charte CHANGE image_id image_id INT DEFAULT NULL, CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE comptoir CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE groupe_id groupe_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(15) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE cotisation DROP FOREIGN KEY FK_AE64D2EDA76ED395');
$this->addSql('DROP INDEX IDX_AE64D2EDA76ED395 ON cotisation');
$this->addSql('ALTER TABLE cotisation DROP user_id');
$this->addSql('ALTER TABLE cotisation ADD CONSTRAINT FK_AE64D2EDBF396750 FOREIGN KEY (id) REFERENCES user (id)');
$this->addSql('ALTER TABLE document CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE faq CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE fichier CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL');
$this->addSql('ALTER TABLE geoloc CHANGE adresse adresse VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE cpostal cpostal INT DEFAULT NULL, CHANGE ville ville VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE lat lat NUMERIC(10, 7) DEFAULT \'NULL\', CHANGE lon lon NUMERIC(10, 7) DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE lien CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE marche CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(15) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE message CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE news CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE page CHANGE description description VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE tag tag VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE template template VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE prestataire CHANGE typeprestataire_id typeprestataire_id INT DEFAULT NULL, CHANGE image_id image_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE prestataire_group_id prestataire_group_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE statut statut VARCHAR(50) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE responsable responsable VARCHAR(200) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE web web VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE transaction CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE titre titre VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE transfert CHANGE reference reference VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE user CHANGE user_id user_id INT DEFAULT NULL, CHANGE adherent adherent INT DEFAULT NULL, CHANGE prestataire prestataire INT DEFAULT NULL, CHANGE salt salt VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE last_login last_login DATETIME DEFAULT \'NULL\', CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE password_requested_at password_requested_at DATETIME DEFAULT \'NULL\', CHANGE date_of_birth date_of_birth DATETIME DEFAULT \'NULL\', CHANGE firstname firstname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE lastname lastname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE website website VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE biography biography VARCHAR(1000) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gender gender VARCHAR(1) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE locale locale VARCHAR(8) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE timezone timezone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE phone phone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_data facebook_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_data twitter_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_data gplus_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE etat etat VARCHAR(10) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE mobile mobile VARCHAR(15) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
}
}
<?php declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20181130154132 extends AbstractMigration
{
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE news CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE document CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE transaction CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE titre titre VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE marche CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL');
$this->addSql('ALTER TABLE adherent CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE comptoir CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE groupe_id groupe_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL');
$this->addSql('ALTER TABLE user CHANGE user_id user_id INT DEFAULT NULL, CHANGE adherent adherent INT DEFAULT NULL, CHANGE prestataire prestataire INT DEFAULT NULL, CHANGE salt salt VARCHAR(255) DEFAULT NULL, CHANGE last_login last_login DATETIME DEFAULT NULL, CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT NULL, CHANGE password_requested_at password_requested_at DATETIME DEFAULT NULL, CHANGE date_of_birth date_of_birth DATETIME DEFAULT NULL, CHANGE firstname firstname VARCHAR(64) DEFAULT NULL, CHANGE lastname lastname VARCHAR(64) DEFAULT NULL, CHANGE website website VARCHAR(64) DEFAULT NULL, CHANGE biography biography VARCHAR(1000) DEFAULT NULL, CHANGE gender gender VARCHAR(1) DEFAULT NULL, CHANGE locale locale VARCHAR(8) DEFAULT NULL, CHANGE timezone timezone VARCHAR(64) DEFAULT NULL, CHANGE phone phone VARCHAR(64) DEFAULT NULL, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT NULL, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT NULL, CHANGE facebook_data facebook_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT NULL, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT NULL, CHANGE twitter_data twitter_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT NULL, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT NULL, CHANGE gplus_data gplus_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT NULL, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT NULL, CHANGE etat etat VARCHAR(10) DEFAULT NULL, CHANGE mobile mobile VARCHAR(15) DEFAULT NULL');
$this->addSql('ALTER TABLE charte CHANGE image_id image_id INT DEFAULT NULL, CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE transfert CHANGE reference reference VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE lien CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE amap CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL');
$this->addSql('ALTER TABLE prestataire CHANGE typeprestataire_id typeprestataire_id INT DEFAULT NULL, CHANGE image_id image_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE prestataire_group_id prestataire_group_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE statut statut VARCHAR(50) DEFAULT NULL, CHANGE responsable responsable VARCHAR(200) DEFAULT NULL, CHANGE web web VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE geoloc CHANGE adresse adresse VARCHAR(255) DEFAULT NULL, CHANGE cpostal cpostal INT DEFAULT NULL, CHANGE ville ville VARCHAR(100) DEFAULT NULL, CHANGE lat lat NUMERIC(10, 7) DEFAULT NULL, CHANGE lon lon NUMERIC(10, 7) DEFAULT NULL');
$this->addSql('ALTER TABLE faq CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE page CHANGE description description VARCHAR(255) DEFAULT NULL, CHANGE tag tag VARCHAR(255) DEFAULT NULL, CHANGE template template VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE message CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE fichier CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE adherent CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE amap CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(15) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE charte CHANGE image_id image_id INT DEFAULT NULL, CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE comptoir CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE groupe_id groupe_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(15) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE document CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE faq CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE fichier CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL');
$this->addSql('ALTER TABLE geoloc CHANGE adresse adresse VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE cpostal cpostal INT DEFAULT NULL, CHANGE ville ville VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE lat lat NUMERIC(10, 7) DEFAULT \'NULL\', CHANGE lon lon NUMERIC(10, 7) DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE lien CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE marche CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(15) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE message CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE news CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE page CHANGE description description VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE tag tag VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE template template VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE prestataire CHANGE typeprestataire_id typeprestataire_id INT DEFAULT NULL, CHANGE image_id image_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE prestataire_group_id prestataire_group_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE statut statut VARCHAR(50) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE responsable responsable VARCHAR(200) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE web web VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE transaction CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE titre titre VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE transfert CHANGE reference reference VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE user CHANGE user_id user_id INT DEFAULT NULL, CHANGE adherent adherent INT DEFAULT NULL, CHANGE prestataire prestataire INT DEFAULT NULL, CHANGE salt salt VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE last_login last_login DATETIME DEFAULT \'NULL\', CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE password_requested_at password_requested_at DATETIME DEFAULT \'NULL\', CHANGE date_of_birth date_of_birth DATETIME DEFAULT \'NULL\', CHANGE firstname firstname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE lastname lastname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE website website VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE biography biography VARCHAR(1000) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gender gender VARCHAR(1) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE locale locale VARCHAR(8) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE timezone timezone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE phone phone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_data facebook_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_data twitter_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_data gplus_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE etat etat VARCHAR(10) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE mobile mobile VARCHAR(15) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
}
}
<?php declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20181130155357 extends AbstractMigration
{
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('CREATE TABLE amap_prestataire (amap_id INT NOT NULL, prestataire_id INT NOT NULL, INDEX IDX_2B4E626652AA66E8 (amap_id), INDEX IDX_2B4E6266BE3DB2B7 (prestataire_id), PRIMARY KEY(amap_id, prestataire_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE amap_prestataire ADD CONSTRAINT FK_2B4E626652AA66E8 FOREIGN KEY (amap_id) REFERENCES amap (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE amap_prestataire ADD CONSTRAINT FK_2B4E6266BE3DB2B7 FOREIGN KEY (prestataire_id) REFERENCES prestataire (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE news CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE document CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE transaction CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE titre titre VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE marche CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL');
$this->addSql('ALTER TABLE adherent CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE comptoir CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE groupe_id groupe_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL');
$this->addSql('ALTER TABLE user CHANGE user_id user_id INT DEFAULT NULL, CHANGE adherent adherent INT DEFAULT NULL, CHANGE prestataire prestataire INT DEFAULT NULL, CHANGE salt salt VARCHAR(255) DEFAULT NULL, CHANGE last_login last_login DATETIME DEFAULT NULL, CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT NULL, CHANGE password_requested_at password_requested_at DATETIME DEFAULT NULL, CHANGE date_of_birth date_of_birth DATETIME DEFAULT NULL, CHANGE firstname firstname VARCHAR(64) DEFAULT NULL, CHANGE lastname lastname VARCHAR(64) DEFAULT NULL, CHANGE website website VARCHAR(64) DEFAULT NULL, CHANGE biography biography VARCHAR(1000) DEFAULT NULL, CHANGE gender gender VARCHAR(1) DEFAULT NULL, CHANGE locale locale VARCHAR(8) DEFAULT NULL, CHANGE timezone timezone VARCHAR(64) DEFAULT NULL, CHANGE phone phone VARCHAR(64) DEFAULT NULL, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT NULL, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT NULL, CHANGE facebook_data facebook_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT NULL, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT NULL, CHANGE twitter_data twitter_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT NULL, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT NULL, CHANGE gplus_data gplus_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT NULL, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT NULL, CHANGE etat etat VARCHAR(10) DEFAULT NULL, CHANGE mobile mobile VARCHAR(15) DEFAULT NULL');
$this->addSql('ALTER TABLE charte CHANGE image_id image_id INT DEFAULT NULL, CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE transfert CHANGE reference reference VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE lien CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE amap CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL');
$this->addSql('ALTER TABLE prestataire CHANGE typeprestataire_id typeprestataire_id INT DEFAULT NULL, CHANGE image_id image_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE prestataire_group_id prestataire_group_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE statut statut VARCHAR(50) DEFAULT NULL, CHANGE responsable responsable VARCHAR(200) DEFAULT NULL, CHANGE web web VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE geoloc CHANGE adresse adresse VARCHAR(255) DEFAULT NULL, CHANGE cpostal cpostal INT DEFAULT NULL, CHANGE ville ville VARCHAR(100) DEFAULT NULL, CHANGE lat lat NUMERIC(10, 7) DEFAULT NULL, CHANGE lon lon NUMERIC(10, 7) DEFAULT NULL');
$this->addSql('ALTER TABLE faq CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE page CHANGE description description VARCHAR(255) DEFAULT NULL, CHANGE tag tag VARCHAR(255) DEFAULT NULL, CHANGE template template VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE message CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE fichier CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('DROP TABLE amap_prestataire');
$this->addSql('ALTER TABLE adherent CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE amap CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE charte CHANGE image_id image_id INT DEFAULT NULL, CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE comptoir CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE groupe_id groupe_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE document CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE faq CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE fichier CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL');
$this->addSql('ALTER TABLE geoloc CHANGE adresse adresse VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE cpostal cpostal INT DEFAULT NULL, CHANGE ville ville VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE lat lat NUMERIC(10, 7) DEFAULT \'NULL\', CHANGE lon lon NUMERIC(10, 7) DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE lien CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE marche CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE message CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE news CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE page CHANGE description description VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE tag tag VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE template template VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE prestataire CHANGE typeprestataire_id typeprestataire_id INT DEFAULT NULL, CHANGE image_id image_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE prestataire_group_id prestataire_group_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE statut statut VARCHAR(50) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE responsable responsable VARCHAR(200) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE web web VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE transaction CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE titre titre VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE transfert CHANGE reference reference VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE user CHANGE user_id user_id INT DEFAULT NULL, CHANGE adherent adherent INT DEFAULT NULL, CHANGE prestataire prestataire INT DEFAULT NULL, CHANGE salt salt VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE last_login last_login DATETIME DEFAULT \'NULL\', CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE password_requested_at password_requested_at DATETIME DEFAULT \'NULL\', CHANGE date_of_birth date_of_birth DATETIME DEFAULT \'NULL\', CHANGE firstname firstname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE lastname lastname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE website website VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE biography biography VARCHAR(1000) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gender gender VARCHAR(1) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE locale locale VARCHAR(8) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE timezone timezone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE phone phone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_data facebook_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_data twitter_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_data gplus_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE etat etat VARCHAR(10) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE mobile mobile VARCHAR(15) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
}
}
<?php declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20181130164939 extends AbstractMigration
{
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE news CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE document CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE transaction CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE titre titre VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE marche CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL');
$this->addSql('ALTER TABLE adherent CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE comptoir CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE groupe_id groupe_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL');
$this->addSql('ALTER TABLE user CHANGE user_id user_id INT DEFAULT NULL, CHANGE adherent adherent INT DEFAULT NULL, CHANGE prestataire prestataire INT DEFAULT NULL, CHANGE salt salt VARCHAR(255) DEFAULT NULL, CHANGE last_login last_login DATETIME DEFAULT NULL, CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT NULL, CHANGE password_requested_at password_requested_at DATETIME DEFAULT NULL, CHANGE date_of_birth date_of_birth DATETIME DEFAULT NULL, CHANGE firstname firstname VARCHAR(64) DEFAULT NULL, CHANGE lastname lastname VARCHAR(64) DEFAULT NULL, CHANGE website website VARCHAR(64) DEFAULT NULL, CHANGE biography biography VARCHAR(1000) DEFAULT NULL, CHANGE gender gender VARCHAR(1) DEFAULT NULL, CHANGE locale locale VARCHAR(8) DEFAULT NULL, CHANGE timezone timezone VARCHAR(64) DEFAULT NULL, CHANGE phone phone VARCHAR(64) DEFAULT NULL, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT NULL, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT NULL, CHANGE facebook_data facebook_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT NULL, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT NULL, CHANGE twitter_data twitter_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT NULL, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT NULL, CHANGE gplus_data gplus_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT NULL, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT NULL, CHANGE etat etat VARCHAR(10) DEFAULT NULL, CHANGE mobile mobile VARCHAR(15) DEFAULT NULL');
$this->addSql('ALTER TABLE charte CHANGE image_id image_id INT DEFAULT NULL, CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE transfert CHANGE reference reference VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE lien CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE amap CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL');
$this->addSql('ALTER TABLE prestataire CHANGE typeprestataire_id typeprestataire_id INT DEFAULT NULL, CHANGE image_id image_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE prestataire_group_id prestataire_group_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE statut statut VARCHAR(50) DEFAULT NULL, CHANGE responsable responsable VARCHAR(200) DEFAULT NULL, CHANGE web web VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE geoloc CHANGE adresse adresse VARCHAR(255) DEFAULT NULL, CHANGE cpostal cpostal INT DEFAULT NULL, CHANGE ville ville VARCHAR(100) DEFAULT NULL, CHANGE lat lat NUMERIC(10, 8) DEFAULT NULL, CHANGE lon lon NUMERIC(10, 8) DEFAULT NULL');
$this->addSql('ALTER TABLE faq CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE page CHANGE description description VARCHAR(255) DEFAULT NULL, CHANGE tag tag VARCHAR(255) DEFAULT NULL, CHANGE template template VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE message CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE fichier CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE adherent CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE amap CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE charte CHANGE image_id image_id INT DEFAULT NULL, CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE comptoir CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE groupe_id groupe_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE document CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE faq CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE fichier CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL');
$this->addSql('ALTER TABLE geoloc CHANGE adresse adresse VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE cpostal cpostal INT DEFAULT NULL, CHANGE ville ville VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE lat lat NUMERIC(10, 7) DEFAULT \'NULL\', CHANGE lon lon NUMERIC(10, 7) DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE lien CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE marche CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE message CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE news CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE page CHANGE description description VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE tag tag VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE template template VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE prestataire CHANGE typeprestataire_id typeprestataire_id INT DEFAULT NULL, CHANGE image_id image_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE prestataire_group_id prestataire_group_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE statut statut VARCHAR(50) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE responsable responsable VARCHAR(200) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE web web VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE transaction CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE titre titre VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE transfert CHANGE reference reference VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE user CHANGE user_id user_id INT DEFAULT NULL, CHANGE adherent adherent INT DEFAULT NULL, CHANGE prestataire prestataire INT DEFAULT NULL, CHANGE salt salt VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE last_login last_login DATETIME DEFAULT \'NULL\', CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE password_requested_at password_requested_at DATETIME DEFAULT \'NULL\', CHANGE date_of_birth date_of_birth DATETIME DEFAULT \'NULL\', CHANGE firstname firstname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE lastname lastname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE website website VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE biography biography VARCHAR(1000) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gender gender VARCHAR(1) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE locale locale VARCHAR(8) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE timezone timezone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE phone phone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_data facebook_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_data twitter_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_data gplus_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE etat etat VARCHAR(10) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE mobile mobile VARCHAR(15) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
}
}
<?php declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20181130165204 extends AbstractMigration
{
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE news CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE document CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE transaction CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE titre titre VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE marche CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL');
$this->addSql('ALTER TABLE adherent CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE comptoir CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE groupe_id groupe_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL');
$this->addSql('ALTER TABLE user CHANGE user_id user_id INT DEFAULT NULL, CHANGE adherent adherent INT DEFAULT NULL, CHANGE prestataire prestataire INT DEFAULT NULL, CHANGE salt salt VARCHAR(255) DEFAULT NULL, CHANGE last_login last_login DATETIME DEFAULT NULL, CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT NULL, CHANGE password_requested_at password_requested_at DATETIME DEFAULT NULL, CHANGE date_of_birth date_of_birth DATETIME DEFAULT NULL, CHANGE firstname firstname VARCHAR(64) DEFAULT NULL, CHANGE lastname lastname VARCHAR(64) DEFAULT NULL, CHANGE website website VARCHAR(64) DEFAULT NULL, CHANGE biography biography VARCHAR(1000) DEFAULT NULL, CHANGE gender gender VARCHAR(1) DEFAULT NULL, CHANGE locale locale VARCHAR(8) DEFAULT NULL, CHANGE timezone timezone VARCHAR(64) DEFAULT NULL, CHANGE phone phone VARCHAR(64) DEFAULT NULL, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT NULL, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT NULL, CHANGE facebook_data facebook_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT NULL, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT NULL, CHANGE twitter_data twitter_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT NULL, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT NULL, CHANGE gplus_data gplus_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT NULL, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT NULL, CHANGE etat etat VARCHAR(10) DEFAULT NULL, CHANGE mobile mobile VARCHAR(15) DEFAULT NULL');
$this->addSql('ALTER TABLE charte CHANGE image_id image_id INT DEFAULT NULL, CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE transfert CHANGE reference reference VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE lien CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE amap CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL');
$this->addSql('ALTER TABLE prestataire CHANGE typeprestataire_id typeprestataire_id INT DEFAULT NULL, CHANGE image_id image_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE prestataire_group_id prestataire_group_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE statut statut VARCHAR(50) DEFAULT NULL, CHANGE responsable responsable VARCHAR(200) DEFAULT NULL, CHANGE web web VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE geoloc CHANGE adresse adresse VARCHAR(255) DEFAULT NULL, CHANGE cpostal cpostal INT DEFAULT NULL, CHANGE ville ville VARCHAR(100) DEFAULT NULL, CHANGE lat lat NUMERIC(10, 8) DEFAULT NULL, CHANGE lon lon NUMERIC(10, 8) DEFAULT NULL');
$this->addSql('ALTER TABLE faq CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE page CHANGE description description VARCHAR(255) DEFAULT NULL, CHANGE tag tag VARCHAR(255) DEFAULT NULL, CHANGE template template VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE message CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE fichier CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE adherent CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE amap CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE charte CHANGE image_id image_id INT DEFAULT NULL, CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE comptoir CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE groupe_id groupe_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE document CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE faq CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE fichier CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL');
$this->addSql('ALTER TABLE geoloc CHANGE adresse adresse VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE cpostal cpostal INT DEFAULT NULL, CHANGE ville ville VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE lat lat NUMERIC(10, 8) DEFAULT \'NULL\', CHANGE lon lon NUMERIC(10, 8) DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE lien CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE marche CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE message CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE news CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE page CHANGE description description VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE tag tag VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE template template VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE prestataire CHANGE typeprestataire_id typeprestataire_id INT DEFAULT NULL, CHANGE image_id image_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE prestataire_group_id prestataire_group_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE statut statut VARCHAR(50) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE responsable responsable VARCHAR(200) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE web web VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE transaction CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE titre titre VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE transfert CHANGE reference reference VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE user CHANGE user_id user_id INT DEFAULT NULL, CHANGE adherent adherent INT DEFAULT NULL, CHANGE prestataire prestataire INT DEFAULT NULL, CHANGE salt salt VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE last_login last_login DATETIME DEFAULT \'NULL\', CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE password_requested_at password_requested_at DATETIME DEFAULT \'NULL\', CHANGE date_of_birth date_of_birth DATETIME DEFAULT \'NULL\', CHANGE firstname firstname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE lastname lastname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE website website VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE biography biography VARCHAR(1000) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gender gender VARCHAR(1) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE locale locale VARCHAR(8) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE timezone timezone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE phone phone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_data facebook_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_data twitter_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_data gplus_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE etat etat VARCHAR(10) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE mobile mobile VARCHAR(15) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
}
}
<?php declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20181130165246 extends AbstractMigration
{
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE news CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE document CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE transaction CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE titre titre VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE marche CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL');
$this->addSql('ALTER TABLE adherent CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE comptoir CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE groupe_id groupe_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL');
$this->addSql('ALTER TABLE user CHANGE user_id user_id INT DEFAULT NULL, CHANGE adherent adherent INT DEFAULT NULL, CHANGE prestataire prestataire INT DEFAULT NULL, CHANGE salt salt VARCHAR(255) DEFAULT NULL, CHANGE last_login last_login DATETIME DEFAULT NULL, CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT NULL, CHANGE password_requested_at password_requested_at DATETIME DEFAULT NULL, CHANGE date_of_birth date_of_birth DATETIME DEFAULT NULL, CHANGE firstname firstname VARCHAR(64) DEFAULT NULL, CHANGE lastname lastname VARCHAR(64) DEFAULT NULL, CHANGE website website VARCHAR(64) DEFAULT NULL, CHANGE biography biography VARCHAR(1000) DEFAULT NULL, CHANGE gender gender VARCHAR(1) DEFAULT NULL, CHANGE locale locale VARCHAR(8) DEFAULT NULL, CHANGE timezone timezone VARCHAR(64) DEFAULT NULL, CHANGE phone phone VARCHAR(64) DEFAULT NULL, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT NULL, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT NULL, CHANGE facebook_data facebook_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT NULL, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT NULL, CHANGE twitter_data twitter_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT NULL, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT NULL, CHANGE gplus_data gplus_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT NULL, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT NULL, CHANGE etat etat VARCHAR(10) DEFAULT NULL, CHANGE mobile mobile VARCHAR(15) DEFAULT NULL');
$this->addSql('ALTER TABLE charte CHANGE image_id image_id INT DEFAULT NULL, CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE transfert CHANGE reference reference VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE lien CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE amap CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL');
$this->addSql('ALTER TABLE prestataire CHANGE typeprestataire_id typeprestataire_id INT DEFAULT NULL, CHANGE image_id image_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE prestataire_group_id prestataire_group_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE statut statut VARCHAR(50) DEFAULT NULL, CHANGE responsable responsable VARCHAR(200) DEFAULT NULL, CHANGE web web VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE geoloc CHANGE adresse adresse VARCHAR(255) DEFAULT NULL, CHANGE cpostal cpostal INT DEFAULT NULL, CHANGE ville ville VARCHAR(100) DEFAULT NULL, CHANGE lat lat NUMERIC(10, 8) DEFAULT NULL, CHANGE lon lon NUMERIC(10, 8) DEFAULT NULL');
$this->addSql('ALTER TABLE faq CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE page CHANGE description description VARCHAR(255) DEFAULT NULL, CHANGE tag tag VARCHAR(255) DEFAULT NULL, CHANGE template template VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE message CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE fichier CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE adherent CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE amap CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE charte CHANGE image_id image_id INT DEFAULT NULL, CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE comptoir CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE groupe_id groupe_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE document CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE faq CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE fichier CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL');
$this->addSql('ALTER TABLE geoloc CHANGE adresse adresse VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE cpostal cpostal INT DEFAULT NULL, CHANGE ville ville VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE lat lat NUMERIC(10, 8) DEFAULT \'NULL\', CHANGE lon lon NUMERIC(10, 8) DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE lien CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE marche CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE message CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE news CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE page CHANGE description description VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE tag tag VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE template template VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE prestataire CHANGE typeprestataire_id typeprestataire_id INT DEFAULT NULL, CHANGE image_id image_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE prestataire_group_id prestataire_group_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE statut statut VARCHAR(50) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE responsable responsable VARCHAR(200) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE web web VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE transaction CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE titre titre VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE transfert CHANGE reference reference VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE user CHANGE user_id user_id INT DEFAULT NULL, CHANGE adherent adherent INT DEFAULT NULL, CHANGE prestataire prestataire INT DEFAULT NULL, CHANGE salt salt VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE last_login last_login DATETIME DEFAULT \'NULL\', CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE password_requested_at password_requested_at DATETIME DEFAULT \'NULL\', CHANGE date_of_birth date_of_birth DATETIME DEFAULT \'NULL\', CHANGE firstname firstname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE lastname lastname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE website website VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE biography biography VARCHAR(1000) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gender gender VARCHAR(1) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE locale locale VARCHAR(8) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE timezone timezone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE phone phone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_data facebook_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_data twitter_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_data gplus_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE etat etat VARCHAR(10) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE mobile mobile VARCHAR(15) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
}
}
<?php declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20181130175453 extends AbstractMigration
{
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE amap_prestataire DROP FOREIGN KEY FK_2B4E626652AA66E8');
$this->addSql('ALTER TABLE marche_prestataire DROP FOREIGN KEY FK_652F05189E494911');
$this->addSql('CREATE TABLE groupeprestaire (id INT AUTO_INCREMENT NOT NULL, geoloc_id INT DEFAULT NULL, type VARCHAR(20) NOT NULL, horaires VARCHAR(200) NOT NULL, name VARCHAR(150) NOT NULL, slug VARCHAR(150) NOT NULL, content LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, tel VARCHAR(20) DEFAULT NULL, email VARCHAR(100) DEFAULT NULL, enabled TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_FB9ABBCE989D9B62 (slug), UNIQUE INDEX UNIQ_FB9ABBCEEF390162 (geoloc_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE groupeprestataire_prestataire (groupeprestataire_id INT NOT NULL, prestataire_id INT NOT NULL, INDEX IDX_66D8DEC98D18A702 (groupeprestataire_id), INDEX IDX_66D8DEC9BE3DB2B7 (prestataire_id), PRIMARY KEY(groupeprestataire_id, prestataire_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE groupeprestaire ADD CONSTRAINT FK_FB9ABBCEEF390162 FOREIGN KEY (geoloc_id) REFERENCES geoloc (id)');
$this->addSql('ALTER TABLE groupeprestataire_prestataire ADD CONSTRAINT FK_66D8DEC98D18A702 FOREIGN KEY (groupeprestataire_id) REFERENCES groupeprestaire (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE groupeprestataire_prestataire ADD CONSTRAINT FK_66D8DEC9BE3DB2B7 FOREIGN KEY (prestataire_id) REFERENCES prestataire (id) ON DELETE CASCADE');
$this->addSql('DROP TABLE amap');
$this->addSql('DROP TABLE amap_prestataire');
$this->addSql('DROP TABLE marche');
$this->addSql('DROP TABLE marche_prestataire');
$this->addSql('ALTER TABLE news CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE document CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE transaction CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE titre titre VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE adherent CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE comptoir CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE groupe_id groupe_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL');
$this->addSql('ALTER TABLE user CHANGE user_id user_id INT DEFAULT NULL, CHANGE adherent adherent INT DEFAULT NULL, CHANGE prestataire prestataire INT DEFAULT NULL, CHANGE salt salt VARCHAR(255) DEFAULT NULL, CHANGE last_login last_login DATETIME DEFAULT NULL, CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT NULL, CHANGE password_requested_at password_requested_at DATETIME DEFAULT NULL, CHANGE date_of_birth date_of_birth DATETIME DEFAULT NULL, CHANGE firstname firstname VARCHAR(64) DEFAULT NULL, CHANGE lastname lastname VARCHAR(64) DEFAULT NULL, CHANGE website website VARCHAR(64) DEFAULT NULL, CHANGE biography biography VARCHAR(1000) DEFAULT NULL, CHANGE gender gender VARCHAR(1) DEFAULT NULL, CHANGE locale locale VARCHAR(8) DEFAULT NULL, CHANGE timezone timezone VARCHAR(64) DEFAULT NULL, CHANGE phone phone VARCHAR(64) DEFAULT NULL, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT NULL, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT NULL, CHANGE facebook_data facebook_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT NULL, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT NULL, CHANGE twitter_data twitter_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT NULL, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT NULL, CHANGE gplus_data gplus_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT NULL, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT NULL, CHANGE etat etat VARCHAR(10) DEFAULT NULL, CHANGE mobile mobile VARCHAR(15) DEFAULT NULL');
$this->addSql('ALTER TABLE charte CHANGE image_id image_id INT DEFAULT NULL, CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE transfert CHANGE reference reference VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE lien CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE prestataire CHANGE typeprestataire_id typeprestataire_id INT DEFAULT NULL, CHANGE image_id image_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE prestataire_group_id prestataire_group_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE statut statut VARCHAR(50) DEFAULT NULL, CHANGE responsable responsable VARCHAR(200) DEFAULT NULL, CHANGE web web VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE geoloc CHANGE adresse adresse VARCHAR(255) DEFAULT NULL, CHANGE cpostal cpostal INT DEFAULT NULL, CHANGE ville ville VARCHAR(100) DEFAULT NULL, CHANGE lat lat NUMERIC(10, 8) DEFAULT NULL, CHANGE lon lon NUMERIC(10, 8) DEFAULT NULL');
$this->addSql('ALTER TABLE faq CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE page CHANGE description description VARCHAR(255) DEFAULT NULL, CHANGE tag tag VARCHAR(255) DEFAULT NULL, CHANGE template template VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE message CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE fichier CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE groupeprestataire_prestataire DROP FOREIGN KEY FK_66D8DEC98D18A702');
$this->addSql('CREATE TABLE amap (id INT AUTO_INCREMENT NOT NULL, geoloc_id INT DEFAULT NULL, name VARCHAR(150) NOT NULL COLLATE utf8mb4_unicode_ci, slug VARCHAR(150) NOT NULL COLLATE utf8mb4_unicode_ci, content LONGTEXT DEFAULT NULL COLLATE utf8mb4_unicode_ci, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, tel VARCHAR(20) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, enabled TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_CE323CD3989D9B62 (slug), UNIQUE INDEX UNIQ_CE323CD3EF390162 (geoloc_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE amap_prestataire (amap_id INT NOT NULL, prestataire_id INT NOT NULL, INDEX IDX_2B4E626652AA66E8 (amap_id), INDEX IDX_2B4E6266BE3DB2B7 (prestataire_id), PRIMARY KEY(amap_id, prestataire_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE marche (id INT AUTO_INCREMENT NOT NULL, geoloc_id INT DEFAULT NULL, contact VARCHAR(100) NOT NULL COLLATE utf8mb4_unicode_ci, jour VARCHAR(255) NOT NULL COLLATE utf8mb4_unicode_ci, name VARCHAR(150) NOT NULL COLLATE utf8mb4_unicode_ci, slug VARCHAR(150) NOT NULL COLLATE utf8mb4_unicode_ci, content LONGTEXT DEFAULT NULL COLLATE utf8mb4_unicode_ci, enabled TINYINT(1) NOT NULL, tel VARCHAR(20) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, UNIQUE INDEX UNIQ_BAA18ACC989D9B62 (slug), UNIQUE INDEX UNIQ_BAA18ACCEF390162 (geoloc_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE marche_prestataire (marche_id INT NOT NULL, prestataire_id INT NOT NULL, INDEX IDX_652F05189E494911 (marche_id), INDEX IDX_652F0518BE3DB2B7 (prestataire_id), PRIMARY KEY(marche_id, prestataire_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE amap ADD CONSTRAINT FK_CE323CD3EF390162 FOREIGN KEY (geoloc_id) REFERENCES geoloc (id)');
$this->addSql('ALTER TABLE amap_prestataire ADD CONSTRAINT FK_2B4E626652AA66E8 FOREIGN KEY (amap_id) REFERENCES amap (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE amap_prestataire ADD CONSTRAINT FK_2B4E6266BE3DB2B7 FOREIGN KEY (prestataire_id) REFERENCES prestataire (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE marche ADD CONSTRAINT FK_BAA18ACCEF390162 FOREIGN KEY (geoloc_id) REFERENCES geoloc (id)');
$this->addSql('ALTER TABLE marche_prestataire ADD CONSTRAINT FK_652F05189E494911 FOREIGN KEY (marche_id) REFERENCES marche (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE marche_prestataire ADD CONSTRAINT FK_652F0518BE3DB2B7 FOREIGN KEY (prestataire_id) REFERENCES prestataire (id) ON DELETE CASCADE');
$this->addSql('DROP TABLE groupeprestaire');
$this->addSql('DROP TABLE groupeprestataire_prestataire');
$this->addSql('ALTER TABLE adherent CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE charte CHANGE image_id image_id INT DEFAULT NULL, CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE comptoir CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE groupe_id groupe_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE document CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE faq CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE fichier CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL');
$this->addSql('ALTER TABLE geoloc CHANGE adresse adresse VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE cpostal cpostal INT DEFAULT NULL, CHANGE ville ville VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE lat lat NUMERIC(10, 8) DEFAULT \'NULL\', CHANGE lon lon NUMERIC(10, 8) DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE lien CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE message CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE news CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE page CHANGE description description VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE tag tag VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE template template VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE prestataire CHANGE typeprestataire_id typeprestataire_id INT DEFAULT NULL, CHANGE image_id image_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE prestataire_group_id prestataire_group_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE statut statut VARCHAR(50) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE responsable responsable VARCHAR(200) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE web web VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE transaction CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE titre titre VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE transfert CHANGE reference reference VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE user CHANGE user_id user_id INT DEFAULT NULL, CHANGE adherent adherent INT DEFAULT NULL, CHANGE prestataire prestataire INT DEFAULT NULL, CHANGE salt salt VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE last_login last_login DATETIME DEFAULT \'NULL\', CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE password_requested_at password_requested_at DATETIME DEFAULT \'NULL\', CHANGE date_of_birth date_of_birth DATETIME DEFAULT \'NULL\', CHANGE firstname firstname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE lastname lastname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE website website VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE biography biography VARCHAR(1000) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gender gender VARCHAR(1) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE locale locale VARCHAR(8) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE timezone timezone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE phone phone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_data facebook_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_data twitter_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_data gplus_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE etat etat VARCHAR(10) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE mobile mobile VARCHAR(15) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
}
}
<?php declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20181130183926 extends AbstractMigration
{
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE news CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE document CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE transaction CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE titre titre VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE adherent CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE comptoir CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE groupe_id groupe_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL');
$this->addSql('ALTER TABLE user CHANGE user_id user_id INT DEFAULT NULL, CHANGE adherent adherent INT DEFAULT NULL, CHANGE prestataire prestataire INT DEFAULT NULL, CHANGE salt salt VARCHAR(255) DEFAULT NULL, CHANGE last_login last_login DATETIME DEFAULT NULL, CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT NULL, CHANGE password_requested_at password_requested_at DATETIME DEFAULT NULL, CHANGE date_of_birth date_of_birth DATETIME DEFAULT NULL, CHANGE firstname firstname VARCHAR(64) DEFAULT NULL, CHANGE lastname lastname VARCHAR(64) DEFAULT NULL, CHANGE website website VARCHAR(64) DEFAULT NULL, CHANGE biography biography VARCHAR(1000) DEFAULT NULL, CHANGE gender gender VARCHAR(1) DEFAULT NULL, CHANGE locale locale VARCHAR(8) DEFAULT NULL, CHANGE timezone timezone VARCHAR(64) DEFAULT NULL, CHANGE phone phone VARCHAR(64) DEFAULT NULL, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT NULL, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT NULL, CHANGE facebook_data facebook_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT NULL, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT NULL, CHANGE twitter_data twitter_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT NULL, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT NULL, CHANGE gplus_data gplus_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT NULL, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT NULL, CHANGE etat etat VARCHAR(10) DEFAULT NULL, CHANGE mobile mobile VARCHAR(15) DEFAULT NULL');
$this->addSql('ALTER TABLE charte CHANGE image_id image_id INT DEFAULT NULL, CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE transfert CHANGE reference reference VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE lien CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE prestataire CHANGE typeprestataire_id typeprestataire_id INT DEFAULT NULL, CHANGE image_id image_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE prestataire_group_id prestataire_group_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE statut statut VARCHAR(50) DEFAULT NULL, CHANGE responsable responsable VARCHAR(200) DEFAULT NULL, CHANGE web web VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE geoloc CHANGE adresse adresse VARCHAR(255) DEFAULT NULL, CHANGE cpostal cpostal INT DEFAULT NULL, CHANGE ville ville VARCHAR(100) DEFAULT NULL, CHANGE lat lat NUMERIC(10, 8) DEFAULT NULL, CHANGE lon lon NUMERIC(10, 8) DEFAULT NULL');
$this->addSql('ALTER TABLE faq CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE page CHANGE description description VARCHAR(255) DEFAULT NULL, CHANGE tag tag VARCHAR(255) DEFAULT NULL, CHANGE template template VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE message CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE fichier CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL');
$this->addSql('ALTER TABLE groupeprestaire CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE horaires horaires VARCHAR(200) DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT NULL, CHANGE email email VARCHAR(100) DEFAULT NULL');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE adherent CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE charte CHANGE image_id image_id INT DEFAULT NULL, CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE comptoir CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE groupe_id groupe_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE tel tel VARCHAR(20) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE document CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE faq CHANGE fichier_id fichier_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE fichier CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL');
$this->addSql('ALTER TABLE geoloc CHANGE adresse adresse VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE cpostal cpostal INT DEFAULT NULL, CHANGE ville ville VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE lat lat NUMERIC(10, 8) DEFAULT \'NULL\', CHANGE lon lon NUMERIC(10, 8) DEFAULT \'NULL\'');
$this->addSql('ALTER TABLE groupeprestaire CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE horaires horaires VARCHAR(200) NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE tel tel VARCHAR(20) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE email email VARCHAR(100) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE lien CHANGE user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE message CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE news CHANGE fichier_id fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE page CHANGE description description VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE tag tag VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE template template VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE prestataire CHANGE typeprestataire_id typeprestataire_id INT DEFAULT NULL, CHANGE image_id image_id INT DEFAULT NULL, CHANGE user_id user_id INT DEFAULT NULL, CHANGE prestataire_group_id prestataire_group_id INT DEFAULT NULL, CHANGE geoloc_id geoloc_id INT DEFAULT NULL, CHANGE statut statut VARCHAR(50) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE responsable responsable VARCHAR(200) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE web web VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE transaction CHANGE expediteur_id expediteur_id INT DEFAULT NULL, CHANGE destinataire_id destinataire_id INT DEFAULT NULL, CHANGE titre titre VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE transfert CHANGE reference reference VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE user CHANGE user_id user_id INT DEFAULT NULL, CHANGE adherent adherent INT DEFAULT NULL, CHANGE prestataire prestataire INT DEFAULT NULL, CHANGE salt salt VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE last_login last_login DATETIME DEFAULT \'NULL\', CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE password_requested_at password_requested_at DATETIME DEFAULT \'NULL\', CHANGE date_of_birth date_of_birth DATETIME DEFAULT \'NULL\', CHANGE firstname firstname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE lastname lastname VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE website website VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE biography biography VARCHAR(1000) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gender gender VARCHAR(1) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE locale locale VARCHAR(8) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE timezone timezone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE phone phone VARCHAR(64) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE facebook_data facebook_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE twitter_data twitter_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE gplus_data gplus_data LONGTEXT DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:json)\', CHANGE token token VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE etat etat VARCHAR(10) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci, CHANGE mobile mobile VARCHAR(15) DEFAULT \'NULL\' COLLATE utf8mb4_unicode_ci');
}
}
<?php
namespace App\Repository;
use App\Entity\Adherent;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Symfony\Bridge\Doctrine\RegistryInterface;
/**
* @method Adherent|null find($id, $lockMode = null, $lockVersion = null)
* @method Adherent|null findOneBy(array $criteria, array $orderBy = null)
* @method Adherent[] findAll()
* @method Adherent[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class AdherentRepository extends ServiceEntityRepository
{
public function __construct(RegistryInterface $registry)
{
parent::__construct($registry, Adherent::class);
}
// /**
// * @return Adherent[] Returns an array of Adherent objects
// */
/*
public function findByExampleField($value)
{
return $this->createQueryBuilder('a')
->andWhere('a.exampleField = :val')
->setParameter('val', $value)
->orderBy('a.id', 'ASC')
->setMaxResults(10)
->getQuery()
->getResult()
;
}
*/
/*
public function findOneBySomeField($value): ?Adherent
{
return $this->createQueryBuilder('a')
->andWhere('a.exampleField = :val')
->setParameter('val', $value)
->getQuery()
->getOneOrNullResult()
;
}
*/
}
<?php
namespace App\Repository;
use App\Entity\Horaire;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Symfony\Bridge\Doctrine\RegistryInterface;
/**
* @method Horaire|null find($id, $lockMode = null, $lockVersion = null)
* @method Horaire|null findOneBy(array $criteria, array $orderBy = null)
* @method Horaire[] findAll()
* @method Horaire[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class HoraireRepository extends ServiceEntityRepository
{
public function __construct(RegistryInterface $registry)
{
parent::__construct($registry, Horaire::class);
}
// /**
// * @return Horaire[] Returns an array of Horaire objects
// */
/*
public function findByExampleField($value)
{
return $this->createQueryBuilder('h')
->andWhere('h.exampleField = :val')
->setParameter('val', $value)
->orderBy('h.id', 'ASC')
->setMaxResults(10)
->getQuery()
->getResult()
;
}
*/
/*
public function findOneBySomeField($value): ?Horaire
{
return $this->createQueryBuilder('h')
->andWhere('h.exampleField = :val')
->setParameter('val', $value)
->getQuery()
->getOneOrNullResult()
;
}
*/
}
<?php
namespace App\Repository;
use Doctrine\Common\Collections\Criteria;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\QueryBuilder;
class UserRepository extends EntityRepository
{
}
<?php
namespace App\Security;
use App\Entity\User;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface;
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
class UserVoter extends Voter
{
const ADD = 'add';
const GET = 'get';
const EDIT = 'edit';
const REMOVE = 'remove';
private $decisionManager;
public function __construct(AccessDecisionManagerInterface $decisionManager)
{
$this->decisionManager = $decisionManager;
}
protected function supports($attribute, $subject)
{
// Est-ce que l'action demandée existe
if (!in_array($attribute, array(self::ADD, self::GET, self::EDIT, self::REMOVE))) {
return false;
}
// On ne vote que pour des objets de type User
if (!$subject instanceof User) {
return false;
}
return true;
}
protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
{
$user = $token->getUser();
if (!$user instanceof User) {
// L'utilisateur doit être loggué
return false;
}
// Les admins peuvent tout faire !
if ($this->decisionManager->decide($token, array('ROLE_SUPER_ADMIN', 'ROLE_ADMIN'))) {
return true;
}
switch ($attribute) {
case self::ADD:
return $this->canAdd($subject, $user);
case self::GET:
return $this->canGet($subject, $user);
case self::EDIT:
return $this->canEdit($subject, $user);
case self::REMOVE:
return $this->canRemove($subject, $user);
}
throw new \LogicException('This code should not be reached!');
}
private function canAdd(User $subject, User $user)
{
}
private function canGet(User $subject, User $user)
{
}
private function canEdit(User $subject, User $user)
{
}
private function canRemove(User $subject, User $user)
{
}
}
{
"behat/transliterator": {
"version": "v1.2.0"
},
"cocur/slugify": {
"version": "v3.1"
},
"composer/ca-bundle": {
"version": "1.1.3"
},
"doctrine/annotations": {
"version": "1.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "1.0",
"ref": "cb4152ebcadbe620ea2261da1a1c5a9b8cea7672"
}
},
"doctrine/cache": {
"version": "v1.8.0"
},
"doctrine/collections": {
"version": "v1.5.0"
},
"doctrine/common": {
"version": "v2.9.0"
},
"doctrine/data-fixtures": {
"version": "v1.3.1"
},
"doctrine/dbal": {
"version": "v2.8.0"
},
"doctrine/doctrine-bundle": {
"version": "1.6",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "1.6",
"ref": "ae205d5114e719deb64d2110f56ef910787d1e04"
}
},
"doctrine/doctrine-cache-bundle": {
"version": "1.3.5"
},
"doctrine/doctrine-fixtures-bundle": {
"version": "3.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "3.0",
"ref": "fc52d86631a6dfd9fdf3381d0b7e3df2069e51b3"
}
},
"doctrine/doctrine-migrations-bundle": {
"version": "1.2",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "1.2",
"ref": "c1431086fec31f17fbcfe6d6d7e92059458facc1"
}
},
"doctrine/event-manager": {
"version": "v1.0.0"
},
"doctrine/inflector": {
"version": "v1.3.0"
},
"doctrine/instantiator": {
"version": "1.1.0"
},
"doctrine/lexer": {
"version": "v1.0.1"
},
"doctrine/migrations": {
"version": "v1.8.1"
},
"doctrine/orm": {
"version": "v2.6.2"
},
"doctrine/persistence": {
"version": "v1.0.1"
},
"doctrine/reflection": {
"version": "v1.0.0"
},
"easycorp/easy-log-handler": {
"version": "1.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "1.0",
"ref": "70062abc2cd58794d2a90274502f81b55cd9951b"
}
},
"egulias/email-validator": {
"version": "2.1.6"
},
"exsyst/swagger": {
"version": "v0.4.1"
},
"facebook/webdriver": {
"version": "1.6.0"
},
"fig/link-util": {
"version": "1.0.0"
},
"friendsofsymfony/rest-bundle": {
"version": "2.2",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "master",
"version": "2.2",
"ref": "258300d52be6ad59b32a888d5ddafbf9638540ff"
}
},
"friendsofsymfony/user-bundle": {
"version": "v2.1.2"
},
"fzaninotto/faker": {
"version": "v1.8.0"
},
"gedmo/doctrine-extensions": {
"version": "v2.4.36"
},
"hautelook/alice-bundle": {
"version": "2.1",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "2.1",
"ref": "71822522faf7ed2792d86b7f94ce73443358ccb9"
}
},
"imagine/imagine": {
"version": "v0.7.1"
},
"jdorn/sql-formatter": {
"version": "v1.2.17"
},
"jms/metadata": {
"version": "1.7.0"
},
"knplabs/knp-components": {
"version": "v1.3.10"
},
"knplabs/knp-menu": {
"version": "2.3.0"
},
"knplabs/knp-menu-bundle": {
"version": "v2.2.1"
},
"knplabs/knp-paginator-bundle": {
"version": "v2.8.0"
},
"liip/imagine-bundle": {
"version": "1.8",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "master",
"version": "1.8",
"ref": "523b4b0cfb88dc8637cb56e427e6be7718bdce32"
}
},
"monolog/monolog": {
"version": "1.24.0"
},
"myclabs/deep-copy": {
"version": "1.8.1"
},
"nelmio/alice": {
"version": "3.2",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "3.2",
"ref": "aaf440eb4d289ead8e2ef986c4f25c97fffec4ac"
}
},
"nelmio/api-doc-bundle": {
"version": "3.0",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "master",
"version": "3.0",
"ref": "c8e0c38e1a280ab9e37587a8fa32b251d5bc1c94"
}
},
"nikic/php-parser": {
"version": "v4.1.0"
},
"ocramius/package-versions": {
"version": "1.3.0"
},
"ocramius/proxy-manager": {
"version": "2.1.1"
},
"phpdocumentor/reflection-common": {
"version": "1.0.1"
},
"phpdocumentor/reflection-docblock": {
"version": "4.3.0"
},
"phpdocumentor/type-resolver": {
"version": "0.4.0"
},
"pixassociates/sortable-behavior-bundle": {
"version": "v1.5"
},
"psr/cache": {
"version": "1.0.1"
},
"psr/container": {
"version": "1.0.0"
},
"psr/link": {
"version": "1.0.0"
},
"psr/log": {
"version": "1.0.2"
},
"psr/simple-cache": {
"version": "1.0.1"
},
"sebastian/comparator": {
"version": "3.0.2"
},
"sebastian/diff": {
"version": "3.0.1"
},
"sebastian/exporter": {
"version": "3.1.0"
},
"sebastian/recursion-context": {
"version": "3.0.0"
},
"sensio/framework-extra-bundle": {
"version": "5.2",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "5.2",
"ref": "fb7e19da7f013d0d422fa9bce16f5c510e27609b"
}
},
"sensiolabs/security-checker": {
"version": "4.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "4.0",
"ref": "421933bf8f0e75546ac8e00cb3eb12904fa2ac1a"
}
},
"sonata-project/admin-bundle": {
"version": "3.31",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "master",
"version": "3.31",
"ref": "0e5931df1732e3dccfba42a20853049e5e9db6ae"
}
},
"sonata-project/block-bundle": {
"version": "3.12.1"
},
"sonata-project/cache": {
"version": "2.0.1"
},
"sonata-project/core-bundle": {
"version": "3.9",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "master",
"version": "3.9",
"ref": "2f69bd1995730b73a5211a9707622fb25a925df7"
}
},
"sonata-project/datagrid-bundle": {
"version": "2.4.0"
},
"sonata-project/doctrine-extensions": {
"version": "1.1.0"
},
"sonata-project/doctrine-orm-admin-bundle": {
"version": "3.6.3"
},
"sonata-project/easy-extends-bundle": {
"version": "2.5.0"
},
"sonata-project/exporter": {
"version": "1.9.1"
},
"sonata-project/user-bundle": {
"version": "4.2.3"
},
"stof/doctrine-extensions-bundle": {
"version": "1.2",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "master",
"version": "1.2",
"ref": "6c1ceb662f8997085f739cd089bfbef67f245983"
}
},
"swiftmailer/swiftmailer": {
"version": "v6.1.3"
},
"symfony/asset": {
"version": "v4.1.7"
},
"symfony/browser-kit": {
"version": "v4.1.7"
},
"symfony/cache": {
"version": "v4.1.7"
},
"symfony/config": {
"version": "v4.1.7"
},
"symfony/console": {
"version": "3.3",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "3.3",
"ref": "b5026d7ffdb43b4d66f4cc091b1e6f94e6023986"
}
},
"symfony/css-selector": {
"version": "v4.1.7"
},
"symfony/debug": {
"version": "v4.1.7"
},
"symfony/debug-bundle": {
"version": "4.1",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "4.1",
"ref": "f8863cbad2f2e58c4b65fa1eac892ab189971bea"
}
},
"symfony/debug-pack": {
"version": "v1.0.6"
},
"symfony/dependency-injection": {
"version": "v4.1.7"
},
"symfony/doctrine-bridge": {
"version": "v4.1.7"
},
"symfony/dom-crawler": {
"version": "v4.1.7"
},
"symfony/dotenv": {
"version": "v4.1.7"
},
"symfony/event-dispatcher": {
"version": "v4.1.7"
},
"symfony/expression-language": {
"version": "v4.1.7"
},
"symfony/filesystem": {
"version": "v4.1.7"
},
"symfony/finder": {
"version": "v4.1.7"
},
"symfony/flex": {
"version": "1.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "1.0",
"ref": "b96338eb5155c5b97a80e7705abf30aa09c29167"
}
},
"symfony/form": {
"version": "v4.1.7"
},
"symfony/framework-bundle": {
"version": "3.3",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "3.3",
"ref": "2230e9f42b10616b91a28d15ed3a2d984e0b6c10"
}
},
"symfony/http-foundation": {
"version": "v4.1.7"
},
"symfony/http-kernel": {
"version": "v4.1.7"
},
"symfony/inflector": {
"version": "v4.1.7"
},
"symfony/intl": {
"version": "v4.1.7"
},
"symfony/maker-bundle": {
"version": "1.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "1.0",
"ref": "fadbfe33303a76e25cb63401050439aa9b1a9c7f"
}
},
"symfony/monolog-bridge": {
"version": "v4.1.7"
},
"symfony/monolog-bundle": {
"version": "3.1",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "3.1",
"ref": "18ebf5a940573a20de06f9c4060101eeb438cf3d"
}
},
"symfony/options-resolver": {
"version": "v4.1.7"
},
"symfony/orm-pack": {
"version": "v1.0.5"
},
"symfony/panther": {
"version": "v0.2.0"
},
"symfony/phpunit-bridge": {
"version": "4.1",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "4.1",
"ref": "e637a1337f5faf0b2529b1c9a47de5e8286679f0"
}
},
"symfony/polyfill-intl-icu": {
"version": "v1.10.0"
},
"symfony/polyfill-mbstring": {
"version": "v1.10.0"
},
"symfony/polyfill-php72": {
"version": "v1.10.0"
},
"symfony/process": {
"version": "v4.1.7"
},
"symfony/profiler-pack": {
"version": "v1.0.3"
},
"symfony/property-access": {
"version": "v4.1.7"
},
"symfony/property-info": {
"version": "v4.1.7"
},
"symfony/routing": {
"version": "4.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "4.0",
"ref": "5f514d9d3b8a8aac3d62ae6a86b18b90ed0c7826"
}
},
"symfony/security": {
"version": "v4.1.7"
},
"symfony/security-acl": {
"version": "v3.0.1"
},
"symfony/security-bundle": {
"version": "3.3",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "3.3",
"ref": "f8a63faa0d9521526499c0a8f403c9964ecb0527"
}
},
"symfony/serializer": {
"version": "v4.1.7"
},
"symfony/serializer-pack": {
"version": "v1.0.1"
},
"symfony/stopwatch": {
"version": "v4.1.7"
},
"symfony/swiftmailer-bundle": {
"version": "2.5",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "2.5",
"ref": "3db029c03e452b4a23f7fc45cec7c922c2247eb8"
}
},
"symfony/templating": {
"version": "v4.1.7"
},
"symfony/test-pack": {
"version": "v1.0.4"
},
"symfony/translation": {
"version": "3.3",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "3.3",
"ref": "1fb02a6e1c8f3d4232cce485c9afa868d63b115a"
}
},
"symfony/twig-bridge": {
"version": "v4.1.7"
},
"symfony/twig-bundle": {
"version": "3.3",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "3.3",
"ref": "369b5b29dc52b2c190002825ae7ec24ab6f962dd"
}
},
"symfony/validator": {
"version": "4.1",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "4.1",
"ref": "0cdc982334f45d554957a6167e030482795bf9d7"
}
},
"symfony/var-dumper": {
"version": "v4.1.7"
},
"symfony/web-link": {
"version": "v4.1.7"
},
"symfony/web-profiler-bundle": {
"version": "3.3",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "3.3",
"ref": "6bdfa1a95f6b2e677ab985cd1af2eae35d62e0f6"
}
},
"symfony/web-server-bundle": {
"version": "3.3",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "3.3",
"ref": "dae9b39fd6717970be7601101ce5aa960bf53d9a"
}
},
"symfony/webpack-encore-bundle": {
"version": "1.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "1.0",
"ref": "4c97a884bc54a4e66bb2d0785ca855141880b6a8"
}
},
"symfony/yaml": {
"version": "v4.1.7"
},
"theofidry/alice-data-fixtures": {
"version": "1.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "1.0",
"ref": "fe5a50faf580eb58f08ada2abe8afbd2d4941e05"
}
},
"twig/extensions": {
"version": "1.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "1.0",
"ref": "ddb2e0a77773b7fd75d8d649545f174e664500ab"
}
},
"twig/twig": {
"version": "v2.5.0"
},
"vich/uploader-bundle": {
"version": "1.5",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "master",
"version": "1.5",
"ref": "c4f5755b37fb65b9c6a3cbdae91205c15a137ed4"
}
},
"webmozart/assert": {
"version": "1.3.0"
},
"willdurand/jsonp-callback-validator": {
"version": "v1.1.0"
},
"willdurand/negotiation": {
"version": "v2.3.1"
},
"zendframework/zend-code": {
"version": "3.3.1"
},
"zendframework/zend-eventmanager": {
"version": "3.2.1"
},
"zircote/swagger-php": {
"version": "2.0.13"
}
}
{% extends 'base.html.twig' %}
{% block title %}Hello {{ controller_name }}!{% endblock %}
{% block body %}
<style>
.example-wrapper { margin: 1em auto; max-width: 800px; width: 95%; font: 18px/1.5 sans-serif; }
.example-wrapper code { background: #F5F5F5; padding: 2px 6px; }
</style>
<div class="example-wrapper">
<h1>Hello {{ controller_name }}! ✅</h1>
This friendly message is coming from:
<ul>
<li>Your controller at <code><a href="{{ 'src/Controller/AdminController.php'|file_link(0) }}">src/Controller/AdminController.php</a></code></li>
<li>Your template at <code><a href="{{ 'templates/admin/index.html.twig'|file_link(0) }}">templates/admin/index.html.twig</a></code></li>
</ul>
</div>
{% endblock %}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>{% block title %}Welcome!{% endblock %}</title>
{% block stylesheets %}{% endblock %}
</head>
<body>
{% block body %}{% endblock %}
{% block javascripts %}{% endblock %}
</body>
</html>
{% extends 'base.html.twig' %}
{% block title %}Hello {{ controller_name }}!{% endblock %}
{% block body %}
<style>
.example-wrapper { margin: 1em auto; max-width: 800px; width: 95%; font: 18px/1.5 sans-serif; }
.example-wrapper code { background: #F5F5F5; padding: 2px 6px; }
</style>
<div class="example-wrapper">
<h1>Helloa {{ controller_name }}! ✅</h1>
{# TRANSLATION :
{% trans %}Hello %name%{% endtrans %}
{% transchoice count %}
{0} There are no apples|{1} There is one apple|]1,Inf[ There are %count% apples
{% endtranschoice %} #}
This friendly message is coming from:
<ul>
<li>Your controller at <code><a href="{{ 'src/Controller/IndexController.php'|file_link(0) }}">src/Controller/IndexController.php</a></code></li>
<li>Your template at <code><a href="{{ 'templates/index/index.html.twig'|file_link(0) }}">templates/index/index.html.twig</a></code></li>
</ul>
</div>
{% endblock %}
layout.logged_in_as: 'Se connecter en tant que'
layout.logout: 'Se déconnecter'
layout.login: 'Se connecter'
security.login.username: Email
security.login.password: 'Mot de passe'
security.login.remember_me: 'Se souvenir de moi'
security.login.submit: 'Se connecter'
form.current_password: 'Mot de passe actuel'
form.new_password: 'Nouveau mot de passe'
form.new_password_confirmation: 'Confirmer le mot de passe'
change_password.submit: Confirmer
app.admin.group.adherent: Adherent
app.admin.group.prestataire: Prestataire
app.admin.group.groupe: Groupe
app.admin.group.adherent: Adherent
app.admin.group.prestataire: Prestataire
app.admin.group.groupe: Groupe
move_to_bottom: 'Tout en bas'
move_down: '+ bas'
move_up: '+ haut'
move_to_top: 'Tout en haut'
Commentaires: Commentaires
app.admin.group.adherent: Adherent
app.admin.group.prestataire: Prestataire
app.admin.group.groupe: Groupe
var Encore = require('@symfony/webpack-encore');
var webpack = require('webpack');
Encore
// directory where compiled assets will be stored
.setOutputPath('public/build/')
// public path used by the web server to access the output path
.setPublicPath('/build')
// only needed for CDN's or sub-directory deploy
//.setManifestKeyPrefix('build/')
/*
* ENTRY CONFIG
*
* Add 1 entry for each "page" of your app
* (including one that's included on every page - e.g. "app")
*
* Each entry will result in one JavaScript file (e.g. app.js)
* and one CSS file (e.g. app.css) if you JavaScript imports CSS.
*/
.addEntry('app', './assets/js/app.js')
//.addEntry('page1', './assets/js/page1.js')
//.addEntry('page2', './assets/js/page2.js')
// will require an extra script tag for runtime.js
// but, you probably want this, unless you're building a single-page app
.enableSingleRuntimeChunk()
/*
* FEATURE CONFIG
*
* Enable & configure other features below. For a full
* list of features, see:
* https://symfony.com/doc/current/frontend.html#adding-more-features
*/
.addPlugin(new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery',
Popper: ['popper.js', 'default']
}))
.cleanupOutputBeforeBuild()
.enableBuildNotifications()
.enableSourceMaps(!Encore.isProduction())
// enables hashed filenames (e.g. app.abc123.css)
.enableVersioning(Encore.isProduction())
// enables Sass/SCSS support
.enableSassLoader()
// uncomment if you use TypeScript
//.enableTypeScriptLoader()
// uncomment if you're having problems with a jQuery plugin
.autoProvidejQuery()
;
module.exports = Encore.getWebpackConfig();
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment