Skip to content

Conversation

@alyssapowell
Copy link

Issue

https://otwarchive.atlassian.net/browse/AO3-7047

Purpose

Migrates the comments table primary key from integer to BIGINT to prevent integer overflow as the comments table grows. This is a preventive infrastructure improvement to handle the increasing volume of comments in the system.

Testing Instructions

  1. Run the migration in a development environment: rails db:migrate
  2. Verify the schema change: Check that comments.id column is now BIGINT type
  3. Test comment functionality: Ensure comments can still be created, edited, and displayed
  4. Run existing test suite to verify no functionality breaks

References

This follows the same pattern as recent similar migrations:

  • 20250704060231_change_bookmark_foreign_keys_type.rb
  • 20250718220533_change_subscriptions_id_to_bigint.rb

Credit

Alyssa Powell (she/her)

Change comments.id from integer to bigint to prevent integer overflow
as the comments table grows. This follows the established pattern for similar
migrations in the codebase.
@github-actions github-actions bot added Has Migrations Contains migrations and therefore needs special attention when deploying Awaiting Review labels Oct 2, 2025
@Bilka2
Copy link
Contributor

Bilka2 commented Oct 4, 2025

Hi!

Thank you so much for this pull request. For reviewing this, I am taking the liberty to address all your currently open BIGINT PRs here with one comment since the same applies to all of them. As described on Jira, these migrations also need to be done for all columns that refer to model ID that's getting migrated. Furthermore, please fix the rubocop warnings - we generally try to make new or changed code conform to our linters. For these big int PRs we'd like to have regression tests in the form of specs, you can refer to #5278 or #5294 for examples. For models with foreign keys in other tables please also test those, similar to what's done for bookmarks.

I've updated the Jira issue status to In Review so no one will mistakenly create a duplicate pull request. If you'd like the ability to comment on, assign, and transition issues in the future, you're welcome to create a Jira account! It makes things a bit easier for us on the organizational side if the Full Name on your Jira account either closely matches the name you'd like us to credit in the release notes or includes it in parentheses, e.g. "Nickname (CREDIT NAME)."

Once you've done that (or if you've already done it -- Jira has been unreliable about showing us new accounts in the admin panel lately), you can either reply here or send an email to [email protected] with your account name and email address and we'll set up the permissions for you.

Thanks again for contributing! If you have any questions, you can contact us at the same email address listed above. (We're working on a reply to your recent email.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Has Migrations Contains migrations and therefore needs special attention when deploying Priority: Low Reviewed: Action Needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants