diff options
author | Thong Kuah <tkuah@gitlab.com> | 2019-06-24 09:48:16 +1200 |
---|---|---|
committer | Thong Kuah <tkuah@gitlab.com> | 2019-06-27 17:28:48 +1200 |
commit | 525edec78bc39ae41284927f1866def56d21a12a (patch) | |
tree | e59fd0498b9dd9396838594a6834b0642142ae50 /app/models/deployment.rb | |
parent | 871d06993edba9220c10ef2ca5c64f412ee5f984 (diff) | |
download | gitlab-ce-525edec78bc39ae41284927f1866def56d21a12a.tar.gz |
Add cluster_id to deployments table as an FK
We nullify when cluster is deleted as we want to keep the deployment
record around.
Add cluster as an optional association
We will have only cluster for deployments where the build deploys to a
kubernetes cluster
Diffstat (limited to 'app/models/deployment.rb')
-rw-r--r-- | app/models/deployment.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/deployment.rb b/app/models/deployment.rb index f0fa5974787..8332656a7a6 100644 --- a/app/models/deployment.rb +++ b/app/models/deployment.rb @@ -7,6 +7,7 @@ class Deployment < ApplicationRecord belongs_to :project, required: true belongs_to :environment, required: true + belongs_to :cluster, class_name: 'Clusters::Cluster', optional: true belongs_to :user belongs_to :deployable, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations |