I've seen a large number of qusestions around this topic, however they all seem to relate to MariaDB and MySQL. I am having this problem with SQLite.
I have a brand new Symfony 5.2 installation to try and narrow down this issue. I have created 2 Entities, "User" and "Settings". These are nothing major, just a couple of standard fields on each.
My $DATABASE_URL variable is defined as:
DATABASE_URL="sqlite:///%kernel.project_dir%/va/data.db"
My Doctrine config looks like:
doctrine:
dbal:
types:
datetime_immutable:
class: \Carbon\Doctrine\DateTimeImmutableType
datetime:
class: \Carbon\Doctrine\DateTimeImmutableType
default_connection: default
connections:
default:
url: '%env(resolve:DATABASE_URL)%'
driver: pdo_sqlite
override_url: false
logging: true
profiling: true
profiling_collect_backtrace: false
profiling_collect_schema_errors: true
options: { }
mapping_types: { }
default_table_options: { }
slaves: { }
replicas: { }
shards: { }
orm:
auto_generate_proxy_classes: true
default_entity_manager: default
entity_managers:
default:
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
auto_mapping: true
mappings:
App:
is_bundle: false
type: annotation
dir: /path/to/app/src/Entity
prefix: App\Entity
alias: App
mapping: true
query_cache_driver:
type: null
metadata_cache_driver:
type: null
result_cache_driver:
type: null
class_metadata_factory_name: Doctrine\ORM\Mapping\ClassMetadataFactory
default_repository_class: Doctrine\ORM\EntityRepository
quote_strategy: doctrine.orm.quote_strategy.default
entity_listener_resolver: null
repository_factory: doctrine.orm.container_repository_factory
hydrators: { }
filters: { }
proxy_dir: '%kernel.cache_dir%/doctrine/orm/Proxies'
proxy_namespace: Proxies
resolve_target_entities: { }
And the Doctrine Migrations config:
doctrine_migrations:
migrations_paths:
DoctrineMigrations: /path/to/app/migrations
enable_profiler: true
services: { }
factories: { }
storage:
table_storage:
table_name: null
version_column_name: null
version_column_length: null
executed_at_column_name: null
execution_time_column_name: null
migrations: { }
connection: null
em: null
all_or_nothing: false
check_database_platform: true
custom_template: null
organize_migrations: false
I executed doctrine:migrations:migrate and it correctly created the DB file. I have viewed the DB file in an SQLite viewer and it has the tables I expect, including the Doctrine Migrations metadata table.
All looks OK - but then... I try and access the app in my browser and get this exception:
The metadata storage is not up to date, please run the sync-metadata-storage command to fix this issue.
Running the doctrine:migrations:sync-metadata-storage command retuns Success and indicates all has been synced up.
Then running doctrine:migrations:list throws the exception again.
I can't figure out how to resolve this?
Any help appreciated!