diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-10-04 00:20:47 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-10-04 00:20:47 +0200 |
commit | c6d53250de7f439bc25740913d85ada6e3b2fed4 (patch) | |
tree | b93a8c9556851fda197f5a9bd7bfd6b540e2d44d /db | |
parent | c471430a13c79a82555ee171fecdf45b882a3c19 (diff) | |
download | gitlab-ce-c6d53250de7f439bc25740913d85ada6e3b2fed4.tar.gz |
Specify defaults, fix policies, fix db columns
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20170924094327_create_gcp_clusters.rb | 12 | ||||
-rw-r--r-- | db/schema.rb | 18 |
2 files changed, 15 insertions, 15 deletions
diff --git a/db/migrate/20170924094327_create_gcp_clusters.rb b/db/migrate/20170924094327_create_gcp_clusters.rb index 032db09e748..42171be7fc4 100644 --- a/db/migrate/20170924094327_create_gcp_clusters.rb +++ b/db/migrate/20170924094327_create_gcp_clusters.rb @@ -4,13 +4,13 @@ class CreateGcpClusters < ActiveRecord::Migration def change create_table :gcp_clusters do |t| t.references :project, null: false, index: { unique: true }, foreign_key: { on_delete: :cascade } - t.references :user, null: false, foreign_key: true - t.references :service, foreign_key: true + t.references :user, foreign_key: { on_delete: :nullify } + t.references :service, foreign_key: { on_delete: :nullify } # General t.boolean :enabled, default: true t.integer :status - t.string :status_reason + t.text :status_reason # k8s integration specific t.string :project_namespace @@ -18,10 +18,10 @@ class CreateGcpClusters < ActiveRecord::Migration # Cluster details t.string :endpoint t.text :ca_cert - t.string :encrypted_kubernetes_token + t.text :encrypted_kubernetes_token t.string :encrypted_kubernetes_token_iv t.string :username - t.string :encrypted_password + t.text :encrypted_password t.string :encrypted_password_iv # GKE @@ -31,7 +31,7 @@ class CreateGcpClusters < ActiveRecord::Migration t.integer :gcp_cluster_size, null: false t.string :gcp_machine_type t.string :gcp_operation_id - t.string :encrypted_gcp_token + t.text :encrypted_gcp_token t.string :encrypted_gcp_token_iv t.datetime_with_timezone :created_at, null: false diff --git a/db/schema.rb b/db/schema.rb index 9fc8191751c..0056fe7a09f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -577,18 +577,18 @@ ActiveRecord::Schema.define(version: 20170928100231) do create_table "gcp_clusters", force: :cascade do |t| t.integer "project_id", null: false - t.integer "user_id", null: false + t.integer "user_id" t.integer "service_id" t.boolean "enabled", default: true t.integer "status" - t.string "status_reason" + t.text "status_reason" t.string "project_namespace" t.string "endpoint" t.text "ca_cert" - t.string "encrypted_kubernetes_token" + t.text "encrypted_kubernetes_token" t.string "encrypted_kubernetes_token_iv" t.string "username" - t.string "encrypted_password" + t.text "encrypted_password" t.string "encrypted_password_iv" t.string "gcp_project_id", null: false t.string "gcp_cluster_zone", null: false @@ -596,10 +596,10 @@ ActiveRecord::Schema.define(version: 20170928100231) do t.integer "gcp_cluster_size", null: false t.string "gcp_machine_type" t.string "gcp_operation_id" - t.string "encrypted_gcp_token" + t.text "encrypted_gcp_token" t.string "encrypted_gcp_token_iv" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime_with_timezone "created_at", null: false + t.datetime_with_timezone "updated_at", null: false end add_index "gcp_clusters", ["project_id"], name: "index_gcp_clusters_on_project_id", unique: true, using: :btree @@ -1752,8 +1752,8 @@ ActiveRecord::Schema.define(version: 20170928100231) do add_foreign_key "events", "users", column: "author_id", name: "fk_edfd187b6f", on_delete: :cascade add_foreign_key "forked_project_links", "projects", column: "forked_to_project_id", name: "fk_434510edb0", on_delete: :cascade add_foreign_key "gcp_clusters", "projects", on_delete: :cascade - add_foreign_key "gcp_clusters", "services" - add_foreign_key "gcp_clusters", "users" + add_foreign_key "gcp_clusters", "services", on_delete: :nullify + add_foreign_key "gcp_clusters", "users", on_delete: :nullify add_foreign_key "gpg_keys", "users", on_delete: :cascade add_foreign_key "gpg_signatures", "gpg_keys", on_delete: :nullify add_foreign_key "gpg_signatures", "projects", on_delete: :cascade |