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