Add explicit primary key definition to AuditEvent
What does this MR do?
Related to #241267 (closed)
As a part of the change for partitioning audit_events
, the AuditEvent
model will need to have the primary key explicitly set to use only the id
column.
While the database table also includes the partition key (created_at
) in the primary key definition, due to Rails support for multi-column PK it's easier to simply use the id
column, which should still be unique as it's backed by a sequence.
This change was originally part of !47581 (merged), but was decided to be split into a separate MR and released to prevent any issues with no-downtime deploys, see specifically this comment: !47581 (comment 457114294)
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team