Skip to content
This repository was archived by the owner on Feb 17, 2026. It is now read-only.

docs: update schema documentation#10

Merged
kubrickcode merged 1 commit intomainfrom
docs/update-schema-docs
Feb 2, 2026
Merged

docs: update schema documentation#10
kubrickcode merged 1 commit intomainfrom
docs/update-schema-docs

Conversation

@kubrickcode
Copy link
Member

Automated update of schema documentation from specvital-infra.

Generated by tbls - includes:

  • Table details with columns, types, constraints
  • Indexes and unique keys
  • ER diagram (Mermaid)

Triggered by: feat(db): add retention_days_at_creation for creation-time retention policy

Support creation-time retention policy for fair data preservation on plan downgrade.

  • Add retention_days_at_creation column to user_analysis_history, spec_documents
  • NULL = unlimited (enterprise or legacy data before feature)
  • Add partial index on created_at for cleanup query optimization
  • CHECK constraint ensures positive values only

@gemini-code-assist
Copy link

Summary of Changes

Hello @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 updates the database schema documentation to reflect recent changes related to data retention. The core modification involves adding a retention_days_at_creation column to the user_analysis_history and spec_documents tables, enabling a creation-time retention policy. This update ensures that the documentation accurately details the new column, its associated constraints, and partial indexes designed to optimize data cleanup operations, providing clarity for future development and maintenance.

Highlights

  • Automated Schema Documentation Update: This pull request automates the update of the database schema documentation, including table details, indexes, unique keys, and ER diagrams, using the tbls tool. This ensures the documentation accurately reflects the current database structure.
  • New Data Retention Column: A new retention_days_at_creation column (integer, nullable) has been introduced in the public.user_analysis_history and public.spec_documents tables. This column is crucial for implementing a creation-time data retention policy.
  • Flexible Retention Policy: The retention_days_at_creation column allows for flexible data preservation. A NULL value in this column signifies an unlimited retention period, catering to enterprise or legacy data that predates this feature.
  • Optimized Cleanup and Data Integrity: To support efficient data cleanup, partial indexes (idx_user_analysis_history_retention_cleanup and idx_spec_documents_retention_cleanup) have been added on the created_at column for rows where retention_days_at_creation is not null. Additionally, a CHECK constraint (chk_retention_days_positive) ensures that any specified retention period is a positive value.

🧠 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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This PR updates the database schema documentation, which appears to be an automated process. The changes correctly reflect the addition of the retention_days_at_creation column and associated constraints and indexes to the user_analysis_history and spec_documents tables.

I've suggested adding comments to the new columns in schema.json to clarify the meaning of NULL values, as mentioned in the pull request description. After applying these changes, the markdown documentation should be regenerated to reflect the updated comments.

Comment on lines +808 to 812
{
"name": "retention_days_at_creation",
"type": "integer",
"nullable": true
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The PR description mentions that NULL for retention_days_at_creation means unlimited retention. It would be beneficial to capture this information in the schema documentation for future reference. Please add a comment field to this column definition.

        {
          "name": "retention_days_at_creation",
          "type": "integer",
          "nullable": true,
          "comment": "NULL = unlimited (enterprise or legacy data before feature)"
        }

Comment on lines +1683 to 1687
{
"name": "retention_days_at_creation",
"type": "integer",
"nullable": true
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The PR description mentions that NULL for retention_days_at_creation means unlimited retention. It would be beneficial to capture this information in the schema documentation for future reference. Please add a comment field to this column definition.

        {
          "name": "retention_days_at_creation",
          "type": "integer",
          "nullable": true,
          "comment": "NULL = unlimited (enterprise or legacy data before feature)"
        }

@kubrickcode kubrickcode merged commit 885391e into main Feb 2, 2026
1 check passed
@kubrickcode kubrickcode deleted the docs/update-schema-docs branch February 2, 2026 06:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant