Skip to content

GitLab

  • Menu
    • Projects Groups Snippets
      Help
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #6186

Closed
Open
Created 11 years ago by Administrator@rootOwner
  • New issue

  • Report abuse

  • New issue

  • Report abuse

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

Linked issues
...

    Related merge requests

    • You're only seeing other activity in the feed. To add a comment, switch to one of the following options.
    Please register or sign in to reply
    0 Assignees
    Assign to
    Milestone
    No milestone
    None
    None
    Time tracking
    Due date
    None
    None
    0
    Labels
    None
    Assign labels
    • No matching results
    • Manage project labels
    Confidentiality
    Not confidential

    You are going to turn on confidentiality. Only team members with at least Reporter access will be able to see and leave comments on the issue.

    Lock issue
    Unlocked
    participants
    Reference:

    Menu

    Projects Groups Snippets
    Help