Create Abuse::Events model
What does this MR do and why?
For context, see https://gitlab.com/gitlab-org/modelops/anti-abuse/team-tasks/-/issues/222
Creates the Abuse::Events model and related migrations for use with AbuseReport
and trust scores.
Migrations
20230522180913 Up
main: == [advisory_lock_connection] object_id: 227060, pg_backend_pid: 2952
main: == 20230522180913 CreateAbuseEvents: migrating ================================
main: -- create_table(:abuse_events)
main: -> 0.0385s
main: -- add_index(:abuse_events, [:category, :source])
main: -> 0.0008s
main: == 20230522180913 CreateAbuseEvents: migrated (0.1722s) =======================
20230522180913 Down
main: == [advisory_lock_connection] object_id: 227540, pg_backend_pid: 2382
main: == [advisory_lock_connection] object_id: 227540, pg_backend_pid: 2382
20230522181134 Up
main: == [advisory_lock_connection] object_id: 227060, pg_backend_pid: 3982
main: == 20230522181134 AddForeignKeyConstraintsToAbuseEvents: migrating ============
main: -- transaction_open?()
main: -> 0.0002s
main: -- transaction_open?()
main: -> 0.0000s
main: -- execute("ALTER TABLE abuse_events ADD CONSTRAINT fk_55101e588c FOREIGN KEY (abuse_report_id) REFERENCES abuse_reports (id) ON DELETE SET NULL NOT VALID;")
main: -> 0.0017s
main: -- execute("SET statement_timeout TO 0")
main: -> 0.0002s
main: -- execute("ALTER TABLE abuse_events VALIDATE CONSTRAINT fk_55101e588c;")
main: -> 0.0085s
main: -- execute("RESET statement_timeout")
main: -> 0.0002s
main: == 20230522181134 AddForeignKeyConstraintsToAbuseEvents: migrated (0.2138s) ===
main: == [advisory_lock_connection] object_id: 227060, pg_backend_pid: 3982
20230522181134 Down
main: == [advisory_lock_connection] object_id: 227100, pg_backend_pid: 3549
main: == [advisory_lock_connection] object_id: 227100, pg_backend_pid: 3549
Screenshots or screen recordings
How to set up and validate locally
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Ethan Urie