This repository was archived by the owner on Feb 17, 2026. It is now read-only.
generated from kubrickcode/Template-Repository
-
-
Notifications
You must be signed in to change notification settings - Fork 0
docs: update schema documentation #5
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,24 +15,27 @@ | |
| | created_at | timestamp with time zone | now() | false | | | | | ||
| | updated_at | timestamp with time zone | now() | false | | | | | ||
| | version | integer | 1 | false | | | | | ||
| | user_id | uuid | | false | | [public.users](public.users.md) | | | ||
|
|
||
| ## Constraints | ||
|
|
||
| | Name | Type | Definition | | ||
| | ----------------------------------------- | ----------- | ------------------------------------------------------------------- | | ||
| | fk_spec_documents_analysis | FOREIGN KEY | FOREIGN KEY (analysis_id) REFERENCES analyses(id) ON DELETE CASCADE | | ||
| | spec_documents_pkey | PRIMARY KEY | PRIMARY KEY (id) | | ||
| | uq_spec_documents_analysis_lang_version | UNIQUE | UNIQUE (analysis_id, language, version) | | ||
| | uq_spec_documents_hash_lang_model_version | UNIQUE | UNIQUE (content_hash, language, model_id, version) | | ||
| | Name | Type | Definition | | ||
| | ---------------------------------------------- | ----------- | ------------------------------------------------------------------- | | ||
| | fk_spec_documents_analysis | FOREIGN KEY | FOREIGN KEY (analysis_id) REFERENCES analyses(id) ON DELETE CASCADE | | ||
| | fk_spec_documents_user | FOREIGN KEY | FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE | | ||
| | spec_documents_pkey | PRIMARY KEY | PRIMARY KEY (id) | | ||
| | uq_spec_documents_user_analysis_lang_version | UNIQUE | UNIQUE (user_id, analysis_id, language, version) | | ||
| | uq_spec_documents_user_hash_lang_model_version | UNIQUE | UNIQUE (user_id, content_hash, language, model_id, version) | | ||
|
|
||
| ## Indexes | ||
|
|
||
| | Name | Definition | | ||
| | ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| | spec_documents_pkey | CREATE UNIQUE INDEX spec_documents_pkey ON public.spec_documents USING btree (id) | | ||
| | idx_spec_documents_analysis | CREATE INDEX idx_spec_documents_analysis ON public.spec_documents USING btree (analysis_id) | | ||
| | uq_spec_documents_analysis_lang_version | CREATE UNIQUE INDEX uq_spec_documents_analysis_lang_version ON public.spec_documents USING btree (analysis_id, language, version) | | ||
| | uq_spec_documents_hash_lang_model_version | CREATE UNIQUE INDEX uq_spec_documents_hash_lang_model_version ON public.spec_documents USING btree (content_hash, language, model_id, version) | | ||
| | Name | Definition | | ||
| | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | | ||
| | spec_documents_pkey | CREATE UNIQUE INDEX spec_documents_pkey ON public.spec_documents USING btree (id) | | ||
| | idx_spec_documents_analysis | CREATE INDEX idx_spec_documents_analysis ON public.spec_documents USING btree (analysis_id) | | ||
| | uq_spec_documents_user_analysis_lang_version | CREATE UNIQUE INDEX uq_spec_documents_user_analysis_lang_version ON public.spec_documents USING btree (user_id, analysis_id, language, version) | | ||
| | uq_spec_documents_user_hash_lang_model_version | CREATE UNIQUE INDEX uq_spec_documents_user_hash_lang_model_version ON public.spec_documents USING btree (user_id, content_hash, language, model_id, version) | | ||
| | idx_spec_documents_user_created | CREATE INDEX idx_spec_documents_user_created ON public.spec_documents USING btree (user_id, created_at) | | ||
|
|
||
| ## Relations | ||
|
|
||
|
|
@@ -43,6 +46,7 @@ erDiagram | |
| "public.user_specview_history" }o--|| "public.spec_documents" : "FOREIGN KEY (document_id) REFERENCES spec_documents(id) ON DELETE CASCADE" | ||
| "public.usage_events" }o--o| "public.spec_documents" : "FOREIGN KEY (document_id) REFERENCES spec_documents(id) ON DELETE SET NULL" | ||
| "public.spec_documents" }o--|| "public.analyses" : "FOREIGN KEY (analysis_id) REFERENCES analyses(id) ON DELETE CASCADE" | ||
| "public.spec_documents" }o--|| "public.users" : "FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE" | ||
|
|
||
| "public.spec_documents" { | ||
| uuid id | ||
|
|
@@ -54,6 +58,7 @@ erDiagram | |
| timestamp_with_time_zone created_at | ||
| timestamp_with_time_zone updated_at | ||
| integer version | ||
| uuid user_id FK | ||
| } | ||
| "public.spec_domains" { | ||
| uuid id | ||
|
|
@@ -96,6 +101,16 @@ erDiagram | |
| timestamp_with_time_zone committed_at | ||
| varchar_100_ parser_version | ||
| } | ||
| "public.users" { | ||
| uuid id | ||
| varchar_255_ email | ||
| varchar_255_ username | ||
| text avatar_url | ||
| timestamp_with_time_zone last_login_at | ||
| timestamp_with_time_zone created_at | ||
| timestamp_with_time_zone updated_at | ||
| integer token_version | ||
| } | ||
|
Comment on lines
+104
to
+113
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| ``` | ||
|
|
||
| --- | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -66,6 +66,7 @@ erDiagram | |
| timestamp_with_time_zone created_at | ||
| timestamp_with_time_zone updated_at | ||
| integer version | ||
| uuid user_id FK | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| } | ||
| ``` | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -86,6 +86,7 @@ erDiagram | |
| timestamp_with_time_zone created_at | ||
| timestamp_with_time_zone updated_at | ||
| integer version | ||
| uuid user_id FK | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| } | ||
| ``` | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,6 +65,7 @@ erDiagram | |
| timestamp_with_time_zone created_at | ||
| timestamp_with_time_zone updated_at | ||
| integer version | ||
| uuid user_id FK | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| } | ||
| ``` | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
user_idcolumn has been incorrectly added to thepublic.analysestable definition in this Mermaid ER diagram. Based on the PR description,user_idis intended forpublic.spec_documentsonly. Please remove this line to maintain accuracy.