diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-06-02 11:15:53 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-06-02 11:15:53 +0900 |
commit | b02b2602c1bcfd60b760fbfd1aca936475d78474 (patch) | |
tree | 09d906b8d6fafcae31994cf0c2af6af2af6970fd /db | |
parent | c89e57842ebf7f395363bcddaeff76bc7b3f7890 (diff) | |
parent | fe0ebf76c49e2512b211c5d43152275c536f7e3a (diff) | |
download | gitlab-ce-b02b2602c1bcfd60b760fbfd1aca936475d78474.tar.gz |
Merge branch 'master' into per-project-pipeline-iid
Diffstat (limited to 'db')
5 files changed, 57 insertions, 2 deletions
diff --git a/db/migrate/20160302152808_remove_wrong_import_url_from_projects.rb b/db/migrate/20160302152808_remove_wrong_import_url_from_projects.rb index 611767ac7fe..95105118764 100644 --- a/db/migrate/20160302152808_remove_wrong_import_url_from_projects.rb +++ b/db/migrate/20160302152808_remove_wrong_import_url_from_projects.rb @@ -8,7 +8,7 @@ class RemoveWrongImportUrlFromProjects < ActiveRecord::Migration extend AttrEncrypted attr_accessor :credentials attr_encrypted :credentials, - key: Gitlab::Application.secrets.db_key_base, + key: Settings.attr_encrypted_db_key_base, marshal: true, encode: true, :mode => :per_attribute_iv_and_salt, diff --git a/db/migrate/20180511131058_create_clusters_applications_jupyter.rb b/db/migrate/20180511131058_create_clusters_applications_jupyter.rb new file mode 100644 index 00000000000..f3923884e37 --- /dev/null +++ b/db/migrate/20180511131058_create_clusters_applications_jupyter.rb @@ -0,0 +1,23 @@ +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class CreateClustersApplicationsJupyter < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def change + create_table :clusters_applications_jupyter do |t| + t.references :cluster, null: false, unique: true, foreign_key: { on_delete: :cascade } + t.references :oauth_application, foreign_key: { on_delete: :nullify } + + t.integer :status, null: false + t.string :version, null: false + t.string :hostname + + t.timestamps_with_timezone null: false + + t.text :status_reason + end + end +end diff --git a/db/post_migrate/20171124104327_migrate_kubernetes_service_to_new_clusters_architectures.rb b/db/post_migrate/20171124104327_migrate_kubernetes_service_to_new_clusters_architectures.rb index 11b581e4b57..1586a7eb92f 100644 --- a/db/post_migrate/20171124104327_migrate_kubernetes_service_to_new_clusters_architectures.rb +++ b/db/post_migrate/20171124104327_migrate_kubernetes_service_to_new_clusters_architectures.rb @@ -48,7 +48,7 @@ class MigrateKubernetesServiceToNewClustersArchitectures < ActiveRecord::Migrati attr_encrypted :token, mode: :per_attribute_iv, - key: Gitlab::Application.secrets.db_key_base, + key: Settings.attr_encrypted_db_key_base, algorithm: 'aes-256-cbc' end diff --git a/db/post_migrate/20180507083701_set_minimal_project_build_timeout.rb b/db/post_migrate/20180507083701_set_minimal_project_build_timeout.rb new file mode 100644 index 00000000000..d9d9e93f5a3 --- /dev/null +++ b/db/post_migrate/20180507083701_set_minimal_project_build_timeout.rb @@ -0,0 +1,19 @@ +class SetMinimalProjectBuildTimeout < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + MINIMUM_TIMEOUT = 600 + + # Allow this migration to resume if it fails partway through + disable_ddl_transaction! + + def up + update_column_in_batches(:projects, :build_timeout, MINIMUM_TIMEOUT) do |table, query| + query.where(table[:build_timeout].lt(MINIMUM_TIMEOUT)) + end + end + + def down + # no-op + end +end diff --git a/db/schema.rb b/db/schema.rb index 53bdb084eea..0d6b44d1b92 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -637,6 +637,17 @@ ActiveRecord::Schema.define(version: 20180529093006) do t.string "external_ip" end + create_table "clusters_applications_jupyter", force: :cascade do |t| + t.integer "cluster_id", null: false + t.integer "oauth_application_id" + t.integer "status", null: false + t.string "version", null: false + t.string "hostname" + t.datetime_with_timezone "created_at", null: false + t.datetime_with_timezone "updated_at", null: false + t.text "status_reason" + end + create_table "clusters_applications_prometheus", force: :cascade do |t| t.integer "cluster_id", null: false t.integer "status", null: false @@ -2198,6 +2209,8 @@ ActiveRecord::Schema.define(version: 20180529093006) do add_foreign_key "clusters", "users", on_delete: :nullify add_foreign_key "clusters_applications_helm", "clusters", on_delete: :cascade add_foreign_key "clusters_applications_ingress", "clusters", name: "fk_753a7b41c1", on_delete: :cascade + add_foreign_key "clusters_applications_jupyter", "clusters", on_delete: :cascade + add_foreign_key "clusters_applications_jupyter", "oauth_applications", on_delete: :nullify add_foreign_key "clusters_applications_prometheus", "clusters", name: "fk_557e773639", on_delete: :cascade add_foreign_key "clusters_applications_runners", "ci_runners", column: "runner_id", name: "fk_02de2ded36", on_delete: :nullify add_foreign_key "clusters_applications_runners", "clusters", on_delete: :cascade |