Skip to content

Conversation

@drewkim
Copy link
Contributor

@drewkim drewkim commented Jun 3, 2025

Description of changes

Summarize the changes made by this PR.

  • Improvements & Bug fixes
    • None
  • New functionality
    • Adds a new TEXT field, resource_name, to tenants table on SysDB. This is a globally unique identifier for the tenant, so adds a unique index (when not null) as well. It is meant to be a human-readable identifier.
    • Updates both gRPC and SQLite SysDB

Test plan

How are these changes tested?

  • Tests pass locally with pytest for python, yarn test for js, cargo test for rust

Documentation Changes

Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the docs section?

@github-actions
Copy link

github-actions bot commented Jun 3, 2025

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

Copy link
Contributor Author

drewkim commented Jun 3, 2025

@drewkim drewkim marked this pull request as ready for review June 3, 2025 18:36
@propel-code-bot
Copy link
Contributor

propel-code-bot bot commented Jun 3, 2025

Add resource_name to SysDB tenants Table with Unique Index

This PR introduces a new nullable text field called resource_name to the SysDB tenants table, intended as a globally unique, human-readable identifier for each tenant. This field is enforced by a unique index (when not null) for data integrity and is reflected both in the database migration and in the Go ORM model. Supporting files and checksums are updated accordingly, and the development database connection string was refined for the migration tooling.

Key Changes:
• Adds nullable resource_name column to SysDB tenants table
• Creates a unique index idx_resource_name_unique for resource_name when not null
• Extends Go Tenant struct/model to include ResourceName pointer with unique index annotation
• Updates migration registry and Atlas configuration (checksums, connection string)

Affected Areas:
• Go SysDB tenant model
• Postgres database schema and migrations
• Atlas migration config/checksums

This summary was automatically generated by @propel-code-bot

env "dev" {
src = data.external_schema.gorm.url
dev = "postgres://localhost:5432/chroma?sslmode=disable"
dev = "postgres://chroma:chroma@localhost:5432/chroma?sslmode=disable"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Found that this was necessary to get the migration to run properly

@drewkim drewkim requested review from HammadB and codetheweb June 3, 2025 18:37
Copy link
Collaborator

@HammadB HammadB left a comment

Choose a reason for hiding this comment

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

Will setter methods to set this come after?

@drewkim
Copy link
Contributor Author

drewkim commented Jun 3, 2025

Will setter methods to set this come after?

@HammadB yes, wanted to keep this just to migration

@HammadB
Copy link
Collaborator

HammadB commented Jun 3, 2025

Will setter methods to set this come after?

@HammadB yes, wanted to keep this just to migration

Cool can we stack the rest of the change and merge them down together so we can make sure our changes all make sense together?

@drewkim drewkim changed the title [ENH] Add static_name to SysDB tenants table [ENH] Add resource_name to SysDB tenants table Jun 4, 2025
@drewkim drewkim force-pushed the drew/_enh_add_static_name_to_sysdb_tenants_table branch from 48caba8 to 67d8771 Compare June 4, 2025 05:16
@drewkim drewkim requested a review from sanketkedia June 4, 2025 05:32
@drewkim drewkim force-pushed the drew/_enh_add_static_name_to_sysdb_tenants_table branch 2 times, most recently from 1fff500 to e6f6417 Compare June 4, 2025 18:30
@drewkim
Copy link
Contributor Author

drewkim commented Jun 5, 2025

Note: in order to unblock this, we're no longer including the SQLite SysDB migration. After hours of debugging, the rust bindings prop test failure continues to elude. Will follow up with it. cc @codetheweb

@drewkim drewkim force-pushed the drew/_enh_add_static_name_to_sysdb_tenants_table branch from 6d6dd56 to 1fc07be Compare June 5, 2025 18:58
@drewkim drewkim force-pushed the drew/_enh_add_static_name_to_sysdb_tenants_table branch from 1fc07be to b320eef Compare June 10, 2025 18:00
@drewkim drewkim merged commit 2cca2ae into main Jun 10, 2025
112 of 115 checks passed
Inventrohyder pushed a commit to Inventrohyder/chroma that referenced this pull request Aug 5, 2025
## Description of changes

_Summarize the changes made by this PR._

- Improvements & Bug fixes
  - None
- New functionality
  - Adds a new TEXT field, `resource_name`, to `tenants` table on SysDB. This is a globally unique identifier for the tenant, so adds a unique index (when not null) as well. It is meant to be a human-readable identifier.
  - Updates both gRPC and SQLite SysDB

## Test plan

_How are these changes tested?_

- [ ] Tests pass locally with `pytest` for python, `yarn test` for js, `cargo test` for rust

## Documentation Changes

_Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the [docs section](https://github.com/chroma-core/chroma/tree/main/docs/docs.trychroma.com)?_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants