diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-14 15:07:56 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-14 15:07:56 +0000 |
commit | 016af097cb1fa872fdc28a786d16315e55cd2701 (patch) | |
tree | 76f97f90a8048685efb3eb0c543b3a75d99be6ee /db | |
parent | 00b8ecb72c9f77d864aff3572f028613f45af03c (diff) | |
download | gitlab-ce-016af097cb1fa872fdc28a786d16315e55cd2701.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
4 files changed, 74 insertions, 0 deletions
diff --git a/db/migrate/20191127030005_create_serverless_domain_cluster.rb b/db/migrate/20191127030005_create_serverless_domain_cluster.rb new file mode 100644 index 00000000000..7fb24400b0d --- /dev/null +++ b/db/migrate/20191127030005_create_serverless_domain_cluster.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CreateServerlessDomainCluster < ActiveRecord::Migration[5.2] + DOWNTIME = false + + def change + create_table :serverless_domain_cluster, id: false, primary_key: :uuid do |t| + t.references :pages_domain, null: false, foreign_key: { on_delete: :cascade } + t.references :clusters_applications_knative, null: false, + foreign_key: { to_table: :clusters_applications_knative, on_delete: :cascade }, + index: { name: :idx_serverless_domain_cluster_on_clusters_applications_knative, unique: true } + t.references :creator, name: :created_by, foreign_key: { to_table: :users, on_delete: :nullify } + t.timestamps_with_timezone null: false + t.string :uuid, null: false, limit: 14, primary_key: true + end + end +end diff --git a/db/migrate/20191127221608_add_wildcard_and_domain_type_to_pages_domains.rb b/db/migrate/20191127221608_add_wildcard_and_domain_type_to_pages_domains.rb new file mode 100644 index 00000000000..6893a02bcad --- /dev/null +++ b/db/migrate/20191127221608_add_wildcard_and_domain_type_to_pages_domains.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class AddWildcardAndDomainTypeToPagesDomains < ActiveRecord::Migration[5.2] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + PROJECT_TYPE = 2 + + disable_ddl_transaction! + + def up + add_column_with_default :pages_domains, :wildcard, :boolean, default: false + add_column_with_default :pages_domains, :domain_type, :integer, limit: 2, default: PROJECT_TYPE + end + + def down + remove_column :pages_domains, :wildcard + remove_column :pages_domains, :domain_type + end +end diff --git a/db/migrate/20191206022133_add_indexes_to_pages_domains_on_wildcard_and_domain_type.rb b/db/migrate/20191206022133_add_indexes_to_pages_domains_on_wildcard_and_domain_type.rb new file mode 100644 index 00000000000..3c1704a3377 --- /dev/null +++ b/db/migrate/20191206022133_add_indexes_to_pages_domains_on_wildcard_and_domain_type.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddIndexesToPagesDomainsOnWildcardAndDomainType < ActiveRecord::Migration[5.2] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_index :pages_domains, :wildcard + add_concurrent_index :pages_domains, :domain_type + end + + def down + remove_concurrent_index :pages_domains, :wildcard + remove_concurrent_index :pages_domains, :domain_type + end +end diff --git a/db/schema.rb b/db/schema.rb index ac2372a63d0..9ba5fcc41c6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -2951,13 +2951,17 @@ ActiveRecord::Schema.define(version: 2019_12_08_071112) do t.datetime_with_timezone "certificate_valid_not_before" t.datetime_with_timezone "certificate_valid_not_after" t.integer "certificate_source", limit: 2, default: 0, null: false + t.boolean "wildcard", default: false, null: false + t.integer "domain_type", limit: 2, default: 2, null: false t.index ["certificate_source", "certificate_valid_not_after"], name: "index_pages_domains_need_auto_ssl_renewal", where: "(auto_ssl_enabled = true)" t.index ["domain"], name: "index_pages_domains_on_domain", unique: true + t.index ["domain_type"], name: "index_pages_domains_on_domain_type" t.index ["project_id", "enabled_until"], name: "index_pages_domains_on_project_id_and_enabled_until" t.index ["project_id"], name: "index_pages_domains_on_project_id" t.index ["remove_at"], name: "index_pages_domains_on_remove_at" t.index ["verified_at", "enabled_until"], name: "index_pages_domains_on_verified_at_and_enabled_until" t.index ["verified_at"], name: "index_pages_domains_on_verified_at" + t.index ["wildcard"], name: "index_pages_domains_on_wildcard" end create_table "path_locks", id: :serial, force: :cascade do |t| @@ -3654,6 +3658,17 @@ ActiveRecord::Schema.define(version: 2019_12_08_071112) do t.index ["issue_id"], name: "index_sentry_issues_on_issue_id", unique: true end + create_table "serverless_domain_cluster", primary_key: "uuid", id: :string, limit: 14, force: :cascade do |t| + t.bigint "pages_domain_id", null: false + t.bigint "clusters_applications_knative_id", null: false + t.bigint "creator_id" + t.datetime_with_timezone "created_at", null: false + t.datetime_with_timezone "updated_at", null: false + t.index ["clusters_applications_knative_id"], name: "idx_serverless_domain_cluster_on_clusters_applications_knative", unique: true + t.index ["creator_id"], name: "index_serverless_domain_cluster_on_creator_id" + t.index ["pages_domain_id"], name: "index_serverless_domain_cluster_on_pages_domain_id" + end + create_table "service_desk_settings", primary_key: "project_id", id: :bigint, default: nil, force: :cascade do |t| t.string "issue_template_key", limit: 255 end @@ -4714,6 +4729,9 @@ ActiveRecord::Schema.define(version: 2019_12_08_071112) do add_foreign_key "self_managed_prometheus_alert_events", "environments", on_delete: :cascade add_foreign_key "self_managed_prometheus_alert_events", "projects", on_delete: :cascade add_foreign_key "sentry_issues", "issues", on_delete: :cascade + add_foreign_key "serverless_domain_cluster", "clusters_applications_knative", on_delete: :cascade + add_foreign_key "serverless_domain_cluster", "pages_domains", on_delete: :cascade + add_foreign_key "serverless_domain_cluster", "users", column: "creator_id", on_delete: :nullify add_foreign_key "service_desk_settings", "projects", on_delete: :cascade add_foreign_key "services", "projects", name: "fk_71cce407f9", on_delete: :cascade add_foreign_key "slack_integrations", "services", on_delete: :cascade |