Create MergeRequestReviewLLmSummary model and table
What does this MR do and why?
This creates the merge_request_review_llm_summaries
table and
the model. It'll be used later on (!124417 (merged)) for storing review summaries
generated by AI.
Migration details:
db:migrate
main: == [advisory_lock_connection] object_id: 223900, pg_backend_pid: 84031
main: == 20230622044119 CreateMergeRequestReviewLlmSummary: migrating ===============
main: -- create_table(:merge_request_review_llm_summaries)
main: -- quote_column_name(:content)
main: -> 0.0000s
main: -> 0.0087s
main: == 20230622044119 CreateMergeRequestReviewLlmSummary: migrated (0.0948s) ======
main: == [advisory_lock_connection] object_id: 223900, pg_backend_pid: 84031
ci: == [advisory_lock_connection] object_id: 224180, pg_backend_pid: 84033
ci: == 20230622044119 CreateMergeRequestReviewLlmSummary: migrating ===============
ci: -- create_table(:merge_request_review_llm_summaries)
ci: -- quote_column_name(:content)
ci: -> 0.0000s
ci: -> 0.0079s
I, [2023-06-22T13:22:56.121591 #83865] INFO -- : Database: 'ci', Table: 'merge_request_review_llm_summaries': Lock Writes
ci: == 20230622044119 CreateMergeRequestReviewLlmSummary: migrated (0.0200s) ======
ci: == [advisory_lock_connection] object_id: 224180, pg_backend_pid: 84033
main: == [advisory_lock_connection] object_id: 224380, pg_backend_pid: 84036
main: == 20230622051925 AddUserForeignKeyToMergeRequestReviewLlmSummary: migrating ==
main: -- transaction_open?()
main: -> 0.0000s
main: -- transaction_open?()
main: -> 0.0000s
main: -- execute("ALTER TABLE merge_request_review_llm_summaries ADD CONSTRAINT fk_d07eeb6392 FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE NOT VALID;")
main: -> 0.0013s
main: -- execute("SET statement_timeout TO 0")
main: -> 0.0003s
main: -- execute("ALTER TABLE merge_request_review_llm_summaries VALIDATE CONSTRAINT fk_d07eeb6392;")
main: -> 0.0019s
main: -- execute("RESET statement_timeout")
main: -> 0.0003s
main: == 20230622051925 AddUserForeignKeyToMergeRequestReviewLlmSummary: migrated (0.0477s)
main: == [advisory_lock_connection] object_id: 224380, pg_backend_pid: 84036
ci: == [advisory_lock_connection] object_id: 224600, pg_backend_pid: 84038
ci: == 20230622051925 AddUserForeignKeyToMergeRequestReviewLlmSummary: migrating ==
ci: -- transaction_open?()
ci: -> 0.0000s
ci: -- transaction_open?()
ci: -> 0.0000s
ci: -- execute("ALTER TABLE merge_request_review_llm_summaries ADD CONSTRAINT fk_d07eeb6392 FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE NOT VALID;")
ci: -> 0.0024s
ci: -- execute("SET statement_timeout TO 0")
ci: -> 0.0004s
ci: -- execute("ALTER TABLE merge_request_review_llm_summaries VALIDATE CONSTRAINT fk_d07eeb6392;")
ci: -> 0.0087s
ci: -- execute("RESET statement_timeout")
ci: -> 0.0006s
ci: == 20230622051925 AddUserForeignKeyToMergeRequestReviewLlmSummary: migrated (0.0502s)
ci: == [advisory_lock_connection] object_id: 224600, pg_backend_pid: 84038
main: == [advisory_lock_connection] object_id: 224860, pg_backend_pid: 84041
main: == 20230622051943 AddReviewForeignKeyToMergeRequestReviewLlmSummary: migrating
main: -- transaction_open?()
main: -> 0.0000s
main: -- transaction_open?()
main: -> 0.0000s
main: -- execute("ALTER TABLE merge_request_review_llm_summaries ADD CONSTRAINT fk_6154a9cb89 FOREIGN KEY (review_id) REFERENCES reviews (id) ON DELETE CASCADE NOT VALID;")
main: -> 0.0007s
main: -- execute("SET statement_timeout TO 0")
main: -> 0.0002s
main: -- execute("ALTER TABLE merge_request_review_llm_summaries VALIDATE CONSTRAINT fk_6154a9cb89;")
main: -> 0.0020s
main: -- execute("RESET statement_timeout")
main: -> 0.0001s
main: == 20230622051943 AddReviewForeignKeyToMergeRequestReviewLlmSummary: migrated (0.0169s)
main: == [advisory_lock_connection] object_id: 224860, pg_backend_pid: 84041
ci: == [advisory_lock_connection] object_id: 225060, pg_backend_pid: 84043
ci: == 20230622051943 AddReviewForeignKeyToMergeRequestReviewLlmSummary: migrating
ci: -- transaction_open?()
ci: -> 0.0000s
ci: -- transaction_open?()
ci: -> 0.0000s
ci: -- execute("ALTER TABLE merge_request_review_llm_summaries ADD CONSTRAINT fk_6154a9cb89 FOREIGN KEY (review_id) REFERENCES reviews (id) ON DELETE CASCADE NOT VALID;")
ci: -> 0.0006s
ci: -- execute("SET statement_timeout TO 0")
ci: -> 0.0002s
ci: -- execute("ALTER TABLE merge_request_review_llm_summaries VALIDATE CONSTRAINT fk_6154a9cb89;")
ci: -> 0.0019s
ci: -- execute("RESET statement_timeout")
ci: -> 0.0002s
ci: == 20230622051943 AddReviewForeignKeyToMergeRequestReviewLlmSummary: migrated (0.0217s)
ci: == [advisory_lock_connection] object_id: 225060, pg_backend_pid: 84043
main: == [advisory_lock_connection] object_id: 226360, pg_backend_pid: 84046
main: == 20230622052015 AddMergeRequestDiffForeignKeyToMergeRequestReviewLlmSummary: migrating
main: -- transaction_open?()
main: -> 0.0000s
main: -- transaction_open?()
main: -> 0.0000s
main: -- execute("ALTER TABLE merge_request_review_llm_summaries ADD CONSTRAINT fk_8ec009c6ab FOREIGN KEY (merge_request_diff_id) REFERENCES merge_request_diffs (id) ON DELETE CASCADE NOT VALID;")
main: -> 0.0008s
main: -- execute("SET statement_timeout TO 0")
main: -> 0.0003s
main: -- execute("ALTER TABLE merge_request_review_llm_summaries VALIDATE CONSTRAINT fk_8ec009c6ab;")
main: -> 0.0009s
main: -- execute("RESET statement_timeout")
main: -> 0.0003s
main: == 20230622052015 AddMergeRequestDiffForeignKeyToMergeRequestReviewLlmSummary: migrated (0.0161s)
main: == [advisory_lock_connection] object_id: 226360, pg_backend_pid: 84046
ci: == [advisory_lock_connection] object_id: 227660, pg_backend_pid: 84048
ci: == 20230622052015 AddMergeRequestDiffForeignKeyToMergeRequestReviewLlmSummary: migrating
ci: -- transaction_open?()
ci: -> 0.0000s
ci: -- transaction_open?()
ci: -> 0.0000s
ci: -- execute("ALTER TABLE merge_request_review_llm_summaries ADD CONSTRAINT fk_8ec009c6ab FOREIGN KEY (merge_request_diff_id) REFERENCES merge_request_diffs (id) ON DELETE CASCADE NOT VALID;")
ci: -> 0.0011s
ci: -- execute("SET statement_timeout TO 0")
ci: -> 0.0004s
ci: -- execute("ALTER TABLE merge_request_review_llm_summaries VALIDATE CONSTRAINT fk_8ec009c6ab;")
ci: -> 0.0033s
ci: -- execute("RESET statement_timeout")
ci: -> 0.0003s
ci: == 20230622052015 AddMergeRequestDiffForeignKeyToMergeRequestReviewLlmSummary: migrated (0.0252s)
ci: == [advisory_lock_connection] object_id: 227660, pg_backend_pid: 84048
db:rollback
main: == [advisory_lock_connection] object_id: 223400, pg_backend_pid: 86500
main: == 20230622052015 AddMergeRequestDiffForeignKeyToMergeRequestReviewLlmSummary: reverting
main: -- transaction_open?()
main: -> 0.0000s
main: -- remove_foreign_key(:merge_request_review_llm_summaries, {:column=>:merge_request_diff_id})
main: -> 0.0569s
main: == 20230622052015 AddMergeRequestDiffForeignKeyToMergeRequestReviewLlmSummary: reverted (0.0700s)
main: == [advisory_lock_connection] object_id: 223400, pg_backend_pid: 86500
ci: == [advisory_lock_connection] object_id: 227260, pg_backend_pid: 86881
ci: == 20230622052015 AddMergeRequestDiffForeignKeyToMergeRequestReviewLlmSummary: reverting
ci: -- transaction_open?()
ci: -> 0.0000s
ci: -- remove_foreign_key(:merge_request_review_llm_summaries, {:column=>:merge_request_diff_id})
ci: -> 0.0102s
ci: == 20230622052015 AddMergeRequestDiffForeignKeyToMergeRequestReviewLlmSummary: reverted (0.0192s)
ci: == [advisory_lock_connection] object_id: 227260, pg_backend_pid: 86881
main: == [advisory_lock_connection] object_id: 223400, pg_backend_pid: 87412
main: == 20230622051943 AddReviewForeignKeyToMergeRequestReviewLlmSummary: reverting
main: -- transaction_open?()
main: -> 0.0000s
main: -- remove_foreign_key(:merge_request_review_llm_summaries, {:column=>:review_id})
main: -> 0.0548s
main: == 20230622051943 AddReviewForeignKeyToMergeRequestReviewLlmSummary: reverted (0.0691s)
main: == [advisory_lock_connection] object_id: 223400, pg_backend_pid: 87412
ci: == [advisory_lock_connection] object_id: 227260, pg_backend_pid: 87793
ci: == 20230622051943 AddReviewForeignKeyToMergeRequestReviewLlmSummary: reverting
ci: -- transaction_open?()
ci: -> 0.0000s
ci: -- remove_foreign_key(:merge_request_review_llm_summaries, {:column=>:review_id})
ci: -> 0.0028s
ci: == 20230622051943 AddReviewForeignKeyToMergeRequestReviewLlmSummary: reverted (0.0120s)
ci: == [advisory_lock_connection] object_id: 227260, pg_backend_pid: 87793
main: == [advisory_lock_connection] object_id: 223400, pg_backend_pid: 88336
main: == 20230622051925 AddUserForeignKeyToMergeRequestReviewLlmSummary: reverting ==
main: -- transaction_open?()
main: -> 0.0000s
main: -- remove_foreign_key(:merge_request_review_llm_summaries, {:column=>:user_id})
main: -> 0.0515s
main: == 20230622051925 AddUserForeignKeyToMergeRequestReviewLlmSummary: reverted (0.0651s)
main: == [advisory_lock_connection] object_id: 223400, pg_backend_pid: 88336
ci: == [advisory_lock_connection] object_id: 227260, pg_backend_pid: 88717
ci: == 20230622051925 AddUserForeignKeyToMergeRequestReviewLlmSummary: reverting ==
ci: -- transaction_open?()
ci: -> 0.0000s
ci: -- remove_foreign_key(:merge_request_review_llm_summaries, {:column=>:user_id})
ci: -> 0.0030s
ci: == 20230622051925 AddUserForeignKeyToMergeRequestReviewLlmSummary: reverted (0.0120s)
ci: == [advisory_lock_connection] object_id: 227260, pg_backend_pid: 88717
main: == [advisory_lock_connection] object_id: 223400, pg_backend_pid: 89255
main: == 20230622044119 CreateMergeRequestReviewLlmSummary: reverting ===============
main: -- drop_table(:merge_request_review_llm_summaries)
main: -> 0.0016s
main: == 20230622044119 CreateMergeRequestReviewLlmSummary: reverted (0.0071s) ======
main: == [advisory_lock_connection] object_id: 223400, pg_backend_pid: 89255
ci: == [advisory_lock_connection] object_id: 224300, pg_backend_pid: 89635
ci: == 20230622044119 CreateMergeRequestReviewLlmSummary: reverting ===============
ci: -- drop_table(:merge_request_review_llm_summaries)
ci: -> 0.0014s
ci: == 20230622044119 CreateMergeRequestReviewLlmSummary: reverted (0.0106s) ======
ci: == [advisory_lock_connection] object_id: 224300, pg_backend_pid: 89635
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.
Related to #415359 (closed)
Edited by Patrick Bajao