Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
703b39d4
Commit
703b39d4
authored
Sep 04, 2017
by
Alexis Reigel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
truncate gpg signature instead of destroy
parent
c4bb09bd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
21 deletions
+2
-21
db/migrate/20170817123339_add_verification_status_to_gpg_signatures.rb
...170817123339_add_verification_status_to_gpg_signatures.rb
+1
-9
db/post_migrate/20170830084744_destroy_gpg_signatures.rb
db/post_migrate/20170830084744_destroy_gpg_signatures.rb
+1
-12
No files found.
db/migrate/20170817123339_add_verification_status_to_gpg_signatures.rb
View file @
703b39d4
...
@@ -4,20 +4,12 @@ class AddVerificationStatusToGpgSignatures < ActiveRecord::Migration
...
@@ -4,20 +4,12 @@ class AddVerificationStatusToGpgSignatures < ActiveRecord::Migration
include
Gitlab
::
Database
::
MigrationHelpers
include
Gitlab
::
Database
::
MigrationHelpers
disable_ddl_transaction!
disable_ddl_transaction!
class
GpgSignature
<
ActiveRecord
::
Base
self
.
table_name
=
'gpg_signatures'
include
EachBatch
end
def
up
def
up
# First we remove all signatures because we need to re-verify them all
# First we remove all signatures because we need to re-verify them all
# again anyway (because of the updated verification logic).
# again anyway (because of the updated verification logic).
#
#
# This makes adding the column with default values faster
# This makes adding the column with default values faster
GpgSignature
.
each_batch
do
|
relation
|
truncate
(
:gpg_signatures
)
relation
.
delete_all
end
add_column_with_default
(
:gpg_signatures
,
:verification_status
,
:smallint
,
default:
0
)
add_column_with_default
(
:gpg_signatures
,
:verification_status
,
:smallint
,
default:
0
)
end
end
...
...
db/post_migrate/20170830084744_destroy_gpg_signatures.rb
View file @
703b39d4
class
DestroyGpgSignatures
<
ActiveRecord
::
Migration
class
DestroyGpgSignatures
<
ActiveRecord
::
Migration
DOWNTIME
=
false
DOWNTIME
=
false
include
Gitlab
::
Database
::
MigrationHelpers
disable_ddl_transaction!
class
GpgSignature
<
ActiveRecord
::
Base
self
.
table_name
=
'gpg_signatures'
include
EachBatch
end
def
up
def
up
GpgSignature
.
each_batch
do
|
relation
|
truncate
(
:gpg_signatures
)
relation
.
delete_all
end
end
end
def
down
def
down
...
...
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