protected virtual void ApplyMigration(Migration migration)
        {
            Console.WriteLine(new {Message = "Applying migration", migration.Version, migration.Description, DatabaseName = Database.Name});

            var appliedMigration = DatabaseStatus.StartMigration(migration);
            migration.Database = Database;
            try
            {
                migration.Update();
            }
            catch (Exception exception)
            {
                OnMigrationException(migration, exception);
            }
            DatabaseStatus.CompleteMigration(appliedMigration);
        }
Beispiel #2
0
        protected virtual void ApplyMigration(Migration migration)
        {
            Console.WriteLine(new { Message = "Applying migration", migration.Version, migration.Description, Database.DatabaseNamespace.DatabaseName });

            var appliedMigration = DatabaseStatus.StartMigration(migration);

            migration.Database = Database;
            try
            {
                migration.Update();
            }
            catch (Exception exception)
            {
                OnMigrationException(migration, exception);
            }
            DatabaseStatus.CompleteMigration(appliedMigration);
        }
        protected virtual void ApplyMigration(Migration migration) {
            Trace.TraceInformation("Applying migration \"{0}\" for version {1} to database \"{2}\".", migration.Description, migration.Version, Database.Name);

            migration.Database = Database;
            var appliedMigration = DatabaseStatus.StartMigration(migration);
            try {
                var m = migration as CollectionMigration;
                if (m != null) {
                    m.MigrationErrorCallback = MigrationErrorCallback;
                    m.MigrationProgressCallback = MigrationProgressCallback;
                }
                migration.Update();
            } catch (Exception exception) {
                OnMigrationException(migration, exception);
            }

            DatabaseStatus.CompleteMigration(appliedMigration);
        }
Beispiel #4
0
        protected virtual void ApplyMigration(Migration migration)
        {
            Trace.TraceInformation("Applying migration \"{0}\" for version {1} to database \"{2}\".", migration.Description, migration.Version, Database.Name);

            var appliedMigration = DatabaseStatus.StartMigration(migration);

            migration.Database = Database;
            try {
                var m = migration as CollectionMigration;
                if (m != null)
                {
                    m.MigrationErrorCallback    = MigrationErrorCallback;
                    m.MigrationProgressCallback = MigrationProgressCallback;
                }
                migration.Update();
            } catch (Exception exception) {
                OnMigrationException(migration, exception);
            }

            DatabaseStatus.CompleteMigration(appliedMigration);
        }