Commit d6348de5 authored by Max Woolf's avatar Max Woolf Committed by Andreas Brandl

Database migrations for AuditEvent#target_details

This is the database-side of
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/36567.
parent 2aec0058
---
title: Add target_details column to AuditEvent table
merge_request: 37430
author:
type: changed
# frozen_string_literal: true
class AddTargetDetailsToAuditEvent < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def up
with_lock_retries do
# rubocop:disable Migration/AddLimitToTextColumns
add_column(:audit_events, :target_details, :text)
# rubocop:enable Migration/AddLimitToTextColumns
end
end
def down
with_lock_retries do
remove_column(:audit_events, :target_details)
end
end
end
# frozen_string_literal: true
class AddTextLimitToAuditEventTargetDetails < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_text_limit :audit_events, :target_details, 5_500
end
def down
remove_text_limit :audit_events, :target_details
end
end
......@@ -9400,8 +9400,10 @@ CREATE TABLE public.audit_events (
ip_address inet,
author_name text,
entity_path text,
target_details text,
CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)),
CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255))
CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)),
CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500))
);
CREATE SEQUENCE public.audit_events_id_seq
......@@ -23987,10 +23989,12 @@ COPY "schema_migrations" (version) FROM STDIN;
20200713071042
20200713141854
20200713152443
20200715124210
20200715135130
20200715202659
20200716044023
20200716120419
20200716145156
20200718040100
20200718040200
20200718040300
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment