From 6168721025dd8e98caeb2bf6844273e6690eaf69 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 7 Feb 2020 00:09:12 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- .../20190926225633_create_x509_signatures.rb | 41 ++++++++++++++++++++++ ...create_commit_signature_worker_sidekiq_queue.rb | 15 ++++++++ db/schema.rb | 39 +++++++++++++++++++- 3 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20190926225633_create_x509_signatures.rb create mode 100644 db/post_migrate/20200206091544_migrate_create_commit_signature_worker_sidekiq_queue.rb (limited to 'db') diff --git a/db/migrate/20190926225633_create_x509_signatures.rb b/db/migrate/20190926225633_create_x509_signatures.rb new file mode 100644 index 00000000000..88f6b03afba --- /dev/null +++ b/db/migrate/20190926225633_create_x509_signatures.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class CreateX509Signatures < ActiveRecord::Migration[5.2] + DOWNTIME = false + + def change + create_table :x509_issuers do |t| + t.timestamps_with_timezone null: false + + t.string :subject_key_identifier, index: true, null: false, unique: true, limit: 255 + t.string :subject, null: false, limit: 255 + t.string :crl_url, null: false, limit: 255 + end + + create_table :x509_certificates do |t| + t.timestamps_with_timezone null: false + + t.string :subject_key_identifier, index: true, null: false, unique: true, limit: 255 + t.string :subject, null: false, limit: 255 + t.string :email, null: false, limit: 255 + t.binary :serial_number, null: false + + t.integer :certificate_status, limit: 2, default: 0, null: false + + t.references :x509_issuer, index: true, null: false, foreign_key: { on_delete: :cascade } + end + + create_table :x509_commit_signatures do |t| + t.timestamps_with_timezone null: false + + t.references :project, index: true, null: false, foreign_key: { on_delete: :cascade } + t.references :x509_certificate, index: true, null: false, foreign_key: { on_delete: :cascade } + + t.binary :commit_sha, index: true, null: false + t.integer :verification_status, limit: 2, default: 0, null: false + end + end +end diff --git a/db/post_migrate/20200206091544_migrate_create_commit_signature_worker_sidekiq_queue.rb b/db/post_migrate/20200206091544_migrate_create_commit_signature_worker_sidekiq_queue.rb new file mode 100644 index 00000000000..eec9abf4a31 --- /dev/null +++ b/db/post_migrate/20200206091544_migrate_create_commit_signature_worker_sidekiq_queue.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class MigrateCreateCommitSignatureWorkerSidekiqQueue < ActiveRecord::Migration[5.2] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def up + sidekiq_queue_migrate 'create_gpg_signature', to: 'create_commit_signature' + end + + def down + sidekiq_queue_migrate 'create_commit_signature', to: 'create_gpg_signature' + end +end diff --git a/db/schema.rb b/db/schema.rb index f55f3df31cf..35422461741 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2020_02_05_143231) do +ActiveRecord::Schema.define(version: 2020_02_06_091544) do # These are extensions that must be enabled in order to support this database enable_extension "pg_trgm" @@ -4482,6 +4482,40 @@ ActiveRecord::Schema.define(version: 2020_02_05_143231) do t.index ["type"], name: "index_web_hooks_on_type" end + create_table "x509_certificates", force: :cascade do |t| + t.datetime_with_timezone "created_at", null: false + t.datetime_with_timezone "updated_at", null: false + t.string "subject_key_identifier", limit: 255, null: false + t.string "subject", limit: 255, null: false + t.string "email", limit: 255, null: false + t.binary "serial_number", null: false + t.integer "certificate_status", limit: 2, default: 0, null: false + t.bigint "x509_issuer_id", null: false + t.index ["subject_key_identifier"], name: "index_x509_certificates_on_subject_key_identifier" + t.index ["x509_issuer_id"], name: "index_x509_certificates_on_x509_issuer_id" + end + + create_table "x509_commit_signatures", force: :cascade do |t| + t.datetime_with_timezone "created_at", null: false + t.datetime_with_timezone "updated_at", null: false + t.bigint "project_id", null: false + t.bigint "x509_certificate_id", null: false + t.binary "commit_sha", null: false + t.integer "verification_status", limit: 2, default: 0, null: false + t.index ["commit_sha"], name: "index_x509_commit_signatures_on_commit_sha" + t.index ["project_id"], name: "index_x509_commit_signatures_on_project_id" + t.index ["x509_certificate_id"], name: "index_x509_commit_signatures_on_x509_certificate_id" + end + + create_table "x509_issuers", force: :cascade do |t| + t.datetime_with_timezone "created_at", null: false + t.datetime_with_timezone "updated_at", null: false + t.string "subject_key_identifier", limit: 255, null: false + t.string "subject", limit: 255, null: false + t.string "crl_url", limit: 255, null: false + t.index ["subject_key_identifier"], name: "index_x509_issuers_on_subject_key_identifier" + end + create_table "zoom_meetings", force: :cascade do |t| t.bigint "project_id", null: false t.bigint "issue_id", null: false @@ -4973,6 +5007,9 @@ ActiveRecord::Schema.define(version: 2020_02_05_143231) do add_foreign_key "vulnerability_scanners", "projects", on_delete: :cascade add_foreign_key "web_hook_logs", "web_hooks", on_delete: :cascade add_foreign_key "web_hooks", "projects", name: "fk_0c8ca6d9d1", on_delete: :cascade + add_foreign_key "x509_certificates", "x509_issuers", on_delete: :cascade + add_foreign_key "x509_commit_signatures", "projects", on_delete: :cascade + add_foreign_key "x509_commit_signatures", "x509_certificates", on_delete: :cascade add_foreign_key "zoom_meetings", "issues", on_delete: :cascade add_foreign_key "zoom_meetings", "projects", on_delete: :cascade end -- cgit v1.2.3