Skip to content
Snippets Groups Projects
Commit 0f78689c authored by Jacob Vosmaer (GitLab)'s avatar Jacob Vosmaer (GitLab)
Browse files

Merge branch 'doc-dead-db-migrations' into 'master'

Document how to delete a non-existing migration



See merge request !185
parents c5897c9d 58751615
No related branches found
No related tags found
1 merge request!185Document how to delete a non-existing migration
Loading
Loading
@@ -222,6 +222,29 @@ xcode-select --install
gem install nokogiri
```
 
## Delete non-existent migrations form the database
If for some reason you end up having database migrations that no longer exist
but are present in your database, you might want to remove them.
1. Find the non-existent migrations with `rake db:migrate:status`. You should
see some entries like:
```
up 20160727191041 ********** NO FILE **********
up 20160727193336 ********** NO FILE **********
```
1. Open a rails database console with `rails dbconsole`.
1. Delete the migrations you want with:
```sql
DELETE FROM schema_migrations WHERE version='20160727191041';
```
You can now run `rake db:migrate:status` again to verify that the entries are
deleted from the database.
## Other problems
 
Please open an issue on the [GDK issue tracker](https://gitlab.com/gitlab-org/gitlab-development-kit/issues).
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment