From 622cf366bf1b74c6e1154bc520a8e76c093dcb60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C4=81vis=20Z=C4=81l=C4=ABtis?= Date: Thu, 14 Dec 2023 17:59:26 +0200 Subject: [PATCH 1/2] chore: allow newer dependencies --- composer.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/composer.json b/composer.json index 6f083f6..c31fb39 100644 --- a/composer.json +++ b/composer.json @@ -18,23 +18,23 @@ "doctrine/doctrine-bundle": "*", "doctrine/orm": "*", "doctrine/persistence": "*", - "symfony/config": "^6.3", - "symfony/framework-bundle": "^6.3", - "symfony/http-foundation": "^6.3", - "symfony/http-kernel": "^6.3", - "symfony/property-info": "^6.3", - "symfony/security-core": "^6.3", - "symfony/serializer": "^6.3", - "symfony/translation": "^6.3", - "symfony/validator": "^6.3", + "symfony/config": "*", + "symfony/framework-bundle": "*", + "symfony/http-foundation": "*", + "symfony/http-kernel": "*", + "symfony/property-info": "*", + "symfony/security-core": "*", + "symfony/serializer": "*", + "symfony/translation": "*", + "symfony/validator": "*", "vich/uploader-bundle": "*", - "whitedigital-eu/entity-resource-mapper-bundle": "^0.23|^0.24" + "whitedigital-eu/entity-resource-mapper-bundle": "*" }, "require-dev": { "doctrine/doctrine-fixtures-bundle": "*", "friendsofphp/php-cs-fixer": "*", "roave/security-advisories": "dev-latest", - "symfony/dependency-injection": "^6.2", + "symfony/dependency-injection": "*", "symfony/http-client": "^6.2", "whitedigital-eu/config-pack": "^2.1" }, From 78323f3ef7032a743c9f632a868d71b630076a5b Mon Sep 17 00:00:00 2001 From: raraworks Date: Wed, 15 May 2024 18:06:29 +0300 Subject: [PATCH 2/2] Alter entity table schema to whitedigital, include migration for existing setup --- composer.json | 2 +- migrations/Version20240515144134.php | 26 ++++++++++++++++++++++++++ src/Entity/StorageItem.php | 1 + src/StorageItemResourceBundle.php | 8 ++++++++ 4 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 migrations/Version20240515144134.php diff --git a/composer.json b/composer.json index c31fb39..22f338a 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,7 @@ "friendsofphp/php-cs-fixer": "*", "roave/security-advisories": "dev-latest", "symfony/dependency-injection": "*", - "symfony/http-client": "^6.2", + "symfony/http-client": "*", "whitedigital-eu/config-pack": "^2.1" }, "conflict": { diff --git a/migrations/Version20240515144134.php b/migrations/Version20240515144134.php new file mode 100644 index 0000000..7dfd18d --- /dev/null +++ b/migrations/Version20240515144134.php @@ -0,0 +1,26 @@ +addSql('CREATE SCHEMA IF NOT EXISTS whitedigital'); + $this->addSql('ALTER TABLE IF EXISTS storage_item SET SCHEMA whitedigital'); + } + + public function down(Schema $schema): void + { + } +} diff --git a/src/Entity/StorageItem.php b/src/Entity/StorageItem.php index e54ae52..dd905bb 100644 --- a/src/Entity/StorageItem.php +++ b/src/Entity/StorageItem.php @@ -12,6 +12,7 @@ use WhiteDigital\StorageItemResource\StorageItemResourceBundle; #[ORM\Entity] +#[ORM\Table(schema: 'whitedigital')] #[Vich\Uploadable] #[Mapping(StorageItemResource::class)] class StorageItem extends BaseEntity diff --git a/src/StorageItemResourceBundle.php b/src/StorageItemResourceBundle.php index fff7f1d..7ff9376 100644 --- a/src/StorageItemResourceBundle.php +++ b/src/StorageItemResourceBundle.php @@ -72,6 +72,14 @@ public function prependExtension(ContainerConfigurator $container, ContainerBuil ], ]); + if ($builder->hasExtension('doctrine_migrations')) { + $container->extension('doctrine_migrations', [ + 'migrations_paths' => [ + 'WhiteDigital\StorageItemResource\Migrations' => '%kernel.project_dir%/vendor/whitedigital-eu/storage-item-resource/migrations', + ], + ]); + } + $this->configureApiPlatformExtension($container, $extensionConfig); }