propelorm/Propel — pull request #839 by javer (2014-03-04 20:31:40+00:00)
Title: Fixed diff generator when several identical columns were renamed

Fixed diff generator when two tables have several columns with identical DDL and several of them were renamed.

Sample table schema:
```yml
propel:
page:
id: ~
image_url_1: { type: varchar, size: 255 }
image_url_2: { type: varchar, size: 255 }
image_url_3: { type: varchar, size: 255 }
```

When renaming field image_url_2 -> image_url_4 and image_url_3 -> image_url_5 ```propel:diff``` generates the following broken UpSQL:
```sql
ALTER TABLE `page` CHANGE `image_url_2` `image_url_4` VARCHAR(255);

ALTER TABLE `page` CHANGE `image_url_3` `image_url_4` VARCHAR(255);

ALTER TABLE `page`
ADD `image_url_5` VARCHAR(255) AFTER `image_url_4`;
```

Reverse DownSQL is broken too:
```sql
ALTER TABLE `page` CHANGE `image_url_4` `image_url_2` VARCHAR(255);

ALTER TABLE `page` CHANGE `image_url_4` `image_url_3` VARCHAR(255);

ALTER TABLE `page` DROP `image_url_5`;
```

This happens because the same added field can be used several times when detecting renaming.

This patch fixes this wrong behavior.