title: Ensembles and Core Data Light Migration
body: <p>I am currently doing some tests with Ensembles, specifically testing Core Data light migration. </p>
  
  <p>My current configuration is as follow:</p>
  
  <ul>
  <li>Device-A running my app with data model 1</li>
  <li>Device-B running my app with data model 2</li>
  <li>data model 2 is based on data model 1 with one additional string property, which is optional</li>
  </ul>
  
  <p>My scenario is as follow:</p>
  
  <ul>
  <li>At the beginning, running my app with data model 1 on both Device-A, and Device-B, everything synced fine using Ensembles (iCloud configuration)</li>
  <li>On Device-B, install and run my updated app using data model 2</li>
  <li>On Device-A, keep running my old app using data model 1, and add a new record</li>
  <li>The result: the new record added on Device-A is uploaded to iCloud and then synced to device-B</li>
  </ul>
  
  <p>My question: can I configure Ensembles to prevent it from uploading changes to iCloud in case that related data model is not the latest one? (i.e. in my case, Device-A uploads an object based on data model 1 while iCloud is already based on data model 2)</p>
  
  <p>Thanks in advance!</p>
  
  <p>UPDATE 1:</p>
  
  <p>Drew, thank you very much for your answer. I definitely agree that uploads can't (and probably shouldn't) be prevented as Ensembles is a decentralised, peer-to-peer system.</p>
  
  <p>In the ideal case, I would like that the device with the new data model will ignore data that is based on the old data model. (in a similar way to the existing behavior where the device with the old data model will ignore any data based on the new data model). Is that supported?</p>
  
  <p>If not, please consider the following scenario as an example:</p>
  
  <ul>
  <li>The old data model has an entity called 'Book' with two properties: title, and author (both fields are non optional)</li>
  <li>The new data model has a new optional property called titleFirstLetter that should hold the first letter of the title field.</li>
  </ul>
  
  <p>Currently, when Ensembles is not involved, I have full control when saving new NSManagedObject to the persistence store. Therefore, the updated code of my app which responsible for adding a new book, will make sure to extract the first letter from the title field and save it to the new titleFirstLetter property. (i.e. a book titled Catch-22 will have C in the titleFirstLetter property when book is saved).</p>
  
  <p>In addition, when light migration occurs on the core data stack, I detect that, and perform a one-time procedure where I iterate all existing books in the database, and set the titleFirstLetter according to the title value. From this point and on, the database is consistent and valid, while the new code will ensure that future books added to the database will keep database valid.</p>
  
  <p>Regarding Ensembles, if I don't have any control on old data coming from devices with older data model, how can I fill the new property of titleFirstLetter, if my code is never being called?</p>
  
  <p>Thank you for your kind assistance!</p>