コード例 #1
0
        public virtual void Down(IDriver driver, ILogger logger, ISchemaInfo schemaInfo)
        {
            driver.BeforeDown(Version);

            var methods = GetDownMethods(migration.GetType(), driver);
            try
            {
                methods.ForEach(method => method.Invoke(migration, new[] { NewRunner(method, driver) }));
            }
            catch (ArgumentException)
            {
                throw new MigrationContractException("[Down] methods must take a single Runner parameter as an argument.", type);
            }
            catch (TargetInvocationException ex)
            {
                Console.Out.WriteLine(ex.InnerException.Message);
                throw ex.InnerException;
            }

            driver.AfterDown(Version);

            schemaInfo.DeleteSchemaVersion(Version, type.Assembly.GetName().Name);
        }