Database FAIL - The database schema is not in sync with the current mapping file
for Symfony3:
app/console
changed to bin/console
,
--full-database
to --complete
so the final command will be:
php bin/console doctrine:schema:update --force --complete --dump-sql
It's simple: some field or relation, or entity, etc. has not yet been translated as a column or table in your database schema. Update your schema and you'll be fine.
Run this command to show the differences in the SQL without having to dump your db:
php bin/console doctrine:schema:update --dump-sql
You can also run the following command to perform the changes:
php bin/console doctrine:schema:update --force --full-database
For symfony2 it was
php app/console doctrine:schema:update --force --full-database
For anyone interested in this, re-generating my table schema produced the following look-up schema:
CREATE TABLE `UserRoleLookup` (
`user_id` int(11) NOT NULL,
`user_role_id` int(11) NOT NULL,
PRIMARY KEY (`user_id`,`user_role_id`),
KEY `IDX_4511E771A76ED395` (`user_id`),
KEY `IDX_4511E7718E0E3CA6` (`user_role_id`),
CONSTRAINT `FK_4511E7718E0E3CA6` FOREIGN KEY (`user_role_id`) REFERENCES `UserRole` (`id`),
CONSTRAINT `FK_4511E771A76ED395` FOREIGN KEY (`user_id`) REFERENCES `User` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;\
I guess symfony2-doctrine bundles aren't a big fan of unsigned integers, as I can see little change from the schema I posted. Anyway, problem solved.