Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20170924094327_create_gcp_clusters.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 43201f75ad77e74ce8037bd3e1934053d8a72b67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
class CreateGcpClusters < ActiveRecord::Migration[4.2]
  DOWNTIME = false

  def change
    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 :user, foreign_key: { on_delete: :nullify }
      t.references :service, foreign_key: { on_delete: :nullify }
      t.integer :status
      t.integer :gcp_cluster_size, null: false

      # Timestamps
      t.datetime_with_timezone :created_at, null: false
      t.datetime_with_timezone :updated_at, null: false

      # Enable/disable
      t.boolean :enabled, default: true

      # General
      t.text :status_reason

      # k8s integration specific
      t.string :project_namespace

      # Cluster details
      t.string :endpoint
      t.text :ca_cert
      t.text :encrypted_kubernetes_token
      t.string :encrypted_kubernetes_token_iv
      t.string :username
      t.text :encrypted_password
      t.string :encrypted_password_iv

      # GKE
      t.string :gcp_project_id, null: false
      t.string :gcp_cluster_zone, null: false
      t.string :gcp_cluster_name, null: false
      t.string :gcp_machine_type
      t.string :gcp_operation_id
      t.text :encrypted_gcp_token
      t.string :encrypted_gcp_token_iv
    end
  end
end