Skip to content
代码片段 群组 项目
未验证 提交 cd735d86 编辑于 作者: Adam Hegyi's avatar Adam Hegyi 提交者: GitLab
浏览文件

Merge branch '451241-remove-backend-components-of-automatic-ai-summary-feature-2' into 'master'

Remove diff_summary database table

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/148133



Merged-by: default avatarAdam Hegyi <ahegyi@gitlab.com>
Approved-by: default avatarAdam Hegyi <ahegyi@gitlab.com>
Co-authored-by: default avatarMarc Shaw <mshaw@gitlab.com>
No related branches found
No related tags found
无相关合并请求
...@@ -24,3 +24,5 @@ desired_sharding_key: ...@@ -24,3 +24,5 @@ desired_sharding_key:
table: merge_request_diffs table: merge_request_diffs
sharding_key: project_id sharding_key: project_id
belongs_to: merge_request_diff belongs_to: merge_request_diff
removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/148133/
removed_in_milestone: '17.0'
# frozen_string_literal: true
# See https://docs.gitlab.com/ee/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class DropMergeRequestDiffLlmSummaryTable < Gitlab::Database::Migration[2.2]
milestone '17.0'
def up
drop_table :merge_request_diff_llm_summaries
end
def down
create_table :merge_request_diff_llm_summaries do |t|
t.references :user, null: true, index: true
t.references :review, null: false, index: true
t.references :merge_request_diff, null: false
t.timestamps_with_timezone null: false
t.integer :provider, null: false, limit: 2
t.text :content, null: false, limit: 2056
end
end
end
fd6ed262806e041f98b707d2634f1a0f9c0bcaab24a0a3e0c272d929474af8c2
\ No newline at end of file
...@@ -11140,26 +11140,6 @@ CREATE TABLE merge_request_diff_files ( ...@@ -11140,26 +11140,6 @@ CREATE TABLE merge_request_diff_files (
generated boolean generated boolean
); );
   
CREATE TABLE merge_request_diff_llm_summaries (
id bigint NOT NULL,
user_id bigint,
merge_request_diff_id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
provider smallint NOT NULL,
content text NOT NULL,
CONSTRAINT check_93955f22ad CHECK ((char_length(content) <= 2056))
);
CREATE SEQUENCE merge_request_diff_llm_summaries_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE merge_request_diff_llm_summaries_id_seq OWNED BY merge_request_diff_llm_summaries.id;
CREATE TABLE merge_request_diffs ( CREATE TABLE merge_request_diffs (
id integer NOT NULL, id integer NOT NULL,
state character varying, state character varying,
...@@ -19392,8 +19372,6 @@ ALTER TABLE ONLY merge_request_diff_commit_users ALTER COLUMN id SET DEFAULT nex ...@@ -19392,8 +19372,6 @@ ALTER TABLE ONLY merge_request_diff_commit_users ALTER COLUMN id SET DEFAULT nex
   
ALTER TABLE ONLY merge_request_diff_details ALTER COLUMN merge_request_diff_id SET DEFAULT nextval('merge_request_diff_details_merge_request_diff_id_seq'::regclass); ALTER TABLE ONLY merge_request_diff_details ALTER COLUMN merge_request_diff_id SET DEFAULT nextval('merge_request_diff_details_merge_request_diff_id_seq'::regclass);
   
ALTER TABLE ONLY merge_request_diff_llm_summaries ALTER COLUMN id SET DEFAULT nextval('merge_request_diff_llm_summaries_id_seq'::regclass);
ALTER TABLE ONLY merge_request_diffs ALTER COLUMN id SET DEFAULT nextval('merge_request_diffs_id_seq'::regclass); ALTER TABLE ONLY merge_request_diffs ALTER COLUMN id SET DEFAULT nextval('merge_request_diffs_id_seq'::regclass);
   
ALTER TABLE ONLY merge_request_metrics ALTER COLUMN id SET DEFAULT nextval('merge_request_metrics_id_seq'::regclass); ALTER TABLE ONLY merge_request_metrics ALTER COLUMN id SET DEFAULT nextval('merge_request_metrics_id_seq'::regclass);
...@@ -21635,9 +21613,6 @@ ALTER TABLE ONLY merge_request_diff_details ...@@ -21635,9 +21613,6 @@ ALTER TABLE ONLY merge_request_diff_details
ALTER TABLE ONLY merge_request_diff_files ALTER TABLE ONLY merge_request_diff_files
ADD CONSTRAINT merge_request_diff_files_pkey PRIMARY KEY (merge_request_diff_id, relative_order); ADD CONSTRAINT merge_request_diff_files_pkey PRIMARY KEY (merge_request_diff_id, relative_order);
   
ALTER TABLE ONLY merge_request_diff_llm_summaries
ADD CONSTRAINT merge_request_diff_llm_summaries_pkey PRIMARY KEY (id);
ALTER TABLE ONLY merge_request_diffs ALTER TABLE ONLY merge_request_diffs
ADD CONSTRAINT merge_request_diffs_pkey PRIMARY KEY (id); ADD CONSTRAINT merge_request_diffs_pkey PRIMARY KEY (id);
   
...@@ -26017,8 +25992,6 @@ CREATE INDEX index_merge_request_diff_details_on_verification_state ON merge_req ...@@ -26017,8 +25992,6 @@ CREATE INDEX index_merge_request_diff_details_on_verification_state ON merge_req
   
CREATE INDEX index_merge_request_diff_details_pending_verification ON merge_request_diff_details USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0); CREATE INDEX index_merge_request_diff_details_pending_verification ON merge_request_diff_details USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0);
   
CREATE INDEX index_merge_request_diff_llm_summaries_on_user_id ON merge_request_diff_llm_summaries USING btree (user_id);
CREATE INDEX index_merge_request_diffs_by_id_partial ON merge_request_diffs USING btree (id) WHERE ((files_count > 0) AND ((NOT stored_externally) OR (stored_externally IS NULL))); CREATE INDEX index_merge_request_diffs_by_id_partial ON merge_request_diffs USING btree (id) WHERE ((files_count > 0) AND ((NOT stored_externally) OR (stored_externally IS NULL)));
   
CREATE INDEX index_merge_request_diffs_on_external_diff ON merge_request_diffs USING btree (external_diff); CREATE INDEX index_merge_request_diffs_on_external_diff ON merge_request_diffs USING btree (external_diff);
...@@ -28075,8 +28048,6 @@ CREATE UNIQUE INDEX unique_instance_google_cloud_logging_configurations ON audit ...@@ -28075,8 +28048,6 @@ CREATE UNIQUE INDEX unique_instance_google_cloud_logging_configurations ON audit
   
CREATE UNIQUE INDEX unique_instance_google_cloud_logging_configurations_name ON audit_events_instance_google_cloud_logging_configurations USING btree (name); CREATE UNIQUE INDEX unique_instance_google_cloud_logging_configurations_name ON audit_events_instance_google_cloud_logging_configurations USING btree (name);
   
CREATE UNIQUE INDEX unique_merge_request_diff_llm_summaries_on_mr_diff_id ON merge_request_diff_llm_summaries USING btree (merge_request_diff_id);
CREATE UNIQUE INDEX unique_merge_request_metrics_by_merge_request_id ON merge_request_metrics USING btree (merge_request_id); CREATE UNIQUE INDEX unique_merge_request_metrics_by_merge_request_id ON merge_request_metrics USING btree (merge_request_id);
   
CREATE INDEX unique_ml_model_versions_on_model_id_and_id ON ml_model_versions USING btree (model_id, id DESC); CREATE INDEX unique_ml_model_versions_on_model_id_and_id ON ml_model_versions USING btree (model_id, id DESC);
...@@ -30053,9 +30024,6 @@ ALTER TABLE ONLY subscription_add_on_purchases ...@@ -30053,9 +30024,6 @@ ALTER TABLE ONLY subscription_add_on_purchases
ALTER TABLE ONLY ci_pipeline_schedule_variables ALTER TABLE ONLY ci_pipeline_schedule_variables
ADD CONSTRAINT fk_41c35fda51 FOREIGN KEY (pipeline_schedule_id) REFERENCES ci_pipeline_schedules(id) ON DELETE CASCADE; ADD CONSTRAINT fk_41c35fda51 FOREIGN KEY (pipeline_schedule_id) REFERENCES ci_pipeline_schedules(id) ON DELETE CASCADE;
   
ALTER TABLE ONLY merge_request_diff_llm_summaries
ADD CONSTRAINT fk_42551b9fea FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
ALTER TABLE ONLY namespace_bans ALTER TABLE ONLY namespace_bans
ADD CONSTRAINT fk_4275fbb1d7 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; ADD CONSTRAINT fk_4275fbb1d7 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
   
...@@ -30851,9 +30819,6 @@ ALTER TABLE ONLY ml_candidates ...@@ -30851,9 +30819,6 @@ ALTER TABLE ONLY ml_candidates
ALTER TABLE ONLY integrations ALTER TABLE ONLY integrations
ADD CONSTRAINT fk_e8fe908a34 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; ADD CONSTRAINT fk_e8fe908a34 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
   
ALTER TABLE ONLY merge_request_diff_llm_summaries
ADD CONSTRAINT fk_e98931c3cb FOREIGN KEY (merge_request_diff_id) REFERENCES merge_request_diffs(id) ON DELETE CASCADE;
ALTER TABLE ONLY pages_domains ALTER TABLE ONLY pages_domains
ADD CONSTRAINT fk_ea2f6dfc6f FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; ADD CONSTRAINT fk_ea2f6dfc6f FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
   
# rubocop:disable Style/ClassAndModuleChildren -- Will be removed when removing the table
# frozen_string_literal: true
class MergeRequest::DiffLlmSummary < ApplicationRecord
belongs_to :merge_request_diff
belongs_to :user, optional: true
validates :merge_request_diff_id, uniqueness: true
validates :provider, presence: true
validates :content, presence: true, length: { maximum: 2056 }
enum provider: { open_ai: 0, vertex_ai: 1 }
end
# rubocop:enable Style/ClassAndModuleChildren
# Added for JiHu
MergeRequest::DiffLlmSummary.prepend_mod
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册