diff --git a/api/docker/php/docker-entrypoint.sh b/api/docker/php/docker-entrypoint.sh index 7050456b6..a7a99f934 100644 --- a/api/docker/php/docker-entrypoint.sh +++ b/api/docker/php/docker-entrypoint.sh @@ -34,6 +34,14 @@ if [ "$1" = 'php-fpm' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then echo "Creating the database" bin/console doctrine:database:create --if-not-exists --no-interaction + # Make sure we clear query,result & metadata doctrine cache before migrations during init + if [ "$APP_INIT" = 'true' ]; then + echo "Clearing query,result & metadata doctrine cache" + bin/console doctrine:cache:clear-query + bin/console doctrine:cache:clear-result + bin/console doctrine:cache:clear-metadata + fi + # Get the database inline with the newest version. echo "Migrating the database to the currently used version" bin/console doctrine:migrations:migrate --no-interaction diff --git a/api/src/Entity/Gateway.php b/api/src/Entity/Gateway.php index 58f74e900..9ff175dff 100644 --- a/api/src/Entity/Gateway.php +++ b/api/src/Entity/Gateway.php @@ -562,6 +562,8 @@ class Gateway * Configuration for logging, when an api call is made on the source we can log some information for this call. * With this array you can enable/disable what will be logged. * + * @Assert\NotNull + * * @Groups({"read","write"}) * * @ORM\Column(type="array")