Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>No there is No need to "lose" any data when using automatic migrations. You migration config class should state <strong>no data loss allowed</strong> You will need to build custom scripts/ or tweak the generated scripts when dealing with changes that result in data loss.</p> <pre><code>public override void MigrateDb() { Database.SetInitializer(new MigrateDatabaseToLatestVersion&lt;MYDbContext, MYSECIALMigrationConfiguration&gt;()); // Context = GetDefaultContext(); // check if a new context is really needed here Context.Database.Initialize(true); } public class MYSPECIALMigrationConfiguration : MYBaseMigrationConfiguration&lt;MYDbContext&gt;{ } public abstract class MYBaseMigrationConfiguration&lt;TContext&gt; : DbMigrationsConfiguration&lt;TContext&gt; where TContext : DbContext{ protected MYBaseMigrationConfiguration() { AutomaticMigrationsEnabled = true; // you can still chnage this later if you do so before triggering Update AutomaticMigrationDataLossAllowed = true; // you can still chnage this later if you do so before triggering Update } </code></pre> <blockquote> <p>how to approach migrations.</p> </blockquote> <p>.. Thats actual a big question.</p> <p><a href="http://msdn.microsoft.com/en-us/data/dn481501" rel="nofollow">EF6 Migrations - new features and options</a></p> <p><a href="http://msdn.microsoft.com/en-us/data/dn481501" rel="nofollow">Great info on Migrations when working in teams.</a><br> This covers many scenarios you may recognise and thus help you understand what approach suits you best.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload