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
3604fd38
Commit
3604fd38
authored
Aug 14, 2018
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve migrations for maven packages feature
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
c94b0a46
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
18 deletions
+9
-18
db/schema.rb
db/schema.rb
+4
-6
ee/db/migrate/20180720120726_create_packages_package_files.rb
...b/migrate/20180720120726_create_packages_package_files.rb
+1
-1
ee/db/migrate/20180720121404_create_packages_maven_metadata.rb
.../migrate/20180720121404_create_packages_maven_metadata.rb
+2
-3
ee/db/migrate/20180810155213_add_more_indices_to_packages.rb
ee/db/migrate/20180810155213_add_more_indices_to_packages.rb
+2
-8
No files found.
db/schema.rb
View file @
3604fd38
...
...
@@ -1922,23 +1922,22 @@ ActiveRecord::Schema.define(version: 20180810155213) do
end
create_table
"packages_maven_metadata"
,
id: :bigserial
,
force: :cascade
do
|
t
|
t
.
integer
"package_id"
,
limit:
8
,
null:
false
t
.
datetime_with_timezone
"created_at"
,
null:
false
t
.
datetime_with_timezone
"updated_at"
,
null:
false
t
.
integer
"package_id"
,
limit:
8
,
null:
false
t
.
string
"app_group"
,
null:
false
t
.
string
"app_name"
,
null:
false
t
.
string
"app_version"
t
.
text
"path"
,
null:
false
end
add_index
"packages_maven_metadata"
,
[
"package_id"
],
name:
"index_packages_maven_metadata_on_package_id"
,
using: :btree
add_index
"packages_maven_metadata"
,
[
"path"
],
name:
"index_packages_maven_metadata_on_path"
,
using: :btree
add_index
"packages_maven_metadata"
,
[
"package_id"
,
"path"
],
name:
"index_packages_maven_metadata_on_package_id_and_path"
,
using: :btree
create_table
"packages_package_files"
,
id: :bigserial
,
force: :cascade
do
|
t
|
t
.
integer
"package_id"
,
limit:
8
,
null:
false
t
.
datetime_with_timezone
"created_at"
,
null:
false
t
.
datetime_with_timezone
"updated_at"
,
null:
false
t
.
integer
"size"
,
limit:
8
t
.
integer
"package_id"
,
limit:
8
,
null:
false
t
.
integer
"file_type"
t
.
integer
"file_store"
t
.
binary
"file_md5"
...
...
@@ -1948,12 +1947,11 @@ ActiveRecord::Schema.define(version: 20180810155213) do
end
add_index
"packages_package_files"
,
[
"package_id"
,
"file_name"
],
name:
"index_packages_package_files_on_package_id_and_file_name"
,
using: :btree
add_index
"packages_package_files"
,
[
"package_id"
],
name:
"index_packages_package_files_on_package_id"
,
using: :btree
create_table
"packages_packages"
,
id: :bigserial
,
force: :cascade
do
|
t
|
t
.
integer
"project_id"
,
null:
false
t
.
datetime_with_timezone
"created_at"
,
null:
false
t
.
datetime_with_timezone
"updated_at"
,
null:
false
t
.
integer
"project_id"
,
null:
false
t
.
string
"name"
,
null:
false
t
.
string
"version"
end
...
...
ee/db/migrate/20180720120726_create_packages_package_files.rb
View file @
3604fd38
...
...
@@ -8,7 +8,7 @@ class CreatePackagesPackageFiles < ActiveRecord::Migration
def
up
create_table
:packages_package_files
,
id: :bigserial
do
|
t
|
t
.
references
:package
,
type: :bigint
,
index:
true
,
null:
false
t
.
references
:package
,
type: :bigint
,
null:
false
t
.
timestamps_with_timezone
null:
false
...
...
ee/db/migrate/20180720121404_create_packages_maven_metadata.rb
View file @
3604fd38
...
...
@@ -8,15 +8,14 @@ class CreatePackagesMavenMetadata < ActiveRecord::Migration
def
up
create_table
:packages_maven_metadata
,
id: :bigserial
do
|
t
|
t
.
references
:package
,
type: :bigint
,
index:
true
,
null:
false
t
.
references
:package
,
type: :bigint
,
null:
false
t
.
timestamps_with_timezone
null:
false
t
.
string
:app_group
,
null:
false
t
.
string
:app_name
,
null:
false
t
.
string
:app_version
t
.
text
:path
,
null:
false
t
.
string
:path
,
limit:
1024
,
null:
false
end
add_concurrent_foreign_key
:packages_maven_metadata
,
:packages_packages
,
...
...
ee/db/migrate/20180810155213_add_more_indices_to_packages.rb
View file @
3604fd38
...
...
@@ -7,17 +7,11 @@ class AddMoreIndicesToPackages < ActiveRecord::Migration
def
up
add_concurrent_index
:packages_package_files
,
[
:package_id
,
:file_name
]
add_concurrent_index
:packages_maven_metadata
,
:path
,
length:
text_index_length
add_concurrent_index
:packages_maven_metadata
,
[
:package_id
,
:path
]
end
def
down
remove_concurrent_index
:packages_package_files
,
[
:package_id
,
:file_name
]
remove_concurrent_index
:packages_maven_metadata
,
:path
,
length:
text_index_length
end
private
def
text_index_length
Gitlab
::
Database
.
mysql?
?
20
:
nil
remove_concurrent_index
:packages_maven_metadata
,
[
:package_id
,
:path
]
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