src/Shared/EntityFramework/Migrations/History/HistoryContext.cs
/// <summary>
/// Applies the default configuration for the migrations history table. If you override
/// this method it is recommended that you call this base implementation before applying your
/// custom configuration.
/// </summary>
/// <param name="modelBuilder"> The builder that defines the model for the context being created. </param>
Applies the default configuration for the migrations history table. If you override
this method it is recommended that you call this base implementation before applying your
custom configuration.
Applies the default configuration for the migrations history table . If you override this method it is recommended that you call this base implementation before applying your custom configuration .
protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.HasDefaultSchema(_defaultSchema);
            modelBuilder.Entity<HistoryRow>().ToTable(DefaultTableName);
            modelBuilder.Entity<HistoryRow>().HasKey(
                h => new
                         {
                             h.MigrationId,
                             h.ContextKey
                         });
            modelBuilder.Entity<HistoryRow>().Property(h => h.MigrationId).HasMaxLength(MigrationIdMaxLength).IsRequired();
            modelBuilder.Entity<HistoryRow>().Property(h => h.ContextKey).HasMaxLength(ContextKeyMaxLength).IsRequired();
            modelBuilder.Entity<HistoryRow>().Property(h => h.Model).IsRequired().IsMaxLength();
            modelBuilder.Entity<HistoryRow>().Property(h => h.ProductVersion).HasMaxLength(32).IsRequired();
        }
protected override void OnModelCreating ( DbModelBuilder modelBuilder ) { modelBuilder . HasDefaultSchema ( _defaultSchema ) ; modelBuilder . Entity < HistoryRow > ( ) . ToTable ( DefaultTableName ) ; modelBuilder . Entity < HistoryRow > ( ) . HasKey ( h => new { h . MigrationId , h . ContextKey } ) ; modelBuilder . Entity < HistoryRow > ( ) . Property ( h => h . MigrationId ) . HasMaxLength ( MigrationIdMaxLength ) . IsRequired ( ) ; modelBuilder . Entity < HistoryRow > ( ) . Property ( h => h . ContextKey ) . HasMaxLength ( ContextKeyMaxLength ) . IsRequired ( ) ; modelBuilder . Entity < HistoryRow > ( ) . Property ( h => h . Model ) . IsRequired ( ) . IsMaxLength ( ) ; modelBuilder . Entity < HistoryRow > ( ) . Property ( h => h . ProductVersion ) . HasMaxLength ( 32 ) . IsRequired ( ) ; }
Applies the default configuration for the migrations history table.
Applies the default configuration for the migrations history table .
modelBuilder
DbModelBuilder
The builder that defines the model for the context being created.
The builder that defines the model for the context being created .