Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-06 00:09:02 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-06 00:09:02 +0300
commit76623c12c136f43f24c3966ed4b469e2c0b434b7 (patch)
tree7c5ec884c25e03e4fea131a4d112a9d0ccfd59b8 /db
parentb042382bbf5a4977c5b5c6b0a9a33f4e8ca8d16d (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20200203232433_create_security_scan.rb24
-rw-r--r--db/schema.rb10
2 files changed, 34 insertions, 0 deletions
diff --git a/db/migrate/20200203232433_create_security_scan.rb b/db/migrate/20200203232433_create_security_scan.rb
new file mode 100644
index 00000000000..a5fe73efbf2
--- /dev/null
+++ b/db/migrate/20200203232433_create_security_scan.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+class CreateSecurityScan < ActiveRecord::Migration[5.2]
+ DOWNTIME = false
+
+ def change
+ create_table :security_scans, id: :bigserial do |t|
+ t.timestamps_with_timezone null: false
+
+ t.references :build,
+ null: false,
+ index: false,
+ foreign_key: { to_table: :ci_builds, on_delete: :cascade },
+ type: :bigint
+
+ t.integer :scan_type,
+ null: false,
+ index: { name: "idx_security_scans_on_scan_type" },
+ limit: 2
+
+ t.index [:build_id, :scan_type], name: "idx_security_scans_on_build_and_scan_type", unique: true
+ end
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 258530ac3b3..0fa15317003 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -3737,6 +3737,15 @@ ActiveRecord::Schema.define(version: 2020_02_04_131054) do
t.index ["group_id", "token_encrypted"], name: "index_scim_oauth_access_tokens_on_group_id_and_token_encrypted", unique: true
end
+ create_table "security_scans", force: :cascade do |t|
+ t.datetime_with_timezone "created_at", null: false
+ t.datetime_with_timezone "updated_at", null: false
+ t.bigint "build_id", null: false
+ t.integer "scan_type", limit: 2, null: false
+ t.index ["build_id", "scan_type"], name: "idx_security_scans_on_build_and_scan_type", unique: true
+ t.index ["scan_type"], name: "idx_security_scans_on_scan_type"
+ end
+
create_table "self_managed_prometheus_alert_events", force: :cascade do |t|
t.bigint "project_id", null: false
t.bigint "environment_id"
@@ -4863,6 +4872,7 @@ ActiveRecord::Schema.define(version: 2020_02_04_131054) do
add_foreign_key "reviews", "users", column: "author_id", on_delete: :nullify
add_foreign_key "saml_providers", "namespaces", column: "group_id", on_delete: :cascade
add_foreign_key "scim_oauth_access_tokens", "namespaces", column: "group_id", on_delete: :cascade
+ add_foreign_key "security_scans", "ci_builds", column: "build_id", on_delete: :cascade
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