From 9b277ac551dc22c64b56992e2ec6d7a2808f0c40 Mon Sep 17 00:00:00 2001 From: GSadee Date: Tue, 13 Apr 2021 11:09:23 +0200 Subject: [PATCH 1/4] Upgrade to Sylius 1.8 --- .github/workflows/build.yml | 3 +- composer.json | 6 +- .../SyliusAdminOrderCreationExtension.php | 34 +- .../Migrations}/Version20180626065141.php | 2 +- .../Migrations}/Version20180709120541.php | 2 +- tests/Application/.env | 6 + tests/Application/.env.test | 6 + tests/Application/config/bundles.php | 4 + tests/Application/config/jwt/private-test.pem | 51 +++ tests/Application/config/jwt/public-test.pem | 14 + .../Application/config/packages/_sylius.yaml | 2 + .../config/packages/doctrine_migrations.yaml | 9 +- .../packages/lexik_jwt_authentication.yaml | 4 + .../Application/config/packages/security.yaml | 54 ++- .../Application/config/routes/sylius_api.yaml | 3 + tests/Application/src/Migrations/.gitkeep | 0 .../src/Migrations/Version20170912085504.php | 360 ------------------ .../src/Migrations/Version20170913125128.php | 57 --- .../src/Migrations/Version20171003103916.php | 110 ------ .../src/Migrations/Version20180102140039.php | 30 -- .../src/Migrations/Version20190109095211.php | 34 -- .../src/Migrations/Version20190109160409.php | 30 -- .../src/Migrations/Version20190508083953.php | 39 -- .../src/Migrations/Version20190621035710.php | 36 -- .../src/Migrations/Version20191119131635.php | 25 -- .../src/Migrations/Version20200301170604.php | 45 --- .../src/Migrations/Version20200916093101.php | 32 -- 27 files changed, 181 insertions(+), 817 deletions(-) rename {migrations => src/Migrations}/Version20180626065141.php (95%) rename {migrations => src/Migrations}/Version20180709120541.php (95%) create mode 100644 tests/Application/config/jwt/private-test.pem create mode 100644 tests/Application/config/jwt/public-test.pem create mode 100644 tests/Application/config/packages/lexik_jwt_authentication.yaml create mode 100644 tests/Application/config/routes/sylius_api.yaml create mode 100644 tests/Application/src/Migrations/.gitkeep delete mode 100644 tests/Application/src/Migrations/Version20170912085504.php delete mode 100644 tests/Application/src/Migrations/Version20170913125128.php delete mode 100644 tests/Application/src/Migrations/Version20171003103916.php delete mode 100644 tests/Application/src/Migrations/Version20180102140039.php delete mode 100644 tests/Application/src/Migrations/Version20190109095211.php delete mode 100644 tests/Application/src/Migrations/Version20190109160409.php delete mode 100644 tests/Application/src/Migrations/Version20190508083953.php delete mode 100644 tests/Application/src/Migrations/Version20190621035710.php delete mode 100644 tests/Application/src/Migrations/Version20191119131635.php delete mode 100644 tests/Application/src/Migrations/Version20200301170604.php delete mode 100644 tests/Application/src/Migrations/Version20200916093101.php diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 341c424e..9a211b97 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ jobs: matrix: php: [7.3, 7.4] symfony: [^4.4] - sylius: [~1.7.0] + sylius: [~1.8.0] node: [10.x] mysql: [5.7, 8.0] @@ -130,7 +130,6 @@ jobs: - name: Prepare test application database run: | - (cp migrations/* tests/Application/src/Migrations/) (cd tests/Application && bin/console doctrine:database:create -vvv) (cd tests/Application && bin/console doctrine:migrations:migrate -n -vvv -q) diff --git a/composer.json b/composer.json index f2b0c04f..5481282e 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "require": { "php": "^7.3", - "sylius/sylius": "^1.7", + "sylius/sylius": "^1.8", "friendsofsymfony/jsrouting-bundle": "^2.2" }, "require-dev": { @@ -38,8 +38,8 @@ "friends-of-behat/variadic-extension": "^1.1", "lakion/mink-debug-extension": "^1.2.3", "phpspec/phpspec": "^6.1", - "phpstan/phpstan-shim": "^0.11", - "phpstan/phpstan-webmozart-assert": "^0.11", + "phpstan/phpstan": "0.12.29", + "phpstan/phpstan-webmozart-assert": "0.12.6", "phpunit/phpunit": "^6.5", "se/selenium-server-standalone": "^2.52", "sylius-labs/coding-standard": "^3.0", diff --git a/src/DependencyInjection/SyliusAdminOrderCreationExtension.php b/src/DependencyInjection/SyliusAdminOrderCreationExtension.php index cd7fe367..742b4a7a 100644 --- a/src/DependencyInjection/SyliusAdminOrderCreationExtension.php +++ b/src/DependencyInjection/SyliusAdminOrderCreationExtension.php @@ -4,19 +4,43 @@ namespace Sylius\AdminOrderCreationPlugin\DependencyInjection; +use Sylius\Bundle\CoreBundle\DependencyInjection\PrependDoctrineMigrationsTrait; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Extension\Extension; +use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -final class SyliusAdminOrderCreationExtension extends Extension +final class SyliusAdminOrderCreationExtension extends Extension implements PrependExtensionInterface { - /** - * {@inheritdoc} - */ + use PrependDoctrineMigrationsTrait; + public function load(array $config, ContainerBuilder $container): void { - $config = $this->processConfiguration($this->getConfiguration([], $container), $config); + $this->processConfiguration($this->getConfiguration([], $container), $config); $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); } + + public function prepend(ContainerBuilder $container): void + { + $this->prependDoctrineMigrations($container); + } + + protected function getMigrationsNamespace(): string + { + return 'Sylius\AdminOrderCreationPlugin\Migrations'; + } + + protected function getMigrationsDirectory(): string + { + return '@SyliusAdminOrderCreationPlugin/Migrations'; + } + + protected function getNamespacesOfMigrationsExecutedBefore(): array + { + return [ + 'Sylius\Bundle\CoreBundle\Migrations', + 'Sylius\Bundle\AdminApiBundle\Migrations', + ]; + } } diff --git a/migrations/Version20180626065141.php b/src/Migrations/Version20180626065141.php similarity index 95% rename from migrations/Version20180626065141.php rename to src/Migrations/Version20180626065141.php index f989bf65..bcf4f72c 100644 --- a/migrations/Version20180626065141.php +++ b/src/Migrations/Version20180626065141.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace DoctrineMigrations; +namespace Sylius\AdminOrderCreationPlugin\Migrations; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; diff --git a/migrations/Version20180709120541.php b/src/Migrations/Version20180709120541.php similarity index 95% rename from migrations/Version20180709120541.php rename to src/Migrations/Version20180709120541.php index 17d08e22..e6ead16d 100644 --- a/migrations/Version20180709120541.php +++ b/src/Migrations/Version20180709120541.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace DoctrineMigrations; +namespace Sylius\AdminOrderCreationPlugin\Migrations; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; diff --git a/tests/Application/.env b/tests/Application/.env index 68d282b5..d54b1929 100644 --- a/tests/Application/.env +++ b/tests/Application/.env @@ -21,3 +21,9 @@ DATABASE_URL=mysql://root@127.0.0.1/sylius_admin_order_creation_plugin_%kernel.e # Delivery is disabled by default via "null://localhost" MAILER_URL=smtp://localhost ###< symfony/swiftmailer-bundle ### + +###> lexik/jwt-authentication-bundle ### +JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem +JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem +JWT_PASSPHRASE=YOUR_SECRET_PASSPHRASE +###< lexik/jwt-authentication-bundle ### diff --git a/tests/Application/.env.test b/tests/Application/.env.test index bf8fc4e0..c74ebd71 100644 --- a/tests/Application/.env.test +++ b/tests/Application/.env.test @@ -1,3 +1,9 @@ APP_SECRET='ch4mb3r0f5ecr3ts' KERNEL_CLASS='Tests\Sylius\AdminOrderCreationPlugin\Application\Kernel' + +###> lexik/jwt-authentication-bundle ### +JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private-test.pem +JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public-test.pem +JWT_PASSPHRASE=ALL_THAT_IS_GOLD_DOES_NOT_GLITTER_NOT_ALL_THOSE_WHO_WANDER_ARE_LOST +###< lexik/jwt-authentication-bundle ### diff --git a/tests/Application/config/bundles.php b/tests/Application/config/bundles.php index d75a2181..ce72cc03 100644 --- a/tests/Application/config/bundles.php +++ b/tests/Application/config/bundles.php @@ -55,4 +55,8 @@ Sylius\AdminOrderCreationPlugin\SyliusAdminOrderCreationPlugin::class => ['all' => true], FriendsOfBehat\SymfonyExtension\Bundle\FriendsOfBehatSymfonyExtensionBundle::class => ['test' => true, 'test_cached' => true], FOS\JsRoutingBundle\FOSJsRoutingBundle::class => ['all' => true], + ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true], + Sylius\Bundle\ApiBundle\SyliusApiBundle::class => ['all' => true], + Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle::class => ['all' => true], + SyliusLabs\DoctrineMigrationsExtraBundle\SyliusLabsDoctrineMigrationsExtraBundle::class => ['all' => true], ]; diff --git a/tests/Application/config/jwt/private-test.pem b/tests/Application/config/jwt/private-test.pem new file mode 100644 index 00000000..b5a5246d --- /dev/null +++ b/tests/Application/config/jwt/private-test.pem @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKAIBAAKCAgEAxuS1SudSNkjTQcP4H5SjzrdO29upko9KYZgUH6z5n+weDtIo +5tysdm7xY3nNAU9ixo7wrBvttuf7T1fDCVJjhzqX5iewaCZks7q9kYygCbvmrAoc +bx5D9EPZPH0sQQoa9gMuNou2nqWpVdTYCMAjxzVpqa2krioUzkBJzaWGDYiijv9q +KbjWvRUUoYFNOFIFXHFFDrK5ISBC155XiETKyBYhB1wZVWX1tHe1nDW609BHAAsr +1Ve3uiodzYzQ7S9Rw9Q6RCRSRgZRzFV1GTJEuyMpCCD51DA4otYeEPQf+8hvV3aK +bSNydzrQICY95kfB0p9HxorBPh8QHq0qKZOIle1Aglp0UV3OWgXLWncNc0m8e8hT +2I55lYkLio99/4PGfalAdJBPhKtTzbJllaERHOnlMkEvwk7eggkbbXEN/Ay6usi0 +R8mRaxhMkS9i8MxubgQBDsOomtegRqA1EzSGU/FJMS5g/I/gO9bjFu2l2LJwd6B4 +t/FZt/9mAIGYbIj5/Ykd0E1WIKYAIRUoyW1gTrGe70yxdHEPEILnZZMRVJzDbkVY +fgKAFUpAUqbHTtS+YI6p9tjFuxBrc6GZR/kppL/MkEARDX0ZX3n4sPLQf/vdR7+K +s8Yqws1IqsZ3h8iP8WpykbEwnd1w49A1ZBBinIXU3idf41EtQgawbpK5Oy0CAwEA +AQKCAgAEdUnvBOJd3yIFHlxocM9/KbK10OWrKFUVfPAuiZUK1aMS1/kcu6OOAAyf +GzLSLbJcGwYgBXw9llOWwrPXeKZMeK7A9PDKVNn7AVuQcKOBtFmGT6+1eesyBXdQ +GMouJwjVrNqTVGxif/oct2mkQJJMu9DDgeXoFX9j5CMDXgt0MDTcmbMKfl8p29gb +iqdtdME0AkH3A2CM8oktBhqWLlyRQZW58YGL3X41bl1+w+GNL+T3hkiUPqQaoykJ +23cvadkeV5p6vomtkiSxPNUkHHFX9IDN8tdGv1H1rHD+FkrFPQfp4PlXWu0M6R+T +KOhISiF5FCLqu197gfy9g0onpmvwTkQW0ap5kTMfmryhc2fSbGeQO1bDjnCQQ05/ +yXpu9dRvQQCbXsAIUaJUyOsgJy4tpOlmra9mFK0/+ObN7ZJDxYA1tHPKoArcSFnC +L0nbMs7C5b5Njky10nD6d1hu+HBEB1g6wBmsOCEMNBd6AF9ABmA/TIGSS2rsjdf6 +eYytYSAlSVlYwel3mvtpwfq5/q1mPtr38ND192/FDCMoVWoUbpYTKQHvAYdodOyS +DJNH6upchKdCMItv6K6rv4Rc+lN9lp/XGYlxO8BpXVO+IF/dD+6Rs5vv3Hk5lU3D +aX/ALBTTN1Xe8JKaCHd4ji1rgsIOxRmXDqdy05kiQtt7LtkCDQKCAQEA5Xw9EjXw +Wsb42j+Ew3ISAC92VBIBmSz6hnwX27vON51Bm3j86LV1GHl0PvEl0A7c46+scumG +pKgY5qad1Z7FtyCi78a9cr7HVbX03QndFZpzD14oIugN7y3ecSppPI/hfmOwfOAa +O8b2lg2A6s4QBG70SAGFVeTozxovL/V4EWly/NW/2gAe6ZAWU8c3XyJBMMhA5Ez8 +aZONHipHi+uAiOwsLth7rGZbjyF4/QpXJuKzZ8p8e43yJiCkV7F588akp13NDmIB +qXHNLEUcE1SD4GGoFGEacOkVkXO5Bqyn15LACjyluhhzsl5IWdClRUfjgbg3ieWO +wdHq3bL6TgFuBwKCAQEA3d+drcpzMUOJRrDr08yNr6ygkeIvRtX7De3ilhg0Y3G3 +L2/rexfe1i5yrSc5N5hTWjLOSUtT4AD4tIgvNwW4YRtdQ9eRr/aoFHy5w8oXm0z5 +TJta7yBgcXTc4xQE9XtVEL0OUOKXxrh+Y5HHh5do5blsNfutHqRjtKWvPp1kCHba +GjMiLkleivE4WGMkuBXPa13GUe3UfxOQp3KfaNcWAlNhnbc/8ljQJ1YZEj3XDodB +RvorGzw8m8U+yZ/rhslPiq2MD0IrKUg5/r1C8k6ZVTrcG82A3Su1gacpS4b3q84W +r1AwM3iajzBnPkiRc98H7p07vwYCeLV2Lm/w/LZAKwKCAQEAqx0HYKPNk7KXbg08 +zoso9vBs9+TxQijyqQKwu4x/CKL+f5IoatCa/mPZlPE0872RYUjlek28stwQrTOB +rv6TiKgSNl3ndz7f3X4ulf671lbzAnt/y/9iHH0ERzeLfrf+OMLWn1Zu2THTPjHV +db+u289r4KEZreFg4sQweT88hycssXAkfMXoRtnEfDWoiQw+tcQr9s+cypBWAi8e +aCtzDSWlEE0lcnhkPwaDc5KZR4p0oaivR2WhMGLYh/by6x2sOovL0bSsbo9HoIHr +nFJBfzbyIDgDgjuadHlodpyZDjoDbd6o6GlBI7f/lNDp2w3uixQ0fWMpHkaLLUI+ +N5oDUwKCAQAIjvemHIkU/WXuNCTkpp9Qh3gqKG9qbBajEuoKoCRlMZ2/VrHera0K +1f/Wbgzm+Bk/AXaznRQ/L8poLFil5rKWDFgspcQY5YrWP3lq9AC1HOMA8X0wfC88 +MSXUHJGUZo2Bd8l1lUgFglhdvuHTeSOyuNRTwMGMzQqLjViVMb0KFouTNyW6Y1oi +QevKfQiNkUnO+m8L+gCYZkjOLL25bZKLxGufidINpx9gZRHSglApX05FTqEbC9fK +qnEhlemf6WQIFWmxrPu9O+wAx4wtjJqdjweuit7NqUH3HluZbjtfhTOaz50MXzqX +C2bwIBx8O74ylh4X4EN4JIfKgsbo+J7BAoIBAAJ72s6YSoHaQCYXynLhRGenVHtI +rj6wNkwnBEsIDk9j8vt5fMJA1xRNZ0kA1mDAgDqq9ad2RpGcZH1jjvI5IPdB0dKE +5fyKR5okRMNRMc2Sn5LOiLsSqnhHwZo1nEZP/UTcZvIKDqajy8t4cIvBEO1ol4D5 +DxiclH7UMAgwKemYbsBHOOscbN2Z3o41uzSKUhNlLV5GP3ZPMau+MHinIXtCjHdi +Xu9eGA3GDD4/sU4JZTl1g/Rs48JEn2H800pVgyzkn9Q01hJZ0dSqy+Agcu3Yw6Sr +XRaqXN38pEInJ+GAU6y+6/RsiHdF3YOOUOPUX6PCfu8BMLRFASAdMbwNBXk= +-----END RSA PRIVATE KEY----- diff --git a/tests/Application/config/jwt/public-test.pem b/tests/Application/config/jwt/public-test.pem new file mode 100644 index 00000000..e21c0559 --- /dev/null +++ b/tests/Application/config/jwt/public-test.pem @@ -0,0 +1,14 @@ +-----BEGIN PUBLIC KEY----- +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxuS1SudSNkjTQcP4H5Sj +zrdO29upko9KYZgUH6z5n+weDtIo5tysdm7xY3nNAU9ixo7wrBvttuf7T1fDCVJj +hzqX5iewaCZks7q9kYygCbvmrAocbx5D9EPZPH0sQQoa9gMuNou2nqWpVdTYCMAj +xzVpqa2krioUzkBJzaWGDYiijv9qKbjWvRUUoYFNOFIFXHFFDrK5ISBC155XiETK +yBYhB1wZVWX1tHe1nDW609BHAAsr1Ve3uiodzYzQ7S9Rw9Q6RCRSRgZRzFV1GTJE +uyMpCCD51DA4otYeEPQf+8hvV3aKbSNydzrQICY95kfB0p9HxorBPh8QHq0qKZOI +le1Aglp0UV3OWgXLWncNc0m8e8hT2I55lYkLio99/4PGfalAdJBPhKtTzbJllaER +HOnlMkEvwk7eggkbbXEN/Ay6usi0R8mRaxhMkS9i8MxubgQBDsOomtegRqA1EzSG +U/FJMS5g/I/gO9bjFu2l2LJwd6B4t/FZt/9mAIGYbIj5/Ykd0E1WIKYAIRUoyW1g +TrGe70yxdHEPEILnZZMRVJzDbkVYfgKAFUpAUqbHTtS+YI6p9tjFuxBrc6GZR/kp +pL/MkEARDX0ZX3n4sPLQf/vdR7+Ks8Yqws1IqsZ3h8iP8WpykbEwnd1w49A1ZBBi +nIXU3idf41EtQgawbpK5Oy0CAwEAAQ== +-----END PUBLIC KEY----- diff --git a/tests/Application/config/packages/_sylius.yaml b/tests/Application/config/packages/_sylius.yaml index 1a08ea4e..15e3c56e 100644 --- a/tests/Application/config/packages/_sylius.yaml +++ b/tests/Application/config/packages/_sylius.yaml @@ -6,6 +6,8 @@ imports: - { resource: "@SyliusShopBundle/Resources/config/app/config.yml" } + - { resource: "@SyliusApiBundle/Resources/config/app/config.yaml" } + - { resource: "@SyliusAdminOrderCreationPlugin/Resources/config/app/config.yml" } parameters: diff --git a/tests/Application/config/packages/doctrine_migrations.yaml b/tests/Application/config/packages/doctrine_migrations.yaml index c0a12026..c2456bfd 100644 --- a/tests/Application/config/packages/doctrine_migrations.yaml +++ b/tests/Application/config/packages/doctrine_migrations.yaml @@ -1,5 +1,6 @@ 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 + storage: + table_storage: + table_name: sylius_migrations + migrations_paths: + 'DoctrineMigrations': '%kernel.project_dir%/src/Migrations' diff --git a/tests/Application/config/packages/lexik_jwt_authentication.yaml b/tests/Application/config/packages/lexik_jwt_authentication.yaml new file mode 100644 index 00000000..edfb69dc --- /dev/null +++ b/tests/Application/config/packages/lexik_jwt_authentication.yaml @@ -0,0 +1,4 @@ +lexik_jwt_authentication: + secret_key: '%env(resolve:JWT_SECRET_KEY)%' + public_key: '%env(resolve:JWT_PUBLIC_KEY)%' + pass_phrase: '%env(JWT_PASSPHRASE)%' diff --git a/tests/Application/config/packages/security.yaml b/tests/Application/config/packages/security.yaml index 4381c070..bed15100 100644 --- a/tests/Application/config/packages/security.yaml +++ b/tests/Application/config/packages/security.yaml @@ -1,7 +1,14 @@ parameters: - sylius.security.admin_regex: "^/admin" + sylius.security.admin_regex: "^/%sylius_admin.path_name%" sylius.security.api_regex: "^/api" - sylius.security.shop_regex: "^/(?!admin|api/.*|api$|media/.*)[^/]++" + sylius.security.shop_regex: "^/(?!%sylius_admin.path_name%|new-api|api/.*|api$|media/.*)[^/]++" + sylius.security.new_api_route: "/new-api" + sylius.security.new_api_regex: "^%sylius.security.new_api_route%" + sylius.security.new_api_admin_route: "%sylius.security.new_api_route%/admin" + sylius.security.new_api_admin_regex: "^%sylius.security.new_api_admin_route%" + sylius.security.new_api_shop_route: "%sylius.security.new_api_route%/shop" + sylius.security.new_api_shop_regex: "^%sylius.security.new_api_shop_route%" + security: providers: @@ -9,8 +16,14 @@ security: id: sylius.admin_user_provider.email_or_name_based sylius_shop_user_provider: id: sylius.shop_user_provider.email_or_name_based + sylius_api_admin_user_provider: + id: sylius.admin_user_provider.email_or_name_based + sylius_api_shop_user_provider: + id: sylius.shop_user_provider.email_or_name_based + encoders: Sylius\Component\User\Model\UserInterface: argon2i + firewalls: admin: switch_user: true @@ -30,7 +43,7 @@ security: csrf_token_id: admin_authenticate remember_me: secret: "%env(APP_SECRET)%" - path: /admin + path: "/%sylius_admin.path_name%" name: APP_ADMIN_REMEMBER_ME lifetime: 31536000 remember_me_parameter: _remember_me @@ -50,6 +63,36 @@ security: stateless: true anonymous: true + new_api_admin_user: + pattern: "%sylius.security.new_api_admin_regex%/.*" + provider: sylius_api_admin_user_provider + stateless: true + anonymous: true + json_login: + check_path: "%sylius.security.new_api_admin_route%/authentication-token" + username_path: email + password_path: password + success_handler: lexik_jwt_authentication.handler.authentication_success + failure_handler: lexik_jwt_authentication.handler.authentication_failure + guard: + authenticators: + - lexik_jwt_authentication.jwt_token_authenticator + + new_api_shop_user: + pattern: "%sylius.security.new_api_shop_regex%/.*" + provider: sylius_api_shop_user_provider + stateless: true + anonymous: true + json_login: + check_path: "%sylius.security.new_api_shop_route%/authentication-token" + username_path: email + password_path: password + success_handler: lexik_jwt_authentication.handler.authentication_success + failure_handler: lexik_jwt_authentication.handler.authentication_failure + guard: + authenticators: + - lexik_jwt_authentication.jwt_token_authenticator + shop: switch_user: { role: ROLE_ALLOWED_TO_SWITCH } context: shop @@ -100,3 +143,8 @@ security: - { path: "%sylius.security.admin_regex%", role: ROLE_ADMINISTRATION_ACCESS } - { path: "%sylius.security.api_regex%/.*", role: ROLE_API_ACCESS } - { path: "%sylius.security.shop_regex%/account", role: ROLE_USER } + + - { path: "%sylius.security.new_api_admin_regex%/.*", role: ROLE_API_ACCESS } + - { path: "%sylius.security.new_api_shop_regex%/.*", role: IS_AUTHENTICATED_ANONYMOUSLY } + - { path: "%sylius.security.new_api_admin_route%/authentication-token", role: IS_AUTHENTICATED_ANONYMOUSLY } + - { path: "%sylius.security.new_api_shop_route%/authentication-token", role: IS_AUTHENTICATED_ANONYMOUSLY } diff --git a/tests/Application/config/routes/sylius_api.yaml b/tests/Application/config/routes/sylius_api.yaml new file mode 100644 index 00000000..ae01ffce --- /dev/null +++ b/tests/Application/config/routes/sylius_api.yaml @@ -0,0 +1,3 @@ +sylius_api: + resource: "@SyliusApiBundle/Resources/config/routing.yml" + prefix: "%sylius.security.new_api_route%" diff --git a/tests/Application/src/Migrations/.gitkeep b/tests/Application/src/Migrations/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/tests/Application/src/Migrations/Version20170912085504.php b/tests/Application/src/Migrations/Version20170912085504.php deleted file mode 100644 index 2f9bf97f..00000000 --- a/tests/Application/src/Migrations/Version20170912085504.php +++ /dev/null @@ -1,360 +0,0 @@ -abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); - - $this->addSql('CREATE TABLE sylius_adjustment (id INT AUTO_INCREMENT NOT NULL, order_id INT DEFAULT NULL, order_item_id INT DEFAULT NULL, order_item_unit_id INT DEFAULT NULL, type VARCHAR(255) NOT NULL, `label` VARCHAR(255) DEFAULT NULL, amount INT NOT NULL, is_neutral TINYINT(1) NOT NULL, is_locked TINYINT(1) NOT NULL, origin_code VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, INDEX IDX_ACA6E0F28D9F6D38 (order_id), INDEX IDX_ACA6E0F2E415FB15 (order_item_id), INDEX IDX_ACA6E0F2F720C233 (order_item_unit_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_currency (id INT AUTO_INCREMENT NOT NULL, code VARCHAR(3) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_96EDD3D077153098 (code), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_exchange_rate (id INT AUTO_INCREMENT NOT NULL, source_currency INT NOT NULL, target_currency INT NOT NULL, ratio NUMERIC(10, 5) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, INDEX IDX_5F52B852A76BEED (source_currency), INDEX IDX_5F52B85B3FD5856 (target_currency), UNIQUE INDEX UNIQ_5F52B852A76BEEDB3FD5856 (source_currency, target_currency), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_locale (id INT AUTO_INCREMENT NOT NULL, code VARCHAR(12) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_7BA1286477153098 (code), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_product_association (id INT AUTO_INCREMENT NOT NULL, association_type_id INT NOT NULL, product_id INT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, INDEX IDX_48E9CDABB1E1C39 (association_type_id), INDEX IDX_48E9CDAB4584665A (product_id), UNIQUE INDEX product_association_idx (product_id, association_type_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_product_association_product (association_id INT NOT NULL, product_id INT NOT NULL, INDEX IDX_A427B983EFB9C8A5 (association_id), INDEX IDX_A427B9834584665A (product_id), PRIMARY KEY(association_id, product_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_product_association_type (id INT AUTO_INCREMENT NOT NULL, code VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_CCB8914C77153098 (code), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_product_association_type_translation (id INT AUTO_INCREMENT NOT NULL, translatable_id INT NOT NULL, name VARCHAR(255) DEFAULT NULL, locale VARCHAR(255) NOT NULL, INDEX IDX_4F618E52C2AC5D3 (translatable_id), UNIQUE INDEX sylius_product_association_type_translation_uniq_trans (translatable_id, locale), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_product_attribute (id INT AUTO_INCREMENT NOT NULL, code VARCHAR(255) NOT NULL, type VARCHAR(255) NOT NULL, storage_type VARCHAR(255) NOT NULL, configuration LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\', created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, position INT NOT NULL, UNIQUE INDEX UNIQ_BFAF484A77153098 (code), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_product_attribute_translation (id INT AUTO_INCREMENT NOT NULL, translatable_id INT NOT NULL, name VARCHAR(255) NOT NULL, locale VARCHAR(255) NOT NULL, INDEX IDX_93850EBA2C2AC5D3 (translatable_id), UNIQUE INDEX sylius_product_attribute_translation_uniq_trans (translatable_id, locale), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_product_attribute_value (id INT AUTO_INCREMENT NOT NULL, product_id INT NOT NULL, attribute_id INT NOT NULL, locale_code VARCHAR(255) NOT NULL, text_value LONGTEXT DEFAULT NULL, boolean_value TINYINT(1) DEFAULT NULL, integer_value INT DEFAULT NULL, float_value DOUBLE PRECISION DEFAULT NULL, datetime_value DATETIME DEFAULT NULL, date_value DATE DEFAULT NULL, json_value LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json_array)\', INDEX IDX_8A053E544584665A (product_id), INDEX IDX_8A053E54B6E62EFA (attribute_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_product_option (id INT AUTO_INCREMENT NOT NULL, code VARCHAR(255) NOT NULL, position INT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_E4C0EBEF77153098 (code), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_product_option_translation (id INT AUTO_INCREMENT NOT NULL, translatable_id INT NOT NULL, name VARCHAR(255) NOT NULL, locale VARCHAR(255) NOT NULL, INDEX IDX_CBA491AD2C2AC5D3 (translatable_id), UNIQUE INDEX sylius_product_option_translation_uniq_trans (translatable_id, locale), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_product_option_value (id INT AUTO_INCREMENT NOT NULL, option_id INT NOT NULL, code VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_F7FF7D4B77153098 (code), INDEX IDX_F7FF7D4BA7C41D6F (option_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_product_option_value_translation (id INT AUTO_INCREMENT NOT NULL, translatable_id INT NOT NULL, value VARCHAR(255) NOT NULL, locale VARCHAR(255) NOT NULL, INDEX IDX_8D4382DC2C2AC5D3 (translatable_id), UNIQUE INDEX sylius_product_option_value_translation_uniq_trans (translatable_id, locale), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_product_variant_translation (id INT AUTO_INCREMENT NOT NULL, translatable_id INT NOT NULL, name VARCHAR(255) DEFAULT NULL, locale VARCHAR(255) NOT NULL, INDEX IDX_8DC18EDC2C2AC5D3 (translatable_id), UNIQUE INDEX sylius_product_variant_translation_uniq_trans (translatable_id, locale), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_tax_category (id INT AUTO_INCREMENT NOT NULL, code VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_221EB0BE77153098 (code), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_shipping_category (id INT AUTO_INCREMENT NOT NULL, code VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_B1D6465277153098 (code), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_shipping_method_translation (id INT AUTO_INCREMENT NOT NULL, translatable_id INT NOT NULL, name VARCHAR(255) NOT NULL, description VARCHAR(255) DEFAULT NULL, locale VARCHAR(255) NOT NULL, INDEX IDX_2B37DB3D2C2AC5D3 (translatable_id), UNIQUE INDEX sylius_shipping_method_translation_uniq_trans (translatable_id, locale), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_payment_method_translation (id INT AUTO_INCREMENT NOT NULL, translatable_id INT NOT NULL, name VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, instructions LONGTEXT DEFAULT NULL, locale VARCHAR(255) NOT NULL, INDEX IDX_966BE3A12C2AC5D3 (translatable_id), UNIQUE INDEX sylius_payment_method_translation_uniq_trans (translatable_id, locale), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_promotion_action (id INT AUTO_INCREMENT NOT NULL, promotion_id INT DEFAULT NULL, type VARCHAR(255) NOT NULL, configuration LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\', INDEX IDX_933D0915139DF194 (promotion_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_promotion_rule (id INT AUTO_INCREMENT NOT NULL, promotion_id INT DEFAULT NULL, type VARCHAR(255) NOT NULL, configuration LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\', INDEX IDX_2C188EA8139DF194 (promotion_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_address_log_entries (id INT AUTO_INCREMENT NOT NULL, action VARCHAR(255) NOT NULL, logged_at DATETIME NOT NULL, object_id VARCHAR(64) DEFAULT NULL, object_class VARCHAR(255) NOT NULL, version INT NOT NULL, data LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\', username VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_country (id INT AUTO_INCREMENT NOT NULL, code VARCHAR(2) NOT NULL, enabled TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_E74256BF77153098 (code), INDEX IDX_E74256BF77153098 (code), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_province (id INT AUTO_INCREMENT NOT NULL, country_id INT NOT NULL, code VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, abbreviation VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_B5618FE477153098 (code), INDEX IDX_B5618FE4F92F3E70 (country_id), UNIQUE INDEX UNIQ_B5618FE4F92F3E705E237E06 (country_id, name), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_zone (id INT AUTO_INCREMENT NOT NULL, code VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, type VARCHAR(8) NOT NULL, scope VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_7BE2258E77153098 (code), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_zone_member (id INT AUTO_INCREMENT NOT NULL, belongs_to INT DEFAULT NULL, code VARCHAR(255) NOT NULL, INDEX IDX_E8B5ABF34B0E929B (belongs_to), UNIQUE INDEX UNIQ_E8B5ABF34B0E929B77153098 (belongs_to, code), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_taxon_translation (id INT AUTO_INCREMENT NOT NULL, translatable_id INT NOT NULL, name VARCHAR(255) NOT NULL, slug VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, locale VARCHAR(255) NOT NULL, INDEX IDX_1487DFCF2C2AC5D3 (translatable_id), UNIQUE INDEX slug_uidx (locale, slug), UNIQUE INDEX sylius_taxon_translation_uniq_trans (translatable_id, locale), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_user_oauth (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, provider VARCHAR(255) NOT NULL, identifier VARCHAR(255) NOT NULL, access_token VARCHAR(255) DEFAULT NULL, refresh_token VARCHAR(255) DEFAULT NULL, INDEX IDX_C3471B78A76ED395 (user_id), UNIQUE INDEX user_provider (user_id, provider), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_customer_group (id INT AUTO_INCREMENT NOT NULL, code VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_7FCF9B0577153098 (code), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_address (id INT AUTO_INCREMENT NOT NULL, customer_id INT DEFAULT NULL, first_name VARCHAR(255) NOT NULL, last_name VARCHAR(255) NOT NULL, phone_number VARCHAR(255) DEFAULT NULL, street VARCHAR(255) NOT NULL, company VARCHAR(255) DEFAULT NULL, city VARCHAR(255) NOT NULL, postcode VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, country_code VARCHAR(255) NOT NULL, province_code VARCHAR(255) DEFAULT NULL, province_name VARCHAR(255) DEFAULT NULL, INDEX IDX_B97FF0589395C3F3 (customer_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_admin_user (id INT AUTO_INCREMENT NOT NULL, username VARCHAR(255) DEFAULT NULL, username_canonical VARCHAR(255) DEFAULT NULL, enabled TINYINT(1) NOT NULL, salt VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, password_reset_token VARCHAR(255) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, email_verification_token VARCHAR(255) DEFAULT NULL, verified_at DATETIME DEFAULT NULL, locked TINYINT(1) NOT NULL, expires_at DATETIME DEFAULT NULL, credentials_expire_at DATETIME DEFAULT NULL, roles LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\', email VARCHAR(255) DEFAULT NULL, email_canonical VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, first_name VARCHAR(255) DEFAULT NULL, last_name VARCHAR(255) DEFAULT NULL, locale_code VARCHAR(12) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_channel (id INT AUTO_INCREMENT NOT NULL, default_locale_id INT NOT NULL, base_currency_id INT NOT NULL, default_tax_zone_id INT DEFAULT NULL, code VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, color VARCHAR(255) DEFAULT NULL, description LONGTEXT DEFAULT NULL, enabled TINYINT(1) NOT NULL, hostname VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, theme_name VARCHAR(255) DEFAULT NULL, tax_calculation_strategy VARCHAR(255) NOT NULL, contact_email VARCHAR(255) DEFAULT NULL, skipping_shipping_step_allowed TINYINT(1) NOT NULL, skipping_payment_step_allowed TINYINT(1) NOT NULL, account_verification_required TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_16C8119E77153098 (code), INDEX IDX_16C8119E743BF776 (default_locale_id), INDEX IDX_16C8119E3101778E (base_currency_id), INDEX IDX_16C8119EA978C17 (default_tax_zone_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_channel_currencies (channel_id INT NOT NULL, currency_id INT NOT NULL, INDEX IDX_AE491F9372F5A1AA (channel_id), INDEX IDX_AE491F9338248176 (currency_id), PRIMARY KEY(channel_id, currency_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_channel_locales (channel_id INT NOT NULL, locale_id INT NOT NULL, INDEX IDX_786B7A8472F5A1AA (channel_id), INDEX IDX_786B7A84E559DFD1 (locale_id), PRIMARY KEY(channel_id, locale_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_channel_pricing (id INT AUTO_INCREMENT NOT NULL, product_variant_id INT NOT NULL, price INT NOT NULL, original_price INT DEFAULT NULL, channel_code VARCHAR(255) NOT NULL, INDEX IDX_7801820CA80EF684 (product_variant_id), UNIQUE INDEX product_variant_channel_idx (product_variant_id, channel_code), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_customer (id INT AUTO_INCREMENT NOT NULL, customer_group_id INT DEFAULT NULL, default_address_id INT DEFAULT NULL, email VARCHAR(255) NOT NULL, email_canonical VARCHAR(255) NOT NULL, first_name VARCHAR(255) DEFAULT NULL, last_name VARCHAR(255) DEFAULT NULL, birthday DATETIME DEFAULT NULL, gender VARCHAR(1) DEFAULT \'u\' NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, phone_number VARCHAR(255) DEFAULT NULL, subscribed_to_newsletter TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_7E82D5E6E7927C74 (email), UNIQUE INDEX UNIQ_7E82D5E6A0D96FBF (email_canonical), INDEX IDX_7E82D5E6D2919A68 (customer_group_id), UNIQUE INDEX UNIQ_7E82D5E6BD94FB16 (default_address_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_order (id INT AUTO_INCREMENT NOT NULL, shipping_address_id INT DEFAULT NULL, billing_address_id INT DEFAULT NULL, channel_id INT DEFAULT NULL, promotion_coupon_id INT DEFAULT NULL, customer_id INT DEFAULT NULL, number VARCHAR(255) DEFAULT NULL, notes LONGTEXT DEFAULT NULL, state VARCHAR(255) NOT NULL, checkout_completed_at DATETIME DEFAULT NULL, items_total INT NOT NULL, adjustments_total INT NOT NULL, total INT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, currency_code VARCHAR(3) NOT NULL, locale_code VARCHAR(255) NOT NULL, checkout_state VARCHAR(255) NOT NULL, payment_state VARCHAR(255) NOT NULL, shipping_state VARCHAR(255) NOT NULL, token_value VARCHAR(255) DEFAULT NULL, customer_ip VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_6196A1F996901F54 (number), UNIQUE INDEX UNIQ_6196A1F94D4CFF2B (shipping_address_id), UNIQUE INDEX UNIQ_6196A1F979D0C0E4 (billing_address_id), INDEX IDX_6196A1F972F5A1AA (channel_id), INDEX IDX_6196A1F917B24436 (promotion_coupon_id), INDEX IDX_6196A1F99395C3F3 (customer_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_promotion_order (order_id INT NOT NULL, promotion_id INT NOT NULL, INDEX IDX_BF9CF6FB8D9F6D38 (order_id), INDEX IDX_BF9CF6FB139DF194 (promotion_id), PRIMARY KEY(order_id, promotion_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_order_item (id INT AUTO_INCREMENT NOT NULL, order_id INT NOT NULL, variant_id INT NOT NULL, quantity INT NOT NULL, unit_price INT NOT NULL, units_total INT NOT NULL, adjustments_total INT NOT NULL, total INT NOT NULL, is_immutable TINYINT(1) NOT NULL, INDEX IDX_77B587ED8D9F6D38 (order_id), INDEX IDX_77B587ED3B69A9AF (variant_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_order_item_unit (id INT AUTO_INCREMENT NOT NULL, order_item_id INT NOT NULL, shipment_id INT DEFAULT NULL, adjustments_total INT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, INDEX IDX_82BF226EE415FB15 (order_item_id), INDEX IDX_82BF226E7BE036FC (shipment_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_order_sequence (id INT AUTO_INCREMENT NOT NULL, idx INT NOT NULL, version INT DEFAULT 1 NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_payment (id INT AUTO_INCREMENT NOT NULL, method_id INT DEFAULT NULL, order_id INT NOT NULL, currency_code VARCHAR(3) NOT NULL, amount INT NOT NULL, state VARCHAR(255) NOT NULL, details LONGTEXT NOT NULL COMMENT \'(DC2Type:json_array)\', created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, INDEX IDX_D9191BD419883967 (method_id), INDEX IDX_D9191BD48D9F6D38 (order_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_payment_method (id INT AUTO_INCREMENT NOT NULL, gateway_config_id INT DEFAULT NULL, code VARCHAR(255) NOT NULL, environment VARCHAR(255) DEFAULT NULL, is_enabled TINYINT(1) NOT NULL, position INT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_A75B0B0D77153098 (code), INDEX IDX_A75B0B0DF23D6140 (gateway_config_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_payment_method_channels (payment_method_id INT NOT NULL, channel_id INT NOT NULL, INDEX IDX_543AC0CC5AA1164F (payment_method_id), INDEX IDX_543AC0CC72F5A1AA (channel_id), PRIMARY KEY(payment_method_id, channel_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_product (id INT AUTO_INCREMENT NOT NULL, main_taxon_id INT DEFAULT NULL, code VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, enabled TINYINT(1) NOT NULL, variant_selection_method VARCHAR(255) NOT NULL, average_rating DOUBLE PRECISION DEFAULT \'0\' NOT NULL, UNIQUE INDEX UNIQ_677B9B7477153098 (code), INDEX IDX_677B9B74731E505 (main_taxon_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_product_channels (product_id INT NOT NULL, channel_id INT NOT NULL, INDEX IDX_F9EF269B4584665A (product_id), INDEX IDX_F9EF269B72F5A1AA (channel_id), PRIMARY KEY(product_id, channel_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_product_options (product_id INT NOT NULL, option_id INT NOT NULL, INDEX IDX_2B5FF0094584665A (product_id), INDEX IDX_2B5FF009A7C41D6F (option_id), PRIMARY KEY(product_id, option_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_product_image (id INT AUTO_INCREMENT NOT NULL, owner_id INT NOT NULL, type VARCHAR(255) DEFAULT NULL, path VARCHAR(255) NOT NULL, INDEX IDX_88C64B2D7E3C61F9 (owner_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_product_image_product_variants (image_id INT NOT NULL, variant_id INT NOT NULL, INDEX IDX_8FFDAE8D3DA5256D (image_id), INDEX IDX_8FFDAE8D3B69A9AF (variant_id), PRIMARY KEY(image_id, variant_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_product_review (id INT AUTO_INCREMENT NOT NULL, product_id INT NOT NULL, author_id INT NOT NULL, title VARCHAR(255) NOT NULL, rating INT NOT NULL, comment LONGTEXT DEFAULT NULL, status VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, INDEX IDX_C7056A994584665A (product_id), INDEX IDX_C7056A99F675F31B (author_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_product_taxon (id INT AUTO_INCREMENT NOT NULL, product_id INT NOT NULL, taxon_id INT NOT NULL, position INT NOT NULL, INDEX IDX_169C6CD94584665A (product_id), INDEX IDX_169C6CD9DE13F470 (taxon_id), UNIQUE INDEX product_taxon_idx (product_id, taxon_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_product_translation (id INT AUTO_INCREMENT NOT NULL, translatable_id INT NOT NULL, name VARCHAR(255) NOT NULL, slug VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, meta_keywords VARCHAR(255) DEFAULT NULL, meta_description VARCHAR(255) DEFAULT NULL, short_description LONGTEXT DEFAULT NULL, locale VARCHAR(255) NOT NULL, INDEX IDX_105A9082C2AC5D3 (translatable_id), UNIQUE INDEX UNIQ_105A9084180C698989D9B62 (locale, slug), UNIQUE INDEX sylius_product_translation_uniq_trans (translatable_id, locale), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_product_variant (id INT AUTO_INCREMENT NOT NULL, product_id INT NOT NULL, tax_category_id INT DEFAULT NULL, shipping_category_id INT DEFAULT NULL, code VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, position INT NOT NULL, version INT DEFAULT 1 NOT NULL, on_hold INT NOT NULL, on_hand INT NOT NULL, tracked TINYINT(1) NOT NULL, width DOUBLE PRECISION DEFAULT NULL, height DOUBLE PRECISION DEFAULT NULL, depth DOUBLE PRECISION DEFAULT NULL, weight DOUBLE PRECISION DEFAULT NULL, shipping_required TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_A29B52377153098 (code), INDEX IDX_A29B5234584665A (product_id), INDEX IDX_A29B5239DF894ED (tax_category_id), INDEX IDX_A29B5239E2D1A41 (shipping_category_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_product_variant_option_value (variant_id INT NOT NULL, option_value_id INT NOT NULL, INDEX IDX_76CDAFA13B69A9AF (variant_id), INDEX IDX_76CDAFA1D957CA06 (option_value_id), PRIMARY KEY(variant_id, option_value_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_promotion (id INT AUTO_INCREMENT NOT NULL, code VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, description VARCHAR(255) DEFAULT NULL, priority INT NOT NULL, exclusive TINYINT(1) NOT NULL, usage_limit INT DEFAULT NULL, used INT NOT NULL, coupon_based TINYINT(1) NOT NULL, starts_at DATETIME DEFAULT NULL, ends_at DATETIME DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_F157396377153098 (code), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_promotion_channels (promotion_id INT NOT NULL, channel_id INT NOT NULL, INDEX IDX_1A044F64139DF194 (promotion_id), INDEX IDX_1A044F6472F5A1AA (channel_id), PRIMARY KEY(promotion_id, channel_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_promotion_coupon (id INT AUTO_INCREMENT NOT NULL, promotion_id INT DEFAULT NULL, code VARCHAR(255) NOT NULL, usage_limit INT DEFAULT NULL, used INT NOT NULL, expires_at DATETIME DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, per_customer_usage_limit INT DEFAULT NULL, UNIQUE INDEX UNIQ_B04EBA8577153098 (code), INDEX IDX_B04EBA85139DF194 (promotion_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_shipment (id INT AUTO_INCREMENT NOT NULL, method_id INT NOT NULL, order_id INT NOT NULL, state VARCHAR(255) NOT NULL, tracking VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, INDEX IDX_FD707B3319883967 (method_id), INDEX IDX_FD707B338D9F6D38 (order_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_shipping_method (id INT AUTO_INCREMENT NOT NULL, category_id INT DEFAULT NULL, zone_id INT NOT NULL, tax_category_id INT DEFAULT NULL, code VARCHAR(255) NOT NULL, configuration LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\', category_requirement INT NOT NULL, calculator VARCHAR(255) NOT NULL, is_enabled TINYINT(1) NOT NULL, position INT NOT NULL, archived_at DATETIME DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_5FB0EE1177153098 (code), INDEX IDX_5FB0EE1112469DE2 (category_id), INDEX IDX_5FB0EE119F2C3FAB (zone_id), INDEX IDX_5FB0EE119DF894ED (tax_category_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_shipping_method_channels (shipping_method_id INT NOT NULL, channel_id INT NOT NULL, INDEX IDX_2D9833355F7D6850 (shipping_method_id), INDEX IDX_2D98333572F5A1AA (channel_id), PRIMARY KEY(shipping_method_id, channel_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_shop_user (id INT AUTO_INCREMENT NOT NULL, customer_id INT NOT NULL, username VARCHAR(255) DEFAULT NULL, username_canonical VARCHAR(255) DEFAULT NULL, enabled TINYINT(1) NOT NULL, salt VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, password_reset_token VARCHAR(255) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, email_verification_token VARCHAR(255) DEFAULT NULL, verified_at DATETIME DEFAULT NULL, locked TINYINT(1) NOT NULL, expires_at DATETIME DEFAULT NULL, credentials_expire_at DATETIME DEFAULT NULL, roles LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\', email VARCHAR(255) DEFAULT NULL, email_canonical VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_7C2B74809395C3F3 (customer_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_taxon (id INT AUTO_INCREMENT NOT NULL, tree_root INT DEFAULT NULL, parent_id INT DEFAULT NULL, code VARCHAR(255) NOT NULL, tree_left INT NOT NULL, tree_right INT NOT NULL, tree_level INT NOT NULL, position INT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_CFD811CA77153098 (code), INDEX IDX_CFD811CAA977936C (tree_root), INDEX IDX_CFD811CA727ACA70 (parent_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_taxon_image (id INT AUTO_INCREMENT NOT NULL, owner_id INT NOT NULL, type VARCHAR(255) DEFAULT NULL, path VARCHAR(255) NOT NULL, INDEX IDX_DBE52B287E3C61F9 (owner_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_tax_rate (id INT AUTO_INCREMENT NOT NULL, category_id INT NOT NULL, zone_id INT NOT NULL, code VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, amount NUMERIC(10, 5) NOT NULL, included_in_price TINYINT(1) NOT NULL, calculator VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_3CD86B2E77153098 (code), INDEX IDX_3CD86B2E12469DE2 (category_id), INDEX IDX_3CD86B2E9F2C3FAB (zone_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_gateway_config (id INT AUTO_INCREMENT NOT NULL, gateway_name VARCHAR(255) NOT NULL, factory_name VARCHAR(255) NOT NULL, config LONGTEXT NOT NULL COMMENT \'(DC2Type:json_array)\', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_payment_security_token (hash VARCHAR(255) NOT NULL, details LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:object)\', after_url LONGTEXT DEFAULT NULL, target_url LONGTEXT NOT NULL, gateway_name VARCHAR(255) NOT NULL, PRIMARY KEY(hash)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_admin_api_access_token (id INT AUTO_INCREMENT NOT NULL, client_id INT DEFAULT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_2AA4915D5F37A13B (token), INDEX IDX_2AA4915D19EB6921 (client_id), INDEX IDX_2AA4915DA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_admin_api_auth_code (id INT AUTO_INCREMENT NOT NULL, client_id INT DEFAULT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, redirect_uri LONGTEXT NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_E366D8485F37A13B (token), INDEX IDX_E366D84819EB6921 (client_id), INDEX IDX_E366D848A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_admin_api_client (id INT AUTO_INCREMENT NOT NULL, random_id VARCHAR(255) NOT NULL, redirect_uris LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\', secret VARCHAR(255) NOT NULL, allowed_grant_types LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_admin_api_refresh_token (id INT AUTO_INCREMENT NOT NULL, client_id INT DEFAULT NULL, user_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, expires_at INT DEFAULT NULL, scope VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_9160E3FA5F37A13B (token), INDEX IDX_9160E3FA19EB6921 (client_id), INDEX IDX_9160E3FAA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - $this->addSql('ALTER TABLE sylius_adjustment ADD CONSTRAINT FK_ACA6E0F28D9F6D38 FOREIGN KEY (order_id) REFERENCES sylius_order (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_adjustment ADD CONSTRAINT FK_ACA6E0F2E415FB15 FOREIGN KEY (order_item_id) REFERENCES sylius_order_item (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_adjustment ADD CONSTRAINT FK_ACA6E0F2F720C233 FOREIGN KEY (order_item_unit_id) REFERENCES sylius_order_item_unit (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_exchange_rate ADD CONSTRAINT FK_5F52B852A76BEED FOREIGN KEY (source_currency) REFERENCES sylius_currency (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_exchange_rate ADD CONSTRAINT FK_5F52B85B3FD5856 FOREIGN KEY (target_currency) REFERENCES sylius_currency (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_product_association ADD CONSTRAINT FK_48E9CDABB1E1C39 FOREIGN KEY (association_type_id) REFERENCES sylius_product_association_type (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_product_association ADD CONSTRAINT FK_48E9CDAB4584665A FOREIGN KEY (product_id) REFERENCES sylius_product (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_product_association_product ADD CONSTRAINT FK_A427B983EFB9C8A5 FOREIGN KEY (association_id) REFERENCES sylius_product_association (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_product_association_product ADD CONSTRAINT FK_A427B9834584665A FOREIGN KEY (product_id) REFERENCES sylius_product (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_product_association_type_translation ADD CONSTRAINT FK_4F618E52C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES sylius_product_association_type (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_product_attribute_translation ADD CONSTRAINT FK_93850EBA2C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES sylius_product_attribute (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_product_attribute_value ADD CONSTRAINT FK_8A053E544584665A FOREIGN KEY (product_id) REFERENCES sylius_product (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_product_attribute_value ADD CONSTRAINT FK_8A053E54B6E62EFA FOREIGN KEY (attribute_id) REFERENCES sylius_product_attribute (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_product_option_translation ADD CONSTRAINT FK_CBA491AD2C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES sylius_product_option (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_product_option_value ADD CONSTRAINT FK_F7FF7D4BA7C41D6F FOREIGN KEY (option_id) REFERENCES sylius_product_option (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_product_option_value_translation ADD CONSTRAINT FK_8D4382DC2C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES sylius_product_option_value (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_product_variant_translation ADD CONSTRAINT FK_8DC18EDC2C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES sylius_product_variant (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_shipping_method_translation ADD CONSTRAINT FK_2B37DB3D2C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES sylius_shipping_method (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_payment_method_translation ADD CONSTRAINT FK_966BE3A12C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES sylius_payment_method (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_promotion_action ADD CONSTRAINT FK_933D0915139DF194 FOREIGN KEY (promotion_id) REFERENCES sylius_promotion (id)'); - $this->addSql('ALTER TABLE sylius_promotion_rule ADD CONSTRAINT FK_2C188EA8139DF194 FOREIGN KEY (promotion_id) REFERENCES sylius_promotion (id)'); - $this->addSql('ALTER TABLE sylius_province ADD CONSTRAINT FK_B5618FE4F92F3E70 FOREIGN KEY (country_id) REFERENCES sylius_country (id)'); - $this->addSql('ALTER TABLE sylius_zone_member ADD CONSTRAINT FK_E8B5ABF34B0E929B FOREIGN KEY (belongs_to) REFERENCES sylius_zone (id)'); - $this->addSql('ALTER TABLE sylius_taxon_translation ADD CONSTRAINT FK_1487DFCF2C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES sylius_taxon (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_user_oauth ADD CONSTRAINT FK_C3471B78A76ED395 FOREIGN KEY (user_id) REFERENCES sylius_shop_user (id)'); - $this->addSql('ALTER TABLE sylius_address ADD CONSTRAINT FK_B97FF0589395C3F3 FOREIGN KEY (customer_id) REFERENCES sylius_customer (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_channel ADD CONSTRAINT FK_16C8119E743BF776 FOREIGN KEY (default_locale_id) REFERENCES sylius_locale (id)'); - $this->addSql('ALTER TABLE sylius_channel ADD CONSTRAINT FK_16C8119E3101778E FOREIGN KEY (base_currency_id) REFERENCES sylius_currency (id)'); - $this->addSql('ALTER TABLE sylius_channel ADD CONSTRAINT FK_16C8119EA978C17 FOREIGN KEY (default_tax_zone_id) REFERENCES sylius_zone (id) ON DELETE SET NULL'); - $this->addSql('ALTER TABLE sylius_channel_currencies ADD CONSTRAINT FK_AE491F9372F5A1AA FOREIGN KEY (channel_id) REFERENCES sylius_channel (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_channel_currencies ADD CONSTRAINT FK_AE491F9338248176 FOREIGN KEY (currency_id) REFERENCES sylius_currency (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_channel_locales ADD CONSTRAINT FK_786B7A8472F5A1AA FOREIGN KEY (channel_id) REFERENCES sylius_channel (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_channel_locales ADD CONSTRAINT FK_786B7A84E559DFD1 FOREIGN KEY (locale_id) REFERENCES sylius_locale (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_channel_pricing ADD CONSTRAINT FK_7801820CA80EF684 FOREIGN KEY (product_variant_id) REFERENCES sylius_product_variant (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_customer ADD CONSTRAINT FK_7E82D5E6D2919A68 FOREIGN KEY (customer_group_id) REFERENCES sylius_customer_group (id)'); - $this->addSql('ALTER TABLE sylius_customer ADD CONSTRAINT FK_7E82D5E6BD94FB16 FOREIGN KEY (default_address_id) REFERENCES sylius_address (id) ON DELETE SET NULL'); - $this->addSql('ALTER TABLE sylius_order ADD CONSTRAINT FK_6196A1F94D4CFF2B FOREIGN KEY (shipping_address_id) REFERENCES sylius_address (id)'); - $this->addSql('ALTER TABLE sylius_order ADD CONSTRAINT FK_6196A1F979D0C0E4 FOREIGN KEY (billing_address_id) REFERENCES sylius_address (id)'); - $this->addSql('ALTER TABLE sylius_order ADD CONSTRAINT FK_6196A1F972F5A1AA FOREIGN KEY (channel_id) REFERENCES sylius_channel (id)'); - $this->addSql('ALTER TABLE sylius_order ADD CONSTRAINT FK_6196A1F917B24436 FOREIGN KEY (promotion_coupon_id) REFERENCES sylius_promotion_coupon (id)'); - $this->addSql('ALTER TABLE sylius_order ADD CONSTRAINT FK_6196A1F99395C3F3 FOREIGN KEY (customer_id) REFERENCES sylius_customer (id)'); - $this->addSql('ALTER TABLE sylius_promotion_order ADD CONSTRAINT FK_BF9CF6FB8D9F6D38 FOREIGN KEY (order_id) REFERENCES sylius_order (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_promotion_order ADD CONSTRAINT FK_BF9CF6FB139DF194 FOREIGN KEY (promotion_id) REFERENCES sylius_promotion (id)'); - $this->addSql('ALTER TABLE sylius_order_item ADD CONSTRAINT FK_77B587ED8D9F6D38 FOREIGN KEY (order_id) REFERENCES sylius_order (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_order_item ADD CONSTRAINT FK_77B587ED3B69A9AF FOREIGN KEY (variant_id) REFERENCES sylius_product_variant (id)'); - $this->addSql('ALTER TABLE sylius_order_item_unit ADD CONSTRAINT FK_82BF226EE415FB15 FOREIGN KEY (order_item_id) REFERENCES sylius_order_item (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_order_item_unit ADD CONSTRAINT FK_82BF226E7BE036FC FOREIGN KEY (shipment_id) REFERENCES sylius_shipment (id) ON DELETE SET NULL'); - $this->addSql('ALTER TABLE sylius_payment ADD CONSTRAINT FK_D9191BD419883967 FOREIGN KEY (method_id) REFERENCES sylius_payment_method (id)'); - $this->addSql('ALTER TABLE sylius_payment ADD CONSTRAINT FK_D9191BD48D9F6D38 FOREIGN KEY (order_id) REFERENCES sylius_order (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_payment_method ADD CONSTRAINT FK_A75B0B0DF23D6140 FOREIGN KEY (gateway_config_id) REFERENCES sylius_gateway_config (id) ON DELETE SET NULL'); - $this->addSql('ALTER TABLE sylius_payment_method_channels ADD CONSTRAINT FK_543AC0CC5AA1164F FOREIGN KEY (payment_method_id) REFERENCES sylius_payment_method (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_payment_method_channels ADD CONSTRAINT FK_543AC0CC72F5A1AA FOREIGN KEY (channel_id) REFERENCES sylius_channel (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_product ADD CONSTRAINT FK_677B9B74731E505 FOREIGN KEY (main_taxon_id) REFERENCES sylius_taxon (id)'); - $this->addSql('ALTER TABLE sylius_product_channels ADD CONSTRAINT FK_F9EF269B4584665A FOREIGN KEY (product_id) REFERENCES sylius_product (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_product_channels ADD CONSTRAINT FK_F9EF269B72F5A1AA FOREIGN KEY (channel_id) REFERENCES sylius_channel (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_product_options ADD CONSTRAINT FK_2B5FF0094584665A FOREIGN KEY (product_id) REFERENCES sylius_product (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_product_options ADD CONSTRAINT FK_2B5FF009A7C41D6F FOREIGN KEY (option_id) REFERENCES sylius_product_option (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_product_image ADD CONSTRAINT FK_88C64B2D7E3C61F9 FOREIGN KEY (owner_id) REFERENCES sylius_product (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_product_image_product_variants ADD CONSTRAINT FK_8FFDAE8D3DA5256D FOREIGN KEY (image_id) REFERENCES sylius_product_image (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_product_image_product_variants ADD CONSTRAINT FK_8FFDAE8D3B69A9AF FOREIGN KEY (variant_id) REFERENCES sylius_product_variant (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_product_review ADD CONSTRAINT FK_C7056A994584665A FOREIGN KEY (product_id) REFERENCES sylius_product (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_product_review ADD CONSTRAINT FK_C7056A99F675F31B FOREIGN KEY (author_id) REFERENCES sylius_customer (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_product_taxon ADD CONSTRAINT FK_169C6CD94584665A FOREIGN KEY (product_id) REFERENCES sylius_product (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_product_taxon ADD CONSTRAINT FK_169C6CD9DE13F470 FOREIGN KEY (taxon_id) REFERENCES sylius_taxon (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_product_translation ADD CONSTRAINT FK_105A9082C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES sylius_product (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_product_variant ADD CONSTRAINT FK_A29B5234584665A FOREIGN KEY (product_id) REFERENCES sylius_product (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_product_variant ADD CONSTRAINT FK_A29B5239DF894ED FOREIGN KEY (tax_category_id) REFERENCES sylius_tax_category (id) ON DELETE SET NULL'); - $this->addSql('ALTER TABLE sylius_product_variant ADD CONSTRAINT FK_A29B5239E2D1A41 FOREIGN KEY (shipping_category_id) REFERENCES sylius_shipping_category (id) ON DELETE SET NULL'); - $this->addSql('ALTER TABLE sylius_product_variant_option_value ADD CONSTRAINT FK_76CDAFA13B69A9AF FOREIGN KEY (variant_id) REFERENCES sylius_product_variant (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_product_variant_option_value ADD CONSTRAINT FK_76CDAFA1D957CA06 FOREIGN KEY (option_value_id) REFERENCES sylius_product_option_value (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_promotion_channels ADD CONSTRAINT FK_1A044F64139DF194 FOREIGN KEY (promotion_id) REFERENCES sylius_promotion (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_promotion_channels ADD CONSTRAINT FK_1A044F6472F5A1AA FOREIGN KEY (channel_id) REFERENCES sylius_channel (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_promotion_coupon ADD CONSTRAINT FK_B04EBA85139DF194 FOREIGN KEY (promotion_id) REFERENCES sylius_promotion (id)'); - $this->addSql('ALTER TABLE sylius_shipment ADD CONSTRAINT FK_FD707B3319883967 FOREIGN KEY (method_id) REFERENCES sylius_shipping_method (id)'); - $this->addSql('ALTER TABLE sylius_shipment ADD CONSTRAINT FK_FD707B338D9F6D38 FOREIGN KEY (order_id) REFERENCES sylius_order (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_shipping_method ADD CONSTRAINT FK_5FB0EE1112469DE2 FOREIGN KEY (category_id) REFERENCES sylius_shipping_category (id)'); - $this->addSql('ALTER TABLE sylius_shipping_method ADD CONSTRAINT FK_5FB0EE119F2C3FAB FOREIGN KEY (zone_id) REFERENCES sylius_zone (id)'); - $this->addSql('ALTER TABLE sylius_shipping_method ADD CONSTRAINT FK_5FB0EE119DF894ED FOREIGN KEY (tax_category_id) REFERENCES sylius_tax_category (id) ON DELETE SET NULL'); - $this->addSql('ALTER TABLE sylius_shipping_method_channels ADD CONSTRAINT FK_2D9833355F7D6850 FOREIGN KEY (shipping_method_id) REFERENCES sylius_shipping_method (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_shipping_method_channels ADD CONSTRAINT FK_2D98333572F5A1AA FOREIGN KEY (channel_id) REFERENCES sylius_channel (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_shop_user ADD CONSTRAINT FK_7C2B74809395C3F3 FOREIGN KEY (customer_id) REFERENCES sylius_customer (id)'); - $this->addSql('ALTER TABLE sylius_taxon ADD CONSTRAINT FK_CFD811CAA977936C FOREIGN KEY (tree_root) REFERENCES sylius_taxon (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_taxon ADD CONSTRAINT FK_CFD811CA727ACA70 FOREIGN KEY (parent_id) REFERENCES sylius_taxon (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_taxon_image ADD CONSTRAINT FK_DBE52B287E3C61F9 FOREIGN KEY (owner_id) REFERENCES sylius_taxon (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_tax_rate ADD CONSTRAINT FK_3CD86B2E12469DE2 FOREIGN KEY (category_id) REFERENCES sylius_tax_category (id)'); - $this->addSql('ALTER TABLE sylius_tax_rate ADD CONSTRAINT FK_3CD86B2E9F2C3FAB FOREIGN KEY (zone_id) REFERENCES sylius_zone (id)'); - $this->addSql('ALTER TABLE sylius_admin_api_access_token ADD CONSTRAINT FK_2AA4915D19EB6921 FOREIGN KEY (client_id) REFERENCES sylius_admin_api_client (id)'); - $this->addSql('ALTER TABLE sylius_admin_api_access_token ADD CONSTRAINT FK_2AA4915DA76ED395 FOREIGN KEY (user_id) REFERENCES sylius_admin_user (id)'); - $this->addSql('ALTER TABLE sylius_admin_api_auth_code ADD CONSTRAINT FK_E366D84819EB6921 FOREIGN KEY (client_id) REFERENCES sylius_admin_api_client (id)'); - $this->addSql('ALTER TABLE sylius_admin_api_auth_code ADD CONSTRAINT FK_E366D848A76ED395 FOREIGN KEY (user_id) REFERENCES sylius_admin_user (id)'); - $this->addSql('ALTER TABLE sylius_admin_api_refresh_token ADD CONSTRAINT FK_9160E3FA19EB6921 FOREIGN KEY (client_id) REFERENCES sylius_admin_api_client (id)'); - $this->addSql('ALTER TABLE sylius_admin_api_refresh_token ADD CONSTRAINT FK_9160E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES sylius_admin_user (id)'); - } - - /** - * @param Schema $schema - */ - 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 sylius_exchange_rate DROP FOREIGN KEY FK_5F52B852A76BEED'); - $this->addSql('ALTER TABLE sylius_exchange_rate DROP FOREIGN KEY FK_5F52B85B3FD5856'); - $this->addSql('ALTER TABLE sylius_channel DROP FOREIGN KEY FK_16C8119E3101778E'); - $this->addSql('ALTER TABLE sylius_channel_currencies DROP FOREIGN KEY FK_AE491F9338248176'); - $this->addSql('ALTER TABLE sylius_channel DROP FOREIGN KEY FK_16C8119E743BF776'); - $this->addSql('ALTER TABLE sylius_channel_locales DROP FOREIGN KEY FK_786B7A84E559DFD1'); - $this->addSql('ALTER TABLE sylius_product_association_product DROP FOREIGN KEY FK_A427B983EFB9C8A5'); - $this->addSql('ALTER TABLE sylius_product_association DROP FOREIGN KEY FK_48E9CDABB1E1C39'); - $this->addSql('ALTER TABLE sylius_product_association_type_translation DROP FOREIGN KEY FK_4F618E52C2AC5D3'); - $this->addSql('ALTER TABLE sylius_product_attribute_translation DROP FOREIGN KEY FK_93850EBA2C2AC5D3'); - $this->addSql('ALTER TABLE sylius_product_attribute_value DROP FOREIGN KEY FK_8A053E54B6E62EFA'); - $this->addSql('ALTER TABLE sylius_product_option_translation DROP FOREIGN KEY FK_CBA491AD2C2AC5D3'); - $this->addSql('ALTER TABLE sylius_product_option_value DROP FOREIGN KEY FK_F7FF7D4BA7C41D6F'); - $this->addSql('ALTER TABLE sylius_product_options DROP FOREIGN KEY FK_2B5FF009A7C41D6F'); - $this->addSql('ALTER TABLE sylius_product_option_value_translation DROP FOREIGN KEY FK_8D4382DC2C2AC5D3'); - $this->addSql('ALTER TABLE sylius_product_variant_option_value DROP FOREIGN KEY FK_76CDAFA1D957CA06'); - $this->addSql('ALTER TABLE sylius_product_variant DROP FOREIGN KEY FK_A29B5239DF894ED'); - $this->addSql('ALTER TABLE sylius_shipping_method DROP FOREIGN KEY FK_5FB0EE119DF894ED'); - $this->addSql('ALTER TABLE sylius_tax_rate DROP FOREIGN KEY FK_3CD86B2E12469DE2'); - $this->addSql('ALTER TABLE sylius_product_variant DROP FOREIGN KEY FK_A29B5239E2D1A41'); - $this->addSql('ALTER TABLE sylius_shipping_method DROP FOREIGN KEY FK_5FB0EE1112469DE2'); - $this->addSql('ALTER TABLE sylius_province DROP FOREIGN KEY FK_B5618FE4F92F3E70'); - $this->addSql('ALTER TABLE sylius_zone_member DROP FOREIGN KEY FK_E8B5ABF34B0E929B'); - $this->addSql('ALTER TABLE sylius_channel DROP FOREIGN KEY FK_16C8119EA978C17'); - $this->addSql('ALTER TABLE sylius_shipping_method DROP FOREIGN KEY FK_5FB0EE119F2C3FAB'); - $this->addSql('ALTER TABLE sylius_tax_rate DROP FOREIGN KEY FK_3CD86B2E9F2C3FAB'); - $this->addSql('ALTER TABLE sylius_customer DROP FOREIGN KEY FK_7E82D5E6D2919A68'); - $this->addSql('ALTER TABLE sylius_customer DROP FOREIGN KEY FK_7E82D5E6BD94FB16'); - $this->addSql('ALTER TABLE sylius_order DROP FOREIGN KEY FK_6196A1F94D4CFF2B'); - $this->addSql('ALTER TABLE sylius_order DROP FOREIGN KEY FK_6196A1F979D0C0E4'); - $this->addSql('ALTER TABLE sylius_admin_api_access_token DROP FOREIGN KEY FK_2AA4915DA76ED395'); - $this->addSql('ALTER TABLE sylius_admin_api_auth_code DROP FOREIGN KEY FK_E366D848A76ED395'); - $this->addSql('ALTER TABLE sylius_admin_api_refresh_token DROP FOREIGN KEY FK_9160E3FAA76ED395'); - $this->addSql('ALTER TABLE sylius_channel_currencies DROP FOREIGN KEY FK_AE491F9372F5A1AA'); - $this->addSql('ALTER TABLE sylius_channel_locales DROP FOREIGN KEY FK_786B7A8472F5A1AA'); - $this->addSql('ALTER TABLE sylius_order DROP FOREIGN KEY FK_6196A1F972F5A1AA'); - $this->addSql('ALTER TABLE sylius_payment_method_channels DROP FOREIGN KEY FK_543AC0CC72F5A1AA'); - $this->addSql('ALTER TABLE sylius_product_channels DROP FOREIGN KEY FK_F9EF269B72F5A1AA'); - $this->addSql('ALTER TABLE sylius_promotion_channels DROP FOREIGN KEY FK_1A044F6472F5A1AA'); - $this->addSql('ALTER TABLE sylius_shipping_method_channels DROP FOREIGN KEY FK_2D98333572F5A1AA'); - $this->addSql('ALTER TABLE sylius_address DROP FOREIGN KEY FK_B97FF0589395C3F3'); - $this->addSql('ALTER TABLE sylius_order DROP FOREIGN KEY FK_6196A1F99395C3F3'); - $this->addSql('ALTER TABLE sylius_product_review DROP FOREIGN KEY FK_C7056A99F675F31B'); - $this->addSql('ALTER TABLE sylius_shop_user DROP FOREIGN KEY FK_7C2B74809395C3F3'); - $this->addSql('ALTER TABLE sylius_adjustment DROP FOREIGN KEY FK_ACA6E0F28D9F6D38'); - $this->addSql('ALTER TABLE sylius_promotion_order DROP FOREIGN KEY FK_BF9CF6FB8D9F6D38'); - $this->addSql('ALTER TABLE sylius_order_item DROP FOREIGN KEY FK_77B587ED8D9F6D38'); - $this->addSql('ALTER TABLE sylius_payment DROP FOREIGN KEY FK_D9191BD48D9F6D38'); - $this->addSql('ALTER TABLE sylius_shipment DROP FOREIGN KEY FK_FD707B338D9F6D38'); - $this->addSql('ALTER TABLE sylius_adjustment DROP FOREIGN KEY FK_ACA6E0F2E415FB15'); - $this->addSql('ALTER TABLE sylius_order_item_unit DROP FOREIGN KEY FK_82BF226EE415FB15'); - $this->addSql('ALTER TABLE sylius_adjustment DROP FOREIGN KEY FK_ACA6E0F2F720C233'); - $this->addSql('ALTER TABLE sylius_payment_method_translation DROP FOREIGN KEY FK_966BE3A12C2AC5D3'); - $this->addSql('ALTER TABLE sylius_payment DROP FOREIGN KEY FK_D9191BD419883967'); - $this->addSql('ALTER TABLE sylius_payment_method_channels DROP FOREIGN KEY FK_543AC0CC5AA1164F'); - $this->addSql('ALTER TABLE sylius_product_association DROP FOREIGN KEY FK_48E9CDAB4584665A'); - $this->addSql('ALTER TABLE sylius_product_association_product DROP FOREIGN KEY FK_A427B9834584665A'); - $this->addSql('ALTER TABLE sylius_product_attribute_value DROP FOREIGN KEY FK_8A053E544584665A'); - $this->addSql('ALTER TABLE sylius_product_channels DROP FOREIGN KEY FK_F9EF269B4584665A'); - $this->addSql('ALTER TABLE sylius_product_options DROP FOREIGN KEY FK_2B5FF0094584665A'); - $this->addSql('ALTER TABLE sylius_product_image DROP FOREIGN KEY FK_88C64B2D7E3C61F9'); - $this->addSql('ALTER TABLE sylius_product_review DROP FOREIGN KEY FK_C7056A994584665A'); - $this->addSql('ALTER TABLE sylius_product_taxon DROP FOREIGN KEY FK_169C6CD94584665A'); - $this->addSql('ALTER TABLE sylius_product_translation DROP FOREIGN KEY FK_105A9082C2AC5D3'); - $this->addSql('ALTER TABLE sylius_product_variant DROP FOREIGN KEY FK_A29B5234584665A'); - $this->addSql('ALTER TABLE sylius_product_image_product_variants DROP FOREIGN KEY FK_8FFDAE8D3DA5256D'); - $this->addSql('ALTER TABLE sylius_product_variant_translation DROP FOREIGN KEY FK_8DC18EDC2C2AC5D3'); - $this->addSql('ALTER TABLE sylius_channel_pricing DROP FOREIGN KEY FK_7801820CA80EF684'); - $this->addSql('ALTER TABLE sylius_order_item DROP FOREIGN KEY FK_77B587ED3B69A9AF'); - $this->addSql('ALTER TABLE sylius_product_image_product_variants DROP FOREIGN KEY FK_8FFDAE8D3B69A9AF'); - $this->addSql('ALTER TABLE sylius_product_variant_option_value DROP FOREIGN KEY FK_76CDAFA13B69A9AF'); - $this->addSql('ALTER TABLE sylius_promotion_action DROP FOREIGN KEY FK_933D0915139DF194'); - $this->addSql('ALTER TABLE sylius_promotion_rule DROP FOREIGN KEY FK_2C188EA8139DF194'); - $this->addSql('ALTER TABLE sylius_promotion_order DROP FOREIGN KEY FK_BF9CF6FB139DF194'); - $this->addSql('ALTER TABLE sylius_promotion_channels DROP FOREIGN KEY FK_1A044F64139DF194'); - $this->addSql('ALTER TABLE sylius_promotion_coupon DROP FOREIGN KEY FK_B04EBA85139DF194'); - $this->addSql('ALTER TABLE sylius_order DROP FOREIGN KEY FK_6196A1F917B24436'); - $this->addSql('ALTER TABLE sylius_order_item_unit DROP FOREIGN KEY FK_82BF226E7BE036FC'); - $this->addSql('ALTER TABLE sylius_shipping_method_translation DROP FOREIGN KEY FK_2B37DB3D2C2AC5D3'); - $this->addSql('ALTER TABLE sylius_shipment DROP FOREIGN KEY FK_FD707B3319883967'); - $this->addSql('ALTER TABLE sylius_shipping_method_channels DROP FOREIGN KEY FK_2D9833355F7D6850'); - $this->addSql('ALTER TABLE sylius_user_oauth DROP FOREIGN KEY FK_C3471B78A76ED395'); - $this->addSql('ALTER TABLE sylius_taxon_translation DROP FOREIGN KEY FK_1487DFCF2C2AC5D3'); - $this->addSql('ALTER TABLE sylius_product DROP FOREIGN KEY FK_677B9B74731E505'); - $this->addSql('ALTER TABLE sylius_product_taxon DROP FOREIGN KEY FK_169C6CD9DE13F470'); - $this->addSql('ALTER TABLE sylius_taxon DROP FOREIGN KEY FK_CFD811CAA977936C'); - $this->addSql('ALTER TABLE sylius_taxon DROP FOREIGN KEY FK_CFD811CA727ACA70'); - $this->addSql('ALTER TABLE sylius_taxon_image DROP FOREIGN KEY FK_DBE52B287E3C61F9'); - $this->addSql('ALTER TABLE sylius_payment_method DROP FOREIGN KEY FK_A75B0B0DF23D6140'); - $this->addSql('ALTER TABLE sylius_admin_api_access_token DROP FOREIGN KEY FK_2AA4915D19EB6921'); - $this->addSql('ALTER TABLE sylius_admin_api_auth_code DROP FOREIGN KEY FK_E366D84819EB6921'); - $this->addSql('ALTER TABLE sylius_admin_api_refresh_token DROP FOREIGN KEY FK_9160E3FA19EB6921'); - $this->addSql('DROP TABLE sylius_adjustment'); - $this->addSql('DROP TABLE sylius_currency'); - $this->addSql('DROP TABLE sylius_exchange_rate'); - $this->addSql('DROP TABLE sylius_locale'); - $this->addSql('DROP TABLE sylius_product_association'); - $this->addSql('DROP TABLE sylius_product_association_product'); - $this->addSql('DROP TABLE sylius_product_association_type'); - $this->addSql('DROP TABLE sylius_product_association_type_translation'); - $this->addSql('DROP TABLE sylius_product_attribute'); - $this->addSql('DROP TABLE sylius_product_attribute_translation'); - $this->addSql('DROP TABLE sylius_product_attribute_value'); - $this->addSql('DROP TABLE sylius_product_option'); - $this->addSql('DROP TABLE sylius_product_option_translation'); - $this->addSql('DROP TABLE sylius_product_option_value'); - $this->addSql('DROP TABLE sylius_product_option_value_translation'); - $this->addSql('DROP TABLE sylius_product_variant_translation'); - $this->addSql('DROP TABLE sylius_tax_category'); - $this->addSql('DROP TABLE sylius_shipping_category'); - $this->addSql('DROP TABLE sylius_shipping_method_translation'); - $this->addSql('DROP TABLE sylius_payment_method_translation'); - $this->addSql('DROP TABLE sylius_promotion_action'); - $this->addSql('DROP TABLE sylius_promotion_rule'); - $this->addSql('DROP TABLE sylius_address_log_entries'); - $this->addSql('DROP TABLE sylius_country'); - $this->addSql('DROP TABLE sylius_province'); - $this->addSql('DROP TABLE sylius_zone'); - $this->addSql('DROP TABLE sylius_zone_member'); - $this->addSql('DROP TABLE sylius_taxon_translation'); - $this->addSql('DROP TABLE sylius_user_oauth'); - $this->addSql('DROP TABLE sylius_customer_group'); - $this->addSql('DROP TABLE sylius_address'); - $this->addSql('DROP TABLE sylius_admin_user'); - $this->addSql('DROP TABLE sylius_channel'); - $this->addSql('DROP TABLE sylius_channel_currencies'); - $this->addSql('DROP TABLE sylius_channel_locales'); - $this->addSql('DROP TABLE sylius_channel_pricing'); - $this->addSql('DROP TABLE sylius_customer'); - $this->addSql('DROP TABLE sylius_order'); - $this->addSql('DROP TABLE sylius_promotion_order'); - $this->addSql('DROP TABLE sylius_order_item'); - $this->addSql('DROP TABLE sylius_order_item_unit'); - $this->addSql('DROP TABLE sylius_order_sequence'); - $this->addSql('DROP TABLE sylius_payment'); - $this->addSql('DROP TABLE sylius_payment_method'); - $this->addSql('DROP TABLE sylius_payment_method_channels'); - $this->addSql('DROP TABLE sylius_product'); - $this->addSql('DROP TABLE sylius_product_channels'); - $this->addSql('DROP TABLE sylius_product_options'); - $this->addSql('DROP TABLE sylius_product_image'); - $this->addSql('DROP TABLE sylius_product_image_product_variants'); - $this->addSql('DROP TABLE sylius_product_review'); - $this->addSql('DROP TABLE sylius_product_taxon'); - $this->addSql('DROP TABLE sylius_product_translation'); - $this->addSql('DROP TABLE sylius_product_variant'); - $this->addSql('DROP TABLE sylius_product_variant_option_value'); - $this->addSql('DROP TABLE sylius_promotion'); - $this->addSql('DROP TABLE sylius_promotion_channels'); - $this->addSql('DROP TABLE sylius_promotion_coupon'); - $this->addSql('DROP TABLE sylius_shipment'); - $this->addSql('DROP TABLE sylius_shipping_method'); - $this->addSql('DROP TABLE sylius_shipping_method_channels'); - $this->addSql('DROP TABLE sylius_shop_user'); - $this->addSql('DROP TABLE sylius_taxon'); - $this->addSql('DROP TABLE sylius_taxon_image'); - $this->addSql('DROP TABLE sylius_tax_rate'); - $this->addSql('DROP TABLE sylius_gateway_config'); - $this->addSql('DROP TABLE sylius_payment_security_token'); - $this->addSql('DROP TABLE sylius_admin_api_access_token'); - $this->addSql('DROP TABLE sylius_admin_api_auth_code'); - $this->addSql('DROP TABLE sylius_admin_api_client'); - $this->addSql('DROP TABLE sylius_admin_api_refresh_token'); - } -} diff --git a/tests/Application/src/Migrations/Version20170913125128.php b/tests/Application/src/Migrations/Version20170913125128.php deleted file mode 100644 index 12a6b344..00000000 --- a/tests/Application/src/Migrations/Version20170913125128.php +++ /dev/null @@ -1,57 +0,0 @@ -abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); - - $this->addSql('ALTER TABLE sylius_order_item ADD product_name VARCHAR(255), ADD variant_name VARCHAR(255)'); - - $this->addSql(' - UPDATE sylius_order_item - INNER JOIN sylius_order ON sylius_order_item.order_id = sylius_order.id - INNER JOIN sylius_product_variant ON sylius_order_item.variant_id = sylius_product_variant.id - INNER JOIN sylius_product ON sylius_product_variant.product_id = sylius_product.id - INNER JOIN sylius_product_translation ON sylius_product_translation.translatable_id = sylius_product.id - SET sylius_order_item.product_name = sylius_product_translation.name - WHERE sylius_product_translation.locale = sylius_order.locale_code - - '); - $this->addSql(' - UPDATE sylius_order_item - INNER JOIN sylius_order ON sylius_order_item.order_id = sylius_order.id - INNER JOIN sylius_product_variant ON sylius_order_item.variant_id = sylius_product_variant.id - INNER JOIN sylius_product_variant_translation ON sylius_product_variant_translation.translatable_id = sylius_product_variant.id - SET sylius_order_item.variant_name = sylius_product_variant_translation.name - WHERE sylius_product_variant_translation.locale = sylius_order.locale_code - '); - - $this->addSql('ALTER TABLE sylius_order_item CHANGE product_name product_name VARCHAR(255) DEFAULT NULL, CHANGE variant_name variant_name VARCHAR(255) DEFAULT NULL'); - } - - /** - * @param Schema $schema - */ - 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 sylius_order_item DROP product_name, DROP variant_name'); - } -} diff --git a/tests/Application/src/Migrations/Version20171003103916.php b/tests/Application/src/Migrations/Version20171003103916.php deleted file mode 100644 index d5dc1979..00000000 --- a/tests/Application/src/Migrations/Version20171003103916.php +++ /dev/null @@ -1,110 +0,0 @@ -container = $container; - } - - /** - * @param Schema $schema - */ - 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\'.'); - - $defaultLocale = $this->container->getParameter('locale'); - $productAttributeRepository = $this->container->get('sylius.repository.product_attribute'); - Assert::isInstanceOf($productAttributeRepository, ObjectRepository::class); - - $productAttributes = $productAttributeRepository->findBy(['type' => SelectAttributeType::TYPE]); - /** @var ProductAttributeInterface $productAttribute */ - foreach ($productAttributes as $productAttribute) { - $configuration = $productAttribute->getConfiguration(); - $upgradedConfiguration = []; - - foreach ($configuration as $configurationKey => $value) { - if ('choices' === $configurationKey) { - foreach ($value as $key => $choice) { - $upgradedConfiguration[$configurationKey][$key][$defaultLocale] = $choice; - } - - continue; - } - - $upgradedConfiguration[$configurationKey] = $value; - } - - $this->addSql('UPDATE sylius_product_attribute SET configuration = :configuration WHERE id = :id', [ - 'id' => $productAttribute->getId(), - 'configuration' => serialize($upgradedConfiguration), - ]); - } - } - - /** - * @param Schema $schema - */ - 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\'.'); - - $defaultLocale = $this->container->getParameter('locale'); - $productAttributeRepository = $this->container->get('sylius.repository.product_attribute'); - Assert::isInstanceOf($productAttributeRepository, ObjectRepository::class); - - $productAttributes = $productAttributeRepository->findBy(['type' => SelectAttributeType::TYPE]); - /** @var ProductAttributeInterface $productAttribute */ - foreach ($productAttributes as $productAttribute) { - $configuration = $productAttribute->getConfiguration(); - $downgradedConfiguration = []; - - foreach ($configuration as $configurationKey => $value) { - if ('choices' === $configurationKey) { - foreach ($value as $key => $choice) { - if (array_key_exists($defaultLocale, $choice)) { - $downgradedConfiguration[$configurationKey][$key] = $choice[$defaultLocale]; - } - } - - continue; - } - - $downgradedConfiguration[$configurationKey] = $value; - } - - $this->addSql('UPDATE sylius_product_attribute SET configuration = :configuration WHERE id = :id', [ - 'id' => $productAttribute->getId(), - 'configuration' => serialize($downgradedConfiguration), - ]); - } - } -} diff --git a/tests/Application/src/Migrations/Version20180102140039.php b/tests/Application/src/Migrations/Version20180102140039.php deleted file mode 100644 index 67e345b2..00000000 --- a/tests/Application/src/Migrations/Version20180102140039.php +++ /dev/null @@ -1,30 +0,0 @@ -abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); - - $this->addSql('CREATE INDEX IDX_16C8119EE551C011 ON sylius_channel (hostname)'); - } - - 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 INDEX IDX_16C8119EE551C011 ON sylius_channel'); - } -} diff --git a/tests/Application/src/Migrations/Version20190109095211.php b/tests/Application/src/Migrations/Version20190109095211.php deleted file mode 100644 index cfe7c748..00000000 --- a/tests/Application/src/Migrations/Version20190109095211.php +++ /dev/null @@ -1,34 +0,0 @@ -abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); - - $this->addSql('CREATE TABLE sylius_shop_billing_data (id INT AUTO_INCREMENT NOT NULL, company VARCHAR(255) DEFAULT NULL, tax_id VARCHAR(255) DEFAULT NULL, country_code VARCHAR(255) DEFAULT NULL, street VARCHAR(255) DEFAULT NULL, city VARCHAR(255) DEFAULT NULL, postcode VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET UTF8 COLLATE UTF8_unicode_ci ENGINE = InnoDB'); - $this->addSql('ALTER TABLE sylius_channel ADD shop_billing_data_id INT DEFAULT NULL'); - $this->addSql('ALTER TABLE sylius_channel ADD CONSTRAINT FK_16C8119EB5282EDF FOREIGN KEY (shop_billing_data_id) REFERENCES sylius_shop_billing_data (id) ON DELETE CASCADE'); - $this->addSql('CREATE UNIQUE INDEX UNIQ_16C8119EB5282EDF ON sylius_channel (shop_billing_data_id)'); - } - - public function down(Schema $schema): void - { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); - - $this->addSql('ALTER TABLE sylius_channel DROP FOREIGN KEY FK_16C8119EB5282EDF'); - $this->addSql('DROP TABLE sylius_shop_billing_data'); - $this->addSql('DROP INDEX UNIQ_16C8119EB5282EDF ON sylius_channel'); - $this->addSql('ALTER TABLE sylius_channel DROP shop_billing_data_id'); - } -} diff --git a/tests/Application/src/Migrations/Version20190109160409.php b/tests/Application/src/Migrations/Version20190109160409.php deleted file mode 100644 index eb49cbb8..00000000 --- a/tests/Application/src/Migrations/Version20190109160409.php +++ /dev/null @@ -1,30 +0,0 @@ -abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); - - $this->addSql('ALTER TABLE sylius_shop_user ADD encoder_name VARCHAR(255) DEFAULT NULL'); - $this->addSql('ALTER TABLE sylius_admin_user ADD encoder_name VARCHAR(255) DEFAULT NULL'); - } - - public function down(Schema $schema): void - { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); - - $this->addSql('ALTER TABLE sylius_admin_user DROP encoder_name'); - $this->addSql('ALTER TABLE sylius_shop_user DROP encoder_name'); - } -} diff --git a/tests/Application/src/Migrations/Version20190508083953.php b/tests/Application/src/Migrations/Version20190508083953.php deleted file mode 100644 index b9dccd79..00000000 --- a/tests/Application/src/Migrations/Version20190508083953.php +++ /dev/null @@ -1,39 +0,0 @@ -abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); - - $this->addSql('ALTER TABLE sylius_promotion_coupon ADD reusable_from_cancelled_orders TINYINT(1) DEFAULT \'1\' NOT NULL'); - $this->addSql('CREATE INDEX IDX_6196A1F9A393D2FB43625D9F ON sylius_order (state, updated_at)'); - $this->addSql('ALTER TABLE sylius_product_review CHANGE title title VARCHAR(255) 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 INDEX IDX_6196A1F9A393D2FB43625D9F ON sylius_order'); - $this->addSql('ALTER TABLE sylius_product_review CHANGE title title VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci'); - $this->addSql('ALTER TABLE sylius_promotion_coupon DROP reusable_from_cancelled_orders'); - } -} diff --git a/tests/Application/src/Migrations/Version20190621035710.php b/tests/Application/src/Migrations/Version20190621035710.php deleted file mode 100644 index d32b8cd3..00000000 --- a/tests/Application/src/Migrations/Version20190621035710.php +++ /dev/null @@ -1,36 +0,0 @@ -abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); - - $this->addSql('CREATE TABLE sylius_avatar_image (id INT AUTO_INCREMENT NOT NULL, owner_id INT NOT NULL, type VARCHAR(255) DEFAULT NULL, path VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_1068A3A97E3C61F9 (owner_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET UTF8 COLLATE UTF8_unicode_ci ENGINE = InnoDB'); - $this->addSql('ALTER TABLE sylius_avatar_image ADD CONSTRAINT FK_1068A3A97E3C61F9 FOREIGN KEY (owner_id) REFERENCES sylius_admin_user (id) ON DELETE CASCADE'); - } - - 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 sylius_avatar_image'); - } -} diff --git a/tests/Application/src/Migrations/Version20191119131635.php b/tests/Application/src/Migrations/Version20191119131635.php deleted file mode 100644 index 35e53199..00000000 --- a/tests/Application/src/Migrations/Version20191119131635.php +++ /dev/null @@ -1,25 +0,0 @@ -abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); - - $this->addSql('ALTER TABLE sylius_channel ADD type VARCHAR(255) DEFAULT NULL'); - } - - public function down(Schema $schema): void - { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); - - $this->addSql('ALTER TABLE sylius_channel DROP type'); - } -} diff --git a/tests/Application/src/Migrations/Version20200301170604.php b/tests/Application/src/Migrations/Version20200301170604.php deleted file mode 100644 index 1ae247c5..00000000 --- a/tests/Application/src/Migrations/Version20200301170604.php +++ /dev/null @@ -1,45 +0,0 @@ -abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); - - $this->addSql('CREATE TABLE sylius_channel_countries (channel_id INT NOT NULL, country_id INT NOT NULL, INDEX IDX_D96E51AE72F5A1AA (channel_id), INDEX IDX_D96E51AEF92F3E70 (country_id), PRIMARY KEY(channel_id, country_id)) DEFAULT CHARACTER SET UTF8 COLLATE `UTF8_unicode_ci` ENGINE = InnoDB'); - $this->addSql('ALTER TABLE sylius_channel_countries ADD CONSTRAINT FK_D96E51AE72F5A1AA FOREIGN KEY (channel_id) REFERENCES sylius_channel (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_channel_countries ADD CONSTRAINT FK_D96E51AEF92F3E70 FOREIGN KEY (country_id) REFERENCES sylius_country (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE sylius_shipment ADD shipped_at DATETIME DEFAULT NULL'); - $this->addSql('ALTER TABLE sylius_channel ADD menu_taxon_id INT DEFAULT NULL, DROP type'); - $this->addSql('ALTER TABLE sylius_channel ADD CONSTRAINT FK_16C8119EF242B1E6 FOREIGN KEY (menu_taxon_id) REFERENCES sylius_taxon (id) ON DELETE SET NULL'); - $this->addSql('CREATE INDEX IDX_16C8119EF242B1E6 ON sylius_channel (menu_taxon_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('DROP TABLE sylius_channel_countries'); - $this->addSql('ALTER TABLE sylius_channel DROP FOREIGN KEY FK_16C8119EF242B1E6'); - $this->addSql('DROP INDEX IDX_16C8119EF242B1E6 ON sylius_channel'); - $this->addSql('ALTER TABLE sylius_channel ADD type VARCHAR(255) CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_unicode_ci`, DROP menu_taxon_id'); - $this->addSql('ALTER TABLE sylius_shipment DROP shipped_at'); - } -} diff --git a/tests/Application/src/Migrations/Version20200916093101.php b/tests/Application/src/Migrations/Version20200916093101.php deleted file mode 100644 index eb7bb3b9..00000000 --- a/tests/Application/src/Migrations/Version20200916093101.php +++ /dev/null @@ -1,32 +0,0 @@ -abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); - - $this->addSql('ALTER TABLE sylius_channel_pricing CHANGE price price 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 sylius_channel_pricing CHANGE price price INT NOT NULL'); - } -} From 7c6de957b83e2b13d81b3f23d7dc2576167b3981 Mon Sep 17 00:00:00 2001 From: GSadee Date: Tue, 13 Apr 2021 14:02:42 +0200 Subject: [PATCH 2/4] [PHPStan] Fix static analysis --- phpstan.neon | 3 +++ src/Form/Type/NewOrderType.php | 2 +- src/Form/Type/PaymentType.php | 2 +- src/Form/Type/ShipmentType.php | 2 +- src/ReorderProcessing/CompositeReorderProcessor.php | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index 7cb38b7b..642a2abb 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,4 +1,7 @@ parameters: + checkMissingIterableValueType: false + checkGenericClassInNonGenericObjectType: false + excludes_analyse: # Makes PHPStan crash - 'src/DependencyInjection/Configuration.php' diff --git a/src/Form/Type/NewOrderType.php b/src/Form/Type/NewOrderType.php index a569ff75..0ba3d954 100644 --- a/src/Form/Type/NewOrderType.php +++ b/src/Form/Type/NewOrderType.php @@ -16,7 +16,7 @@ final class NewOrderType extends AbstractResourceType { - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('promotionCoupon', PromotionCouponToCodeType::class, [ diff --git a/src/Form/Type/PaymentType.php b/src/Form/Type/PaymentType.php index a71926f3..8402a63a 100644 --- a/src/Form/Type/PaymentType.php +++ b/src/Form/Type/PaymentType.php @@ -10,7 +10,7 @@ final class PaymentType extends AbstractResourceType { - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder->add('method', PaymentMethodChoiceType::class, [ 'required' => true, diff --git a/src/Form/Type/ShipmentType.php b/src/Form/Type/ShipmentType.php index b75c7a88..60ffecc9 100644 --- a/src/Form/Type/ShipmentType.php +++ b/src/Form/Type/ShipmentType.php @@ -10,7 +10,7 @@ final class ShipmentType extends AbstractResourceType { - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder->add('method', ShippingMethodChoiceType::class, [ 'required' => true, diff --git a/src/ReorderProcessing/CompositeReorderProcessor.php b/src/ReorderProcessing/CompositeReorderProcessor.php index 17d7ff8d..857932c0 100644 --- a/src/ReorderProcessing/CompositeReorderProcessor.php +++ b/src/ReorderProcessing/CompositeReorderProcessor.php @@ -9,7 +9,7 @@ final class CompositeReorderProcessor implements ReorderProcessor { - /*** @var PriorityQueue|ReorderProcessor[] */ + /** @var PriorityQueue|ReorderProcessor[] */ private $reorderProcessors; public function __construct() From 09fed0163d5b3cb6a4f30dbdb07c66a7de9b2ebc Mon Sep 17 00:00:00 2001 From: GSadee Date: Wed, 14 Apr 2021 07:11:13 +0200 Subject: [PATCH 3/4] [Composer] Allow only for Sylius 1.8 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 5481282e..0e7d68ed 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "require": { "php": "^7.3", - "sylius/sylius": "^1.8", + "sylius/sylius": "~1.8.0", "friendsofsymfony/jsrouting-bundle": "^2.2" }, "require-dev": { From ff6ba53c962c06986043eaf1dffd06f5bd4ea66c Mon Sep 17 00:00:00 2001 From: GSadee Date: Wed, 14 Apr 2021 08:21:37 +0200 Subject: [PATCH 4/4] Add note about Sylius 1.8 to UPGRADE file --- UPGRADE.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/UPGRADE.md b/UPGRADE.md index 17edbc67..8ff01137 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,3 +1,9 @@ +### UPGRADE FROM 0.9 TO 0.10 + +1. Upgrade your application to [Sylius 1.8](https://github.com/Sylius/Sylius/blob/master/UPGRADE-1.8.md). + +1. Remove previously copied migration files (you may check migrations to remove [here](https://github.com/Sylius/AdminOrderCreationPlugin/pull/165)). + ### UPGRADE FROM 0.8 TO 0.9 1. Create `CustomerRepository` / `ProductVariantRepository` repositories