Doctrine fixtures purger drop collections instead of truncating data

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Critical - P2
    • None
    • Affects Version/s: None
    • Component/s: Doctrine
    • None
    • PHP Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      In doctrine/data-fixtures, when a collection is "purged", it is totally dropped and indexes are recreated.

      https://github.com/doctrine/data-fixtures/blob/f65b353922b7ac48f360428e19b22fcce5aba134/src/Purger/MongoDBPurger.php#L47 

      Solution 1:

      • Call SchemaManager::createCollection() before 
        ensureIndexes(), and probably also createSearchIndexes()
      • This will create new encryption keys

      Solution 2:

      • Remove all data using deleteMany([])
      • May be slower

            Assignee:
            Unassigned
            Reporter:
            Jérôme Tamarelle
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: