Development

Changeset 33338

You must first sign up to be able to contribute.

Changeset 33338

Show
Ignore:
Timestamp:
02/15/12 17:02:28 (1 year ago)
Author:
fabien
Message:

[1.4] added a way to understand why a Doctrine migration fails (closes #8728, patch from rande)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.4/lib/plugins/sfDoctrinePlugin/lib/task/sfDoctrineMigrateTask.class.php

    r23922 r33338  
    101101    try 
    102102    { 
    103       $migration->migrate($version, $options['dry-run']); 
     103      $migration_classes = $migration->getMigrationClasses(); 
     104      if($version < $from) 
     105      { 
     106        for($i = (int)$from - 1; $i >= (int)$version; $i--) 
     107        { 
     108          $this->logSection('doctrine', 'executing migration : '.$i .', class: '.$migration_classes[$i]); 
     109          $migration->migrate($i, $options['dry-run']); 
     110        } 
     111      } 
     112      else 
     113      { 
     114        for($i = (int)$from + 1; $i <= (int)$version; $i++) 
     115        { 
     116          $this->logSection('doctrine', 'executing migration : '.$i.', class: '.$migration_classes[$i]); 
     117          $migration->migrate($i, $options['dry-run']); 
     118        } 
     119      } 
    104120    } 
    105121    catch (Exception $e)