Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
c2d89b595af1
Commit
00acdcf7
authored
May 06, 2016
by
Robert Speicher
Browse files
Merge branch 'cascade_drop' into 'master'
Rake drop tables with cascade See merge request !4020
parents
c5bb435772df
f50338408e95
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/tasks/gitlab/db.rake
View file @
c2d89b59
...
...
@@ -29,7 +29,10 @@ namespace :gitlab do
tables
.
delete
'schema_migrations'
# Truncate schema_migrations to ensure migrations re-run
connection
.
execute
(
'TRUNCATE schema_migrations'
)
tables
.
each
{
|
t
|
connection
.
execute
(
"DROP TABLE
#{
t
}
"
)
}
# Drop tables with cascade to avoid dependent table errors
# PG: http://www.postgresql.org/docs/current/static/ddl-depend.html
# MySQL: http://dev.mysql.com/doc/refman/5.7/en/drop-table.html
tables
.
each
{
|
t
|
connection
.
execute
(
"DROP TABLE
#{
t
}
CASCADE"
)
}
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment