BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
31d9864a
Commit
31d9864a
authored
Nov 12, 2014
by
Valery Sizov
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'backup_restore_drop_sequences' into 'master'
Drop all Postgres sequences during backup restore See merge request !1226
parents
c58edd7c
1a7e3476
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
0 deletions
+12
-0
CHANGELOG
CHANGELOG
+1
-0
database.rb
lib/backup/database.rb
+1
-0
drop_all_postgres_sequences.rake
lib/tasks/gitlab/db/drop_all_postgres_sequences.rake
+10
-0
No files found.
CHANGELOG
View file @
31d9864a
...
...
@@ -3,6 +3,7 @@ v 7.5.0
- Add time zone configuration on gitlab.yml (Sullivan Senechal)
- Fix LDAP authentication for Git HTTP access
- Fix LDAP config lookup for provider 'ldap'
- Drop all sequences during Postgres database restore
- Project title links to project homepage (Ben Bodenmiller)
- Add Atlassian Bamboo CI service (Drew Blessing)
- Mentioned @user will receive email even if he is not participating in issue or commit
...
...
lib/backup/database.rb
View file @
31d9864a
...
...
@@ -34,6 +34,7 @@ module Backup
# Drop all tables because PostgreSQL DB dumps do not contain DROP TABLE
# statements like MySQL.
Rake
::
Task
[
"gitlab:db:drop_all_tables"
].
invoke
Rake
::
Task
[
"gitlab:db:drop_all_postgres_sequences"
].
invoke
pg_env
system
(
'psql'
,
config
[
'database'
],
'-f'
,
db_file_name
)
end
...
...
lib/tasks/gitlab/db/drop_all_postgres_sequences.rake
0 → 100644
View file @
31d9864a
namespace
:gitlab
do
namespace
:db
do
task
drop_all_postgres_sequences: :environment
do
connection
=
ActiveRecord
::
Base
.
connection
connection
.
execute
(
"SELECT c.relname FROM pg_class c WHERE c.relkind = 'S';"
).
each
do
|
sequence
|
connection
.
execute
(
"DROP SEQUENCE
#{
sequence
[
'relname'
]
}
"
)
end
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