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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
a8441c99
Commit
a8441c99
authored
Mar 27, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add uuid to ApplicationSetting
parent
159e9e6c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
1 deletion
+29
-1
db/migrate/20170328010804_add_uuid_to_application_settings.rb
...igrate/20170328010804_add_uuid_to_application_settings.rb
+25
-0
db/schema.rb
db/schema.rb
+4
-1
No files found.
db/migrate/20170328010804_add_uuid_to_application_settings.rb
0 → 100644
View file @
a8441c99
class
AddUuidToApplicationSettings
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
add_column
:application_settings
,
:uuid
,
:string
add_concurrent_index
:application_settings
,
:uuid
execute
(
"UPDATE application_settings SET uuid =
#{
quote
(
generate_random_string
(
40
))
}
"
)
end
def
down
remove_index
:application_settings
,
:uuid
if
index_exists?
(
:application_settings
,
:uuid
)
remove_column
:application_settings
,
:uuid
end
private
def
generate_random_string
(
size
)
# urlsafe_base64 may return a string of size * 4/3
SecureRandom
.
urlsafe_base64
(
size
)[
0
,
size
]
end
end
db/schema.rb
View file @
a8441c99
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
201703
1720355
4
)
do
ActiveRecord
::
Schema
.
define
(
version:
201703
2801080
4
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
...
...
@@ -129,8 +129,11 @@ ActiveRecord::Schema.define(version: 20170317203554) do
t
.
string
"elasticsearch_aws_access_key"
t
.
string
"elasticsearch_aws_secret_access_key"
t
.
integer
"geo_status_timeout"
,
default:
10
t
.
string
"uuid"
end
add_index
"application_settings"
,
[
"uuid"
],
name:
"index_application_settings_on_uuid"
,
using: :btree
create_table
"approvals"
,
force: :cascade
do
|
t
|
t
.
integer
"merge_request_id"
,
null:
false
t
.
integer
"user_id"
,
null:
false
...
...
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