public static IDbUpgradeBatch NewDbModelChangeBatch(this IEntitySession session, string fromVersion, string toVersion, DateTime startedOn, DateTime?completedOn, DbUpgradeMethod method, string machineName, string userName, Exception exception = null) { var ent = session.NewEntity <IDbUpgradeBatch>(); ent.FromVersion = fromVersion; ent.ToVersion = toVersion; ent.StartedOn = startedOn; ent.CompletedOn = completedOn; ent.Method = method; ent.MachineName = machineName ?? Environment.MachineName; ent.UserName = userName ?? Environment.UserName; if (exception == null) { ent.Success = true; } else { ent.Success = false; ent.Errors = exception.ToLogString(); } return(ent); }
public bool VersionsChanged; //true if detected any version changes #endregion Fields #region Constructors public DbUpgradeInfo(DbSettings settings, DbModel newModel) { Settings = settings; NewDbModel = newModel; var serverType = NewDbModel.Driver.ServerType; Id = Guid.NewGuid(); Method = DbUpgradeMethod.Auto; //might be changed by update tool app UserName = "******"; Status = UpgradeStatus.None; }
public DbUpgradeInfo(DbSettings settings, DbModel newModel) { Settings = settings; NewDbModel = newModel; var serverType = NewDbModel.Driver.ServerType; Id = Guid.NewGuid(); Method = DbUpgradeMethod.Auto; //might be changed by update tool app UserName = "******"; Status = UpgradeStatus.None; }
public static IDbUpgradeBatch NewDbModelChangeBatch(this IEntitySession session, string fromVersion, string toVersion, DateTime startedOn, DateTime? completedOn, DbUpgradeMethod method, string machineName, string userName, Exception exception = null) { var ent = session.NewEntity<IDbUpgradeBatch>(); ent.FromVersion = fromVersion; ent.ToVersion = toVersion; ent.StartedOn = startedOn; ent.CompletedOn = completedOn; ent.Method = method; ent.MachineName = machineName ?? Environment.MachineName; ent.UserName = userName ?? Environment.UserName; if (exception == null) ent.Success = true; else { ent.Success = false; ent.Errors = exception.ToLogString(); } return ent; }