コード例 #1
0
        public void DetermineOperation()
        {
            if (migratorName == "")
            {
                return;
            }
            executed = false;
            Version currentVersion = genericData.GetWhiteCoreVersion(migratorName);

            // if there is no WhiteCore version, this is likely an entirely new installation
            if (currentVersion == null)
            {
                MainConsole.Instance.InfoFormat("[Migrator]: Clean installation of {0} required", migratorName);
                Migrator defaultMigrator = GetHighestVersionMigratorThatCanProvideDefaultSetup();
                currentVersion = defaultMigrator.Version;
                Migrator startMigrator  = GetMigratorAfterVersion(defaultMigrator.Version);
                var      latestMigrator = GetLatestVersionMigrator();
                Migrator targetMigrator = defaultMigrator == latestMigrator ? null : latestMigrator;
                operationDescription =
                    new MigrationOperationDescription(MigrationOperationTypes.CreateDefaultAndUpgradeToTarget,
                                                      currentVersion,
                                                      startMigrator != null ? startMigrator.Version : null,
                                                      targetMigrator != null ? targetMigrator.Version : null);
            }
            else
            {
                Migrator startMigrator = GetMigratorAfterVersion(currentVersion);
                if (startMigrator != null)
                {
                    Migrator targetMigrator = GetLatestVersionMigrator();
                    MainConsole.Instance.InfoFormat("[Migrator]: New migration script for {0} found", migratorName);
                    MainConsole.Instance.CleanInfoFormat("            Depending upon the amount of {0} data, this process may take quite a while", migratorName);
                    MainConsole.Instance.CleanInfo("             You may also see warnings and possible timeout errors until this proccess is completed");
                    MainConsole.Instance.CleanInfo("");

                    operationDescription = new MigrationOperationDescription(MigrationOperationTypes.UpgradeToTarget,
                                                                             currentVersion, startMigrator.Version,
                                                                             targetMigrator.Version);
                }
                else
                {
                    operationDescription = new MigrationOperationDescription(MigrationOperationTypes.DoNothing,
                                                                             currentVersion);
                }
            }
        }
コード例 #2
0
        public void DetermineOperation()
        {
            if (migratorName == "")
            {
                return;
            }
            executed = false;
            Version currentVersion = genericData.GetWhiteCoreVersion(migratorName);

            //if there is no WhiteCore version, this is likely an entirely new installation
            if (currentVersion == null)
            {
                Migrator defaultMigrator = GetHighestVersionMigratorThatCanProvideDefaultSetup();
                currentVersion = defaultMigrator.Version;
                Migrator startMigrator  = GetMigratorAfterVersion(defaultMigrator.Version);
                var      latestMigrator = GetLatestVersionMigrator();
                Migrator targetMigrator = defaultMigrator == latestMigrator ? null : latestMigrator;
                operationDescription =
                    new MigrationOperationDescription(MigrationOperationTypes.CreateDefaultAndUpgradeToTarget,
                                                      currentVersion,
                                                      startMigrator != null ? startMigrator.Version : null,
                                                      targetMigrator != null ? targetMigrator.Version : null);
            }
            else
            {
                Migrator startMigrator = GetMigratorAfterVersion(currentVersion);
                if (startMigrator != null)
                {
                    Migrator targetMigrator = GetLatestVersionMigrator();
                    operationDescription = new MigrationOperationDescription(MigrationOperationTypes.UpgradeToTarget,
                                                                             currentVersion, startMigrator.Version,
                                                                             targetMigrator.Version);
                }
                else
                {
                    operationDescription = new MigrationOperationDescription(MigrationOperationTypes.DoNothing,
                                                                             currentVersion);
                }
            }
        }
コード例 #3
0
        public void DetermineOperation()
        {
            if (migratorName == "")
                return;
            executed = false;
            Version currentVersion = genericData.GetWhiteCoreVersion(migratorName);

            //if there is no WhiteCore version, this is likely an entirely new installation
            if (currentVersion == null)
            {
                Migrator defaultMigrator = GetHighestVersionMigratorThatCanProvideDefaultSetup();
                currentVersion = defaultMigrator.Version;
                Migrator startMigrator = GetMigratorAfterVersion(defaultMigrator.Version);
                var latestMigrator = GetLatestVersionMigrator();
                Migrator targetMigrator = defaultMigrator == latestMigrator ? null : latestMigrator;
                operationDescription =
                    new MigrationOperationDescription(MigrationOperationTypes.CreateDefaultAndUpgradeToTarget,
                                                      currentVersion,
                                                      startMigrator != null ? startMigrator.Version : null,
                                                      targetMigrator != null ? targetMigrator.Version : null);
            }
            else
            {
                Migrator startMigrator = GetMigratorAfterVersion(currentVersion);
                if (startMigrator != null)
                {
                    Migrator targetMigrator = GetLatestVersionMigrator();
                    operationDescription = new MigrationOperationDescription(MigrationOperationTypes.UpgradeToTarget,
                                                                             currentVersion, startMigrator.Version,
                                                                             targetMigrator.Version);
                }
                else
                {
                    operationDescription = new MigrationOperationDescription(MigrationOperationTypes.DoNothing,
                                                                             currentVersion);
                }
            }
        }
コード例 #4
0
        public void DetermineOperation()
        {
            if (migratorName == "")
                return;
            executed = false;
            Version currentVersion = genericData.GetWhiteCoreVersion(migratorName);

            //if there is no WhiteCore version, this is likely an entirely new installation
            if (currentVersion == null)
            {
            	MainConsole.Instance.InfoFormat("[Migrator]: Clean installation for {0} found", migratorName);
            	Migrator defaultMigrator = GetHighestVersionMigratorThatCanProvideDefaultSetup();
                currentVersion = defaultMigrator.Version;
                Migrator startMigrator = GetMigratorAfterVersion(defaultMigrator.Version);
                var latestMigrator = GetLatestVersionMigrator();
                Migrator targetMigrator = defaultMigrator == latestMigrator ? null : latestMigrator;
                operationDescription =
                    new MigrationOperationDescription(MigrationOperationTypes.CreateDefaultAndUpgradeToTarget,
                                                      currentVersion,
                                                      startMigrator != null ? startMigrator.Version : null,
                                                      targetMigrator != null ? targetMigrator.Version : null);
            }
            else
            {
                Migrator startMigrator = GetMigratorAfterVersion(currentVersion);
                if (startMigrator != null)
                {
                    Migrator targetMigrator = GetLatestVersionMigrator();
                    MainConsole.Instance.InfoFormat("[Migrator]: New migration script for {0} found", migratorName);
                    MainConsole.Instance.CleanInfoFormat ("            Depending upon the amount of {0} data, this process may take quite a while", migratorName);
                    MainConsole.Instance.CleanInfo ("             You may also see warnings and possible timeout errors until this proccess is completed");
                    MainConsole.Instance.CleanInfo ("");

                    operationDescription = new MigrationOperationDescription(MigrationOperationTypes.UpgradeToTarget,
                                                                             currentVersion, startMigrator.Version,
                                                                             targetMigrator.Version);
                }
                else
                {
                    operationDescription = new MigrationOperationDescription(MigrationOperationTypes.DoNothing,
                                                                             currentVersion);
                }
            }
        }