You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But after migrating to 3.x with fixtures bundle (and I confirmed 2.x had the same code) schema is updated forcibly either with drop/create or update schema tool.
// TODO: handle case when using persistent connections. Fail loudly?
$schemaTool = newSchemaTool($this->om);
if (count($this->excludedDoctrineTables) > 0 || true === $append) {
if (!empty($this->getMetadatas())) {
$schemaTool->updateSchema($this->getMetadatas());
}
} else {
$schemaTool->dropDatabase();
if (!empty($this->getMetadatas())) {
$schemaTool->createSchema($this->getMetadatas());
}
}
Since we have two EMs and two connection we got a strange situation while loading all sets of fixtures for both:
first EM drops the whole database and restores only own metadatas.
Same does the second
We result with non-consistent database setup where not all tables present, thus tests fail
The text was updated successfully, but these errors were encountered:
scaytrase
changed the title
Invalid schema handling after migration from test bundle 1.x -> 3.x and multiple entity managers
Invalid orm schema handling after migration from test bundle 1.x -> 3.x and multiple entity managers
Jul 15, 2019
We use postgres and manage our database schema with custom migrations, not with schema tool (schema:update)
We have two separate connections and EMs pointing (for tests for sure) to the same database (using different sets of tables)
For the 1.x branch database structure was only purged for SQLite DB driver, so we have no issues
https://github.com/liip/LiipFunctionalTestBundle/blob/45cac28b3fafeb75aebc58c4a2cf74dd1e093569/Test/WebTestCase.php#L403-L449
But after migrating to 3.x with fixtures bundle (and I confirmed 2.x had the same code) schema is updated forcibly either with drop/create or update schema tool.
https://github.com/liip/LiipFunctionalTestBundle/blob/7b4e40176c8a4fb359f28c27b1f71d33296a6aa9/src/Services/DatabaseTools/ORMDatabaseTool.php#L122-L132
LiipTestFixturesBundle/src/Services/DatabaseTools/ORMDatabaseTool.php
Lines 127 to 138 in 16000bb
Since we have two EMs and two connection we got a strange situation while loading all sets of fixtures for both:
first EM drops the whole database and restores only own metadatas.
Same does the second
We result with non-consistent database setup where not all tables present, thus tests fail
The text was updated successfully, but these errors were encountered: