2018-11-13 02:27:31 -05:00
|
|
|
class CreateGcpClusters < ActiveRecord::Migration[4.2]
|
2017-09-25 03:10:25 -04:00
|
|
|
DOWNTIME = false
|
|
|
|
|
2017-10-02 08:58:50 -04:00
|
|
|
def change
|
|
|
|
create_table :gcp_clusters do |t|
|
2017-10-05 11:09:00 -04:00
|
|
|
# Order columns by best align scheme
|
2017-09-28 11:08:11 -04:00
|
|
|
t.references :project, null: false, index: { unique: true }, foreign_key: { on_delete: :cascade }
|
2017-10-03 18:20:47 -04:00
|
|
|
t.references :user, foreign_key: { on_delete: :nullify }
|
|
|
|
t.references :service, foreign_key: { on_delete: :nullify }
|
2017-10-05 11:09:00 -04:00
|
|
|
t.integer :status
|
|
|
|
t.integer :gcp_cluster_size, null: false
|
2017-09-25 13:11:26 -04:00
|
|
|
|
2017-10-05 11:09:00 -04:00
|
|
|
# Timestamps
|
|
|
|
t.datetime_with_timezone :created_at, null: false
|
|
|
|
t.datetime_with_timezone :updated_at, null: false
|
|
|
|
|
|
|
|
# Enable/disable
|
2017-09-25 03:10:25 -04:00
|
|
|
t.boolean :enabled, default: true
|
2017-10-05 11:09:00 -04:00
|
|
|
|
|
|
|
# General
|
2017-10-03 18:20:47 -04:00
|
|
|
t.text :status_reason
|
2017-09-25 13:11:26 -04:00
|
|
|
|
|
|
|
# k8s integration specific
|
|
|
|
t.string :project_namespace
|
|
|
|
|
|
|
|
# Cluster details
|
2017-09-28 11:08:11 -04:00
|
|
|
t.string :endpoint
|
2017-09-25 13:11:26 -04:00
|
|
|
t.text :ca_cert
|
2017-10-03 18:20:47 -04:00
|
|
|
t.text :encrypted_kubernetes_token
|
2017-09-30 11:54:22 -04:00
|
|
|
t.string :encrypted_kubernetes_token_iv
|
2017-09-25 03:10:25 -04:00
|
|
|
t.string :username
|
2017-10-03 18:20:47 -04:00
|
|
|
t.text :encrypted_password
|
2017-09-28 11:08:11 -04:00
|
|
|
t.string :encrypted_password_iv
|
2017-09-25 13:11:26 -04:00
|
|
|
|
|
|
|
# GKE
|
2017-10-01 07:30:32 -04:00
|
|
|
t.string :gcp_project_id, null: false
|
2017-10-03 10:44:06 -04:00
|
|
|
t.string :gcp_cluster_zone, null: false
|
|
|
|
t.string :gcp_cluster_name, null: false
|
|
|
|
t.string :gcp_machine_type
|
2017-09-28 05:11:17 -04:00
|
|
|
t.string :gcp_operation_id
|
2017-10-03 18:20:47 -04:00
|
|
|
t.text :encrypted_gcp_token
|
2017-09-30 11:54:22 -04:00
|
|
|
t.string :encrypted_gcp_token_iv
|
2017-09-25 03:10:25 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|