Skip to content

Commit

Permalink
feat: code reference table
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubisoft-potato committed Dec 31, 2024
1 parent 89b4af1 commit bb4423e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
21 changes: 21 additions & 0 deletions migration/mysql/20241221061735_add_code_ref-table.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
CREATE TABLE code_references (
id varchar(255) NOT NULL,
feature_id VARCHAR(255) NOT NULL,
file_path VARCHAR(512) NOT NULL,
line_number INT NOT NULL,
code_snippet TEXT NOT NULL,
content_hash VARCHAR(64) NOT NULL,
aliases JSON,
repository_name VARCHAR(255) NOT NULL,
repository_owner VARCHAR(255) NOT NULL,
repository_type ENUM('GITHUB', 'GITLAB', 'BITBUCKET', 'CUSTOM') NOT NULL,
repository_branch VARCHAR(255) NOT NULL,
commit_hash VARCHAR(40) NOT NULL,
environment_id VARCHAR(255) NOT NULL,
created_at BIGINT NOT NULL,
updated_at BIGINT NOT NULL,
PRIMARY KEY (id),
INDEX idx_file_path (file_path),
CONSTRAINT foreign_code_references_feature FOREIGN KEY (feature_id, environment_id)
REFERENCES feature (id, environment_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
3 changes: 2 additions & 1 deletion migration/mysql/atlas.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
h1:AGn88ValxPTnM5lsIfH/bIBTs2DBNJbhOsRTQqf0hVY=
h1:92ygCE4ywV+WbIHU6g+fXHeZNyXsTU5iSZQHMYKj8A0=
20240626022133_initialization.sql h1:u9qmPkwWX7PN92qEcDDfR92lrMpwadQSMxUJgv6LjQ0=
20240708065726_update_audit_log_table.sql h1:k7gK8Njv1yHMsYXAQtSgMaSbXy4lxyZ9MPzbJyMyyoM=
20240815043128_update_auto_ops_rule_table.sql h1:6ib+XfS1uu9AUO3qESvkpUfOu3qUsLwHm9KHcrGEz0E=
Expand All @@ -17,3 +17,4 @@ h1:AGn88ValxPTnM5lsIfH/bIBTs2DBNJbhOsRTQqf0hVY=
20241206094413_sync_maintainer_api_key_table.sql h1:M1Ui8fGVyg7E+w/21cFnBXdP7Qgwr+x0PGEKA7u6jeg=
20241216133335_drop_old_tables.sql h1:E6oFBPoR7E8843ifn5iTK6aJu5CbgnlQOHQQThxvFHI=
20241216133465_update_collate.sql h1:UglZ6g19ypeh4Wczon6BZbFoqW6UROEUobajof5jAlI=
20241221061735_add_code_ref-table.sql h1:xQS9cxRdNtmYyOi7lHlZTpNPha7VLAQZEGAYW5agiR4=

0 comments on commit bb4423e

Please sign in to comment.