Impossible to revert several 'create table' steps of db:migrate
Closed
Impossible to revert several 'create table' steps of db:migrate
Created by: adrien59cadri
Hello
I encountered an issue while upgrading to 6.0 from 5.1, this was because a project was in global namespace. I had executed this:
# MySQL
sudo -u git -H bundle install --without development test postgres --deployment
sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production
sudo -u git -H bundle exec rake migrate_groups RAILS_ENV=production
sudo -u git -H bundle exec rake migrate_global_projects RAILS_ENV=production
Therefore I decided to rollback to 5.1 the time for me to cleanup the global namespace. i restored a backup.
On the second attempt I had an issue with 3 tables:
- users_groups
- forked_project_links
- deploy_keys_projects
This 3 tables already existed.
Question 1: I thought this was included in the backup but probably not, Is it in the backup?
So i had to use the bundle rake db:migrate:down
command to revert several db:migrate steps (corresponding to those tables).
problem 1 the steps were already down ...
the problem was that the scripts in https://github.com/gitlabhq/gitlabhq/tree/master/db/migrate define for the creation of these table a change method, but no up nor down.
I think it might be good to change the scripts to maybe define the up and down, and delete the table. (option 2, is to test if the table already exist in the change method).
best
Thank you for Gitlab which is a great tool BTW