Skip to content

Complete renaming table: drop legacy users table#2971

Open
gilgardosh wants to merge 1 commit intomainfrom
user-accounts-migration-db-adjustments2
Open

Complete renaming table: drop legacy users table#2971
gilgardosh wants to merge 1 commit intomainfrom
user-accounts-migration-db-adjustments2

Conversation

@gilgardosh
Copy link
Copy Markdown
Collaborator

No description provided.

@gilgardosh gilgardosh temporarily deployed to accounter-fullstack January 25, 2026 10:33 — with GitHub Actions Inactive
@gilgardosh gilgardosh temporarily deployed to accounter-fullstack January 25, 2026 10:33 — with GitHub Actions Inactive
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @gilgardosh, 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 finalizes a critical database table renaming operation by introducing and integrating a migration to drop the old 'users' table. This action is the second phase of a carefully orchestrated process, ensuring that the legacy table is removed only after the new table, 'legacy_business_users', has been fully adopted and verified in production environments. The change ensures a clean transition and removes deprecated database structures.

Highlights

  • New Migration Added: A new migration file, 2026-01-25T10-00-01.drop-old-users-table.ts, has been introduced. This migration is responsible for dropping the accounter_schema.users table.
  • Migration Integration: The newly created migration has been integrated into the main migration runner (run-pg-migrations.ts), ensuring it will be executed as part of the database migration sequence.
  • Table Renaming Completion: This pull request marks the completion of a two-phase table renaming process, specifically the removal of the legacy users table after its contents have been migrated and the new table is in use.

🧠 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
Copy Markdown
Contributor

@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 pull request completes a two-phase table rename by adding a migration to drop the old users table. The new migration file includes clear comments about the necessary preconditions, which is great for operational safety. The changes to run-pg-migrations.ts correctly incorporate the new migration.

My main feedback is on the DROP TABLE operation itself. To reduce risk, I've suggested renaming the table instead of dropping it directly. This creates a safety net, allowing for an easy rollback if any services are unexpectedly still using the old table. This is a common best practice for destructive schema changes.

-- 3. It has been verified in production that the old 'users' table is no longer being queried
--
-- This completes the table rename by removing the legacy table name.
DROP TABLE IF EXISTS accounter_schema.users;
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.

high

For a critical operation like dropping a table, it's safer to first rename it. This provides a safety net; if any part of the system is unexpectedly still using the users table, it will fail immediately and you can quickly revert by renaming the table back. If no issues arise after a monitoring period, the renamed table can be dropped in a subsequent migration.

This approach significantly reduces the risk compared to an irreversible DROP TABLE operation. It's also stricter than DROP TABLE IF EXISTS, as it will fail if the users table doesn't exist, which would indicate an issue in the migration process.

Suggested change
DROP TABLE IF EXISTS accounter_schema.users;
ALTER TABLE accounter_schema.users RENAME TO users_to_be_dropped;

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 25, 2026

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@accounter/client 0.0.11-alpha-20260125154236-0228ebcbcf48218958e090015e946ca295e694e2 npm ↗︎ unpkg ↗︎
@accounter/israeli-vat-scraper 0.1.11-alpha-20260125154236-0228ebcbcf48218958e090015e946ca295e694e2 npm ↗︎ unpkg ↗︎
@accounter/modern-poalim-scraper 0.10.5-alpha-20260125154236-0228ebcbcf48218958e090015e946ca295e694e2 npm ↗︎ unpkg ↗︎
@accounter/pcn874-generator 0.6.6-alpha-20260125154236-0228ebcbcf48218958e090015e946ca295e694e2 npm ↗︎ unpkg ↗︎
@accounter/server 0.0.11-alpha-20260125154236-0228ebcbcf48218958e090015e946ca295e694e2 npm ↗︎ unpkg ↗︎
@accounter/shaam-uniform-format-generator 0.2.5-alpha-20260125154236-0228ebcbcf48218958e090015e946ca295e694e2 npm ↗︎ unpkg ↗︎
@accounter/shaam6111-generator 0.1.7-alpha-20260125154236-0228ebcbcf48218958e090015e946ca295e694e2 npm ↗︎ unpkg ↗︎

Base automatically changed from user-accounts-migration-db-adjustments to main January 25, 2026 15:35
@gilgardosh gilgardosh force-pushed the user-accounts-migration-db-adjustments2 branch from 43115ad to 0228ebc Compare January 25, 2026 15:37
@gilgardosh gilgardosh temporarily deployed to accounter-fullstack January 25, 2026 15:37 — with GitHub Actions Inactive
@gilgardosh gilgardosh temporarily deployed to accounter-fullstack January 25, 2026 15:37 — with GitHub Actions Inactive
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.

1 participant