diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
commit | 859a6fb938bb9ee2a317c46dfa4fcc1af49608f0 (patch) | |
tree | d7f2700abe6b4ffcb2dcfc80631b2d87d0609239 /db/migrate/20210111051045_create_dast_profiles.rb | |
parent | 446d496a6d000c73a304be52587cd9bbc7493136 (diff) |
Add latest changes from gitlab-org/gitlab@13-9-stable-eev13.9.0-rc42
Diffstat (limited to 'db/migrate/20210111051045_create_dast_profiles.rb')
-rw-r--r-- | db/migrate/20210111051045_create_dast_profiles.rb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/db/migrate/20210111051045_create_dast_profiles.rb b/db/migrate/20210111051045_create_dast_profiles.rb new file mode 100644 index 00000000000..f2667e1222e --- /dev/null +++ b/db/migrate/20210111051045_create_dast_profiles.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +class CreateDastProfiles < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def up + table_comment = { owner: 'group::dynamic analysis', description: 'Profile used to run a DAST on-demand scan' } + + create_table_with_constraints :dast_profiles, comment: table_comment.to_json do |t| # rubocop:disable Migration/AddLimitToTextColumns + t.references :project, null: false, foreign_key: false, index: false + t.references :dast_site_profile, null: false, foreign_key: { on_delete: :cascade } + t.references :dast_scanner_profile, null: false, foreign_key: { on_delete: :cascade } + + t.timestamps_with_timezone + + # rubocop:disable Migration/AddLimitToTextColumns + t.text :name, null: false + t.text :description, null: false + # rubocop:enable Migration/AddLimitToTextColumns + + t.index [:project_id, :name], unique: true + + t.text_limit :name, 255 + t.text_limit :description, 255 + end + end + + def down + with_lock_retries do + drop_table :dast_profiles + end + end +end |