diff --git a/composer.json b/composer.json index 6f083f6..22f338a 100644 --- a/composer.json +++ b/composer.json @@ -18,24 +18,24 @@ "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/http-client": "^6.2", + "symfony/dependency-injection": "*", + "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); }