{"action":"created","issue":{"url":"https://api.github.com/repos/doctrine/DoctrineBundle/issues/444","labels_url":"https://api.github.com/repos/doctrine/DoctrineBundle/issues/444/labels{/name}","comments_url":"https://api.github.com/repos/doctrine/DoctrineBundle/issues/444/comments","events_url":"https://api.github.com/repos/doctrine/DoctrineBundle/issues/444/events","html_url":"https://github.com/doctrine/DoctrineBundle/issues/444","id":93884518,"number":444,"title":"TEST environment only: The database schema is not in sync with the current mapping file","user":{"login":"BentCoder","id":8837278,"avatar_url":"https://avatars.githubusercontent.com/u/8837278?v=3","gravatar_id":"","url":"https://api.github.com/users/BentCoder","html_url":"https://github.com/BentCoder","followers_url":"https://api.github.com/users/BentCoder/followers","following_url":"https://api.github.com/users/BentCoder/following{/other_user}","gists_url":"https://api.github.com/users/BentCoder/gists{/gist_id}","starred_url":"https://api.github.com/users/BentCoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BentCoder/subscriptions","organizations_url":"https://api.github.com/users/BentCoder/orgs","repos_url":"https://api.github.com/users/BentCoder/repos","events_url":"https://api.github.com/users/BentCoder/events{/privacy}","received_events_url":"https://api.github.com/users/BentCoder/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-08T20:33:25Z","updated_at":"2015-10-16T18:40:31Z","closed_at":null,"body":"There are some similar questions regarding to this issue but I haven't seen anything in particular for TEST environment and sqlite. I cannot validate schema for TEST environment which uses sqlite however I can validate schemas for DEV environment which uses mysql. Does anyone know what could be the reason and the possible solution? Whole application works fine in both DEV and TEST environments though. Only my phing and CI build is broken because of this issue.\r\n```\r\nphp app/console doctrine:schema:update --force --env=test\r\nUpdating database schema...\r\nDatabase schema updated successfully! \"9\" queries were executed\r\nphp app/console doctrine:schema:validate --env=test\r\n[Mapping]  OK - The mapping files are correct.\r\n[Database] FAIL - The database schema is not in sync with the current mapping file.\r\n```\r\n\r\nconfing_test.yml\r\n\r\n```\r\nimports:\r\n    - { resource: config_dev.yml }\r\n\r\nframework:\r\n    test: ~\r\n    session:\r\n        storage_id: session.storage.mock_file\r\n    profiler:\r\n        collect: false\r\n\r\nweb_profiler:\r\n    toolbar: false\r\n    intercept_redirects: false\r\n\r\nswiftmailer:\r\n    disable_delivery: true\r\n\r\ndoctrine:\r\n    dbal:\r\n        connections:\r\n            default:\r\n                driver: pdo_sqlite\r\n                path: %kernel.cache_dir%/default.db\r\n                charset: UTF8\r\n```"},"comment":{"url":"https://api.github.com/repos/doctrine/DoctrineBundle/issues/comments/148801262","html_url":"https://github.com/doctrine/DoctrineBundle/issues/444#issuecomment-148801262","issue_url":"https://api.github.com/repos/doctrine/DoctrineBundle/issues/444","id":148801262,"user":{"login":"BentCoder","id":8837278,"avatar_url":"https://avatars.githubusercontent.com/u/8837278?v=3","gravatar_id":"","url":"https://api.github.com/users/BentCoder","html_url":"https://github.com/BentCoder","followers_url":"https://api.github.com/users/BentCoder/followers","following_url":"https://api.github.com/users/BentCoder/following{/other_user}","gists_url":"https://api.github.com/users/BentCoder/gists{/gist_id}","starred_url":"https://api.github.com/users/BentCoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BentCoder/subscriptions","organizations_url":"https://api.github.com/users/BentCoder/orgs","repos_url":"https://api.github.com/users/BentCoder/repos","events_url":"https://api.github.com/users/BentCoder/events{/privacy}","received_events_url":"https://api.github.com/users/BentCoder/received_events","type":"User","site_admin":false},"created_at":"2015-10-16T18:40:31Z","updated_at":"2015-10-16T18:40:31Z","body":"@stof I've run it as you said and got output below:\r\n\r\n```\r\nDROP INDEX UNIQ_5373C966D1F4EB9A;\r\nDROP INDEX UNIQ_5373C9665E237E06;\r\nCREATE TEMPORARY TABLE __temp__country AS SELECT id, name, flag FROM country;\r\nDROP TABLE country;\r\nCREATE TABLE country (id INTEGER NOT NULL, name VARCHAR(100) NOT NULL, flag VARCHAR(50) NOT NULL, PRIMARY KEY(id));\r\nINSERT INTO country (id, name, flag) SELECT id, name, flag FROM __temp__country;\r\nDROP TABLE __temp__country;\r\nCREATE UNIQUE INDEX UNIQ_5373C966D1F4EB9A ON country (flag);\r\nCREATE UNIQUE INDEX UNIQ_5373C9665E237E06 ON country (name);\r\nCREATE TEMPORARY TABLE __temp__user AS SELECT id, name, surname, middle_name, lucky_number, favorite_colour FROM user;\r\nDROP TABLE user;\r\nCREATE TABLE user (id INTEGER NOT NULL, name VARCHAR(50) NOT NULL, surname VARCHAR(50) NOT NULL, middle_name VARCHAR(50) DEFAULT NULL, lucky_number CHAR(2) NOT NULL, favorite_colour VARCHAR(50) DEFAULT NULL, PRIMARY KEY(id));\r\nINSERT INTO user (id, name, surname, middle_name, lucky_number, favorite_colour) SELECT id, name, surname, middle_name, lucky_number, favorite_colour FROM __temp__user;\r\nDROP TABLE __temp__user;\r\n```\r\n\r\nIf I run all these queries one by one manually in sql editor, it works fine however, if I run all in one go then I get `[19:36:46] Error while executing SQL query on database 'default': no such table: __temp__user` or `[19:37:14] Error while executing SQL query on database 'default': table __temp__user already exists` error messages."}}