Skip to content
Snippets Groups Projects
Verified Commit a54af831 authored by Yorick Peterse's avatar Yorick Peterse
Browse files

Use rake db:reset instead of db:setup

Using db:reset ensures existing tables are first dropped. This in turn
ensures that we can drop tables regardless of any foreign key
constraints. While CE currently doesn't have any foreign keys EE defines
the following relation:

    remote_mirrors.project_id -> projects.id

MySQL will complain whenever you try to drop the "projects" table first
even when using "DROP TABLE ... CASCADE".
parent badb3533
No related branches found
No related tags found
1 merge request!3721Use rake db:reset instead of db:setup
Pipeline #
Loading
Loading
@@ -18,7 +18,7 @@ Dir.chdir APP_ROOT do
# end
 
puts "\n== Preparing database =="
system "bin/rake db:setup"
system "bin/rake db:reset"
 
puts "\n== Removing old logs and tempfiles =="
system "rm -f log/*"
Loading
Loading
Loading
Loading
@@ -9,7 +9,7 @@ bundle exec rake setup
```
 
The `setup` task is a alias for `gitlab:setup`.
This tasks calls `db:setup` to create the database, calls `add_limits_mysql` that adds limits to the database schema in case of a MySQL database and finally it calls `db:seed_fu` to seed the database.
This tasks calls `db:reset` to create the database, calls `add_limits_mysql` that adds limits to the database schema in case of a MySQL database and finally it calls `db:seed_fu` to seed the database.
Note: `db:setup` calls `db:seed` but this does nothing.
 
## Run tests
Loading
Loading
Loading
Loading
@@ -14,7 +14,7 @@ namespace :gitlab do
puts ""
end
 
Rake::Task["db:setup"].invoke
Rake::Task["db:reset"].invoke
Rake::Task["add_limits_mysql"].invoke
Rake::Task["setup_postgresql"].invoke
Rake::Task["db:seed_fu"].invoke
Loading
Loading
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