Bug #1959
0.24.7 rails migration isn't idempotent
| Status: | Closed | Start date: | 02/11/2009 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | % Done: | 0% |
||
| Category: | Rails | |||
| Target version: | 0.24.8 | |||
| Affected Puppet version: | 0.24.7 | Branch: | ||
| Keywords: | ||||
| Votes: | 0 |
Description
In rails/database/003_add_environment_to_host.rb, the call to add_column isn’t guarded by any sort of check to see if that column already exists or not.
I got into a situation where the rails migration of my database only took us to schema version 2, but the “environment column” was already created in the database. dbmigrate was causing puppet to attempt to add that column (to take the schema to version 3), but it would continuously fail because the column already existed.
A simple fix is to put a guard around the calls to add_column (similar to what is done in the other db migration scripts). Patch is attached.
History
Updated by James Turnbull almost 3 years ago
- Category set to Rails
- Status changed from Unreviewed to Closed
- Assignee set to James Turnbull
- Target version set to 0.24.8
Pushed in commit:f0ac3aef53a08e271a5c243f17785cdb58f1f5ef in branch 0.24.x