Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
        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;
        }
Exemplo n.º 4
0
 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;
 }