Skip to content

add uuid column to projects#69273

Merged
alex-m-brown merged 3 commits into
stagingfrom
create-project-uuid
Nov 18, 2025
Merged

add uuid column to projects#69273
alex-m-brown merged 3 commits into
stagingfrom
create-project-uuid

Conversation

@alex-m-brown

@alex-m-brown alex-m-brown commented Nov 3, 2025

Copy link
Copy Markdown
Contributor

This is the first PR in a series of PRs to migrate our existing channel token system for projects to unique identifiers. This PR adds an indexed UUID column to the projects table.

In production, the Projects table has nearly 1.4 billion rows. Because of this, the index will need to be manually added. When tested on a production-cloned adhoc, creating the index took 1hr and 45min. During this time, I was able to make updates to projects directly in the console, as well as create and edit projects via the UI.

The command to add the index in production-console:

nohup mysql-client-dashboard-writer "CREATE UNIQUE INDEX index_projects_on_uuid ON projects (uuid)" &

Links

Testing story

Tested the migration on a production-cloned adhoc.

Deployment strategy

Once this migration has been deployed to all environments, we will need to manually create the index on production using the command above. This should be done after peak hours, after a deploy, and is expected to take less than 2 hours.

Follow-up work

After the UUID column is created, we will need to start using it! The plan is to do this over a series of PRs.

  1. Start adding UUIDs to projects (Add UUID to projects #69292)
  2. Start using UUIDs to identify projects (Use project UUID #69293)
  3. Backfill project UUIDs (backfill uuid script #69294)
  4. Update the UUID column to be non-null
  5. Eventually completely remove old channel token support

Privacy and Security

This PR is the first step in further securing our projects.

@alex-m-brown alex-m-brown changed the title add uuid column add uuid column to projects Nov 6, 2025
@alex-m-brown alex-m-brown marked this pull request as ready for review November 6, 2025 17:01
@alex-m-brown alex-m-brown requested a review from a team November 6, 2025 17:01
# Conflicts:
#	dashboard/db/schema.rb
Comment thread dashboard/db/migrate/20251114201207_add_uuid_to_projects.rb

@cat5inthecradle cat5inthecradle left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is safe to deploy any time, then pick a time after to apply the production index, right?

@alex-m-brown

Copy link
Copy Markdown
Contributor Author

This is safe to deploy any time, then pick a time after to apply the production index, right?

Correct, adding the column should be instant. Adding the index should also be pretty harmless, but probably best to do after a DTP and after peak hours just to be safe.

@alex-m-brown alex-m-brown merged commit 99d5cd7 into staging Nov 18, 2025
6 checks passed
@alex-m-brown alex-m-brown deleted the create-project-uuid branch November 18, 2025 21:27
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.

3 participants