2018-11-13 02:27:31 -05:00
|
|
|
class CreateNewClustersArchitectures < ActiveRecord::Migration[4.2]
|
2017-10-13 13:21:23 -04:00
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
def change
|
|
|
|
create_table :clusters do |t|
|
2017-11-03 04:22:49 -04:00
|
|
|
t.references :user, index: true, foreign_key: { on_delete: :nullify }
|
2017-10-13 13:21:23 -04:00
|
|
|
|
2017-11-01 08:56:27 -04:00
|
|
|
t.integer :provider_type
|
|
|
|
t.integer :platform_type
|
2017-10-13 13:21:23 -04:00
|
|
|
|
|
|
|
t.datetime_with_timezone :created_at, null: false
|
|
|
|
t.datetime_with_timezone :updated_at, null: false
|
2017-11-01 08:28:47 -04:00
|
|
|
|
|
|
|
t.boolean :enabled, index: true, default: true
|
|
|
|
|
|
|
|
t.string :name, null: false # If manual, read-write. If gcp, read-only.
|
2017-10-13 13:21:23 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
create_table :cluster_projects do |t|
|
2017-10-23 04:36:35 -04:00
|
|
|
t.references :project, null: false, index: true, foreign_key: { on_delete: :cascade }
|
|
|
|
t.references :cluster, null: false, index: true, foreign_key: { on_delete: :cascade }
|
2017-10-13 13:21:23 -04:00
|
|
|
|
|
|
|
t.datetime_with_timezone :created_at, null: false
|
|
|
|
t.datetime_with_timezone :updated_at, null: false
|
|
|
|
end
|
2017-11-01 03:12:44 -04:00
|
|
|
|
2017-10-23 04:36:35 -04:00
|
|
|
create_table :cluster_platforms_kubernetes do |t|
|
2017-10-13 13:21:23 -04:00
|
|
|
t.references :cluster, null: false, index: { unique: true }, foreign_key: { on_delete: :cascade }
|
|
|
|
|
2017-11-01 08:28:47 -04:00
|
|
|
t.datetime_with_timezone :created_at, null: false
|
|
|
|
t.datetime_with_timezone :updated_at, null: false
|
|
|
|
|
|
|
|
t.text :api_url
|
2017-10-13 13:21:23 -04:00
|
|
|
t.text :ca_cert
|
|
|
|
|
|
|
|
t.string :namespace
|
|
|
|
|
|
|
|
t.string :username
|
|
|
|
t.text :encrypted_password
|
|
|
|
t.string :encrypted_password_iv
|
|
|
|
|
|
|
|
t.text :encrypted_token
|
|
|
|
t.string :encrypted_token_iv
|
|
|
|
end
|
|
|
|
|
2017-10-23 04:36:35 -04:00
|
|
|
create_table :cluster_providers_gcp do |t|
|
2017-10-13 13:21:23 -04:00
|
|
|
t.references :cluster, null: false, index: { unique: true }, foreign_key: { on_delete: :cascade }
|
|
|
|
|
|
|
|
t.integer :status
|
2017-11-01 08:28:47 -04:00
|
|
|
t.integer :num_nodes, null: false
|
|
|
|
|
|
|
|
t.datetime_with_timezone :created_at, null: false
|
|
|
|
t.datetime_with_timezone :updated_at, null: false
|
|
|
|
|
2017-10-13 13:21:23 -04:00
|
|
|
t.text :status_reason
|
|
|
|
|
2017-10-23 04:36:35 -04:00
|
|
|
t.string :gcp_project_id, null: false
|
|
|
|
t.string :zone, null: false
|
2017-10-13 13:21:23 -04:00
|
|
|
t.string :machine_type
|
|
|
|
t.string :operation_id
|
|
|
|
|
|
|
|
t.string :endpoint
|
|
|
|
|
|
|
|
t.text :encrypted_access_token
|
|
|
|
t.string :encrypted_access_token_iv
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|