http://bugzilla.novell.com/show_bug.cgi?id=493015 Summary: Migration failure and database table destruction in OBS 1.5.1 Classification: openSUSE Product: openSUSE.org Version: unspecified Platform: Other OS/Version: openSUSE 11.0 Status: NEW Severity: Critical Priority: P5 - None Component: BuildService AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: jfunk@funktronics.ca QAContact: adrian@novell.com Found By: --- User-Agent: Mozilla/5.0 (compatible; Konqueror/4.2; Linux) KHTML/4.2.1 (like Gecko) SUSE I just upgraded an OBS 1.0 system to 1.5.1. I tried to perform the database migration with the following command: RAILS_ENV="production_slave" rake db:migrate I received the following error: (in /srv/www/obs/frontend) rake aborted! Duplicate migration 43. Please renumber your migrations to resolve the conflict. It turns out that there ware two files with names starting with 043 in the db/migrate directory: 043_add_archs.rb 043_add_archs_2.rb The first one was empty, so I deleted it and re-ran the migration. That resulted in this error: uninitialized constant AddArchs I then ran the migration again, but it attempted to start from scratch: == 1 InitialDatabase: migrating =============================================== -- create_table("groups", {:force=>true}) -> 0.0906s -- add_index("groups", ["parent_id"], {:name=>"groups_parent_id_index"}) -> 0.0663s -- create_table("groups_roles", {:force=>true, :id=>false}) ..and so on until it gets to this error: == 6 CreateTaggings: migrating ================================================ -- create_table(:taggings) rake aborted! Mysql::Error: Table 'taggings' already exists: CREATE TABLE `taggings` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `taggable_id` int(11), `taggable_type` varchar(255), `tag_id` int(11), `user_id` int(11)) ENGINE=InnoDB Now, everytime I attempt the migration, it produces the above error. However, if I run RAILS_ENV="production_slave" rake db:version, I get this: Current version: 44 I checked the schema_info table directly with mysql and it confirms that the version is 44. Now it appears that portions of my database are hosed. The users table was apparently reset to a default state, for example. Projects and packages are there, but ownerships do not match users anymore It looks like there's one more migration script to execute, 046_add_bcntsynctag.rb, (45 is missing, I guess), but the Rails migration scripts are refusing to work properly and my database is now a mess. Reproducible: Always -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.