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
Boxiang Sun
gitlab-ce
Commits
2178cd44
Commit
2178cd44
authored
Oct 05, 2017
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimise gcp_clusters table schema
parent
58bf29da
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
db/migrate/20170924094327_create_gcp_clusters.rb
db/migrate/20170924094327_create_gcp_clusters.rb
+10
-6
db/schema.rb
db/schema.rb
+4
-4
No files found.
db/migrate/20170924094327_create_gcp_clusters.rb
View file @
2178cd44
...
@@ -3,13 +3,21 @@ class CreateGcpClusters < ActiveRecord::Migration
...
@@ -3,13 +3,21 @@ class CreateGcpClusters < ActiveRecord::Migration
def
change
def
change
create_table
:gcp_clusters
do
|
t
|
create_table
:gcp_clusters
do
|
t
|
# Order columns by best align scheme
t
.
references
:project
,
null:
false
,
index:
{
unique:
true
},
foreign_key:
{
on_delete: :cascade
}
t
.
references
:project
,
null:
false
,
index:
{
unique:
true
},
foreign_key:
{
on_delete: :cascade
}
t
.
references
:user
,
foreign_key:
{
on_delete: :nullify
}
t
.
references
:user
,
foreign_key:
{
on_delete: :nullify
}
t
.
references
:service
,
foreign_key:
{
on_delete: :nullify
}
t
.
references
:service
,
foreign_key:
{
on_delete: :nullify
}
t
.
integer
:status
t
.
integer
:gcp_cluster_size
,
null:
false
# General
# Timestamps
t
.
datetime_with_timezone
:created_at
,
null:
false
t
.
datetime_with_timezone
:updated_at
,
null:
false
# Enable/disable
t
.
boolean
:enabled
,
default:
true
t
.
boolean
:enabled
,
default:
true
t
.
integer
:status
# General
t
.
text
:status_reason
t
.
text
:status_reason
# k8s integration specific
# k8s integration specific
...
@@ -28,14 +36,10 @@ class CreateGcpClusters < ActiveRecord::Migration
...
@@ -28,14 +36,10 @@ class CreateGcpClusters < ActiveRecord::Migration
t
.
string
:gcp_project_id
,
null:
false
t
.
string
:gcp_project_id
,
null:
false
t
.
string
:gcp_cluster_zone
,
null:
false
t
.
string
:gcp_cluster_zone
,
null:
false
t
.
string
:gcp_cluster_name
,
null:
false
t
.
string
:gcp_cluster_name
,
null:
false
t
.
integer
:gcp_cluster_size
,
null:
false
t
.
string
:gcp_machine_type
t
.
string
:gcp_machine_type
t
.
string
:gcp_operation_id
t
.
string
:gcp_operation_id
t
.
text
:encrypted_gcp_token
t
.
text
:encrypted_gcp_token
t
.
string
:encrypted_gcp_token_iv
t
.
string
:encrypted_gcp_token_iv
t
.
datetime_with_timezone
:created_at
,
null:
false
t
.
datetime_with_timezone
:updated_at
,
null:
false
end
end
end
end
end
end
db/schema.rb
View file @
2178cd44
...
@@ -583,8 +583,11 @@ ActiveRecord::Schema.define(version: 20171004121444) do
...
@@ -583,8 +583,11 @@ ActiveRecord::Schema.define(version: 20171004121444) do
t
.
integer
"project_id"
,
null:
false
t
.
integer
"project_id"
,
null:
false
t
.
integer
"user_id"
t
.
integer
"user_id"
t
.
integer
"service_id"
t
.
integer
"service_id"
t
.
boolean
"enabled"
,
default:
true
t
.
integer
"status"
t
.
integer
"status"
t
.
integer
"gcp_cluster_size"
,
null:
false
t
.
datetime_with_timezone
"created_at"
,
null:
false
t
.
datetime_with_timezone
"updated_at"
,
null:
false
t
.
boolean
"enabled"
,
default:
true
t
.
text
"status_reason"
t
.
text
"status_reason"
t
.
string
"project_namespace"
t
.
string
"project_namespace"
t
.
string
"endpoint"
t
.
string
"endpoint"
...
@@ -597,13 +600,10 @@ ActiveRecord::Schema.define(version: 20171004121444) do
...
@@ -597,13 +600,10 @@ ActiveRecord::Schema.define(version: 20171004121444) do
t
.
string
"gcp_project_id"
,
null:
false
t
.
string
"gcp_project_id"
,
null:
false
t
.
string
"gcp_cluster_zone"
,
null:
false
t
.
string
"gcp_cluster_zone"
,
null:
false
t
.
string
"gcp_cluster_name"
,
null:
false
t
.
string
"gcp_cluster_name"
,
null:
false
t
.
integer
"gcp_cluster_size"
,
null:
false
t
.
string
"gcp_machine_type"
t
.
string
"gcp_machine_type"
t
.
string
"gcp_operation_id"
t
.
string
"gcp_operation_id"
t
.
text
"encrypted_gcp_token"
t
.
text
"encrypted_gcp_token"
t
.
string
"encrypted_gcp_token_iv"
t
.
string
"encrypted_gcp_token_iv"
t
.
datetime_with_timezone
"created_at"
,
null:
false
t
.
datetime_with_timezone
"updated_at"
,
null:
false
end
end
add_index
"gcp_clusters"
,
[
"project_id"
],
name:
"index_gcp_clusters_on_project_id"
,
unique:
true
,
using: :btree
add_index
"gcp_clusters"
,
[
"project_id"
],
name:
"index_gcp_clusters_on_project_id"
,
unique:
true
,
using: :btree
...
...
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