Conversation
Summary of ChangesHello @kubrickcode, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request automates the update of the database schema documentation, primarily driven by the addition of a Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
The pull request successfully updates the schema documentation to reflect the addition of the user_id column to the public.spec_documents table. This change aligns with the stated goal of implementing per-user document isolation and managing LLM API costs. The updates to schema.json and the main README.md are accurate. However, there appear to be some inconsistencies in the generated Mermaid ER diagrams across several individual table documentation files, where the user_id column has been incorrectly added to tables other than public.spec_documents. Additionally, some full table definitions are duplicated across multiple documentation files, which could lead to maintenance challenges.
| timestamp_with_time_zone created_at | ||
| timestamp_with_time_zone updated_at | ||
| integer version | ||
| uuid user_id FK |
| "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 | ||
| } |
There was a problem hiding this comment.
| timestamp_with_time_zone created_at | ||
| timestamp_with_time_zone updated_at | ||
| integer version | ||
| uuid user_id FK |
| timestamp_with_time_zone created_at | ||
| timestamp_with_time_zone updated_at | ||
| integer version | ||
| uuid user_id FK |
| timestamp_with_time_zone created_at | ||
| timestamp_with_time_zone updated_at | ||
| integer version | ||
| uuid user_id FK |
| "public.spec_documents" { | ||
| uuid id | ||
| uuid analysis_id FK | ||
| bytea content_hash | ||
| varchar_10_ language | ||
| text executive_summary | ||
| varchar_100_ model_id | ||
| 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.
Automated update of schema documentation from specvital-infra.
Generated by tbls - includes:
Triggered by: feat(db): add user_id column to spec_documents table
AI Spec documents incur LLM API costs, requiring access control so only creators can view their documents.
The previous global cache structure had a cost fairness issue where user B could freely view documents that user A paid to generate.
Included user_id in unique constraints to implement per-user document isolation.
Set ON DELETE CASCADE so documents are deleted when users are removed.