Complete renaming table: drop legacy users table#2971
Complete renaming table: drop legacy users table#2971gilgardosh wants to merge 1 commit intomainfrom
Conversation
Summary of ChangesHello @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 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 AssistThe 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
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 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
|
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
| DROP TABLE IF EXISTS accounter_schema.users; | |
| ALTER TABLE accounter_schema.users RENAME TO users_to_be_dropped; |
🚀 Snapshot Release (
|
| 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 ↗︎ |
43115ad to
0228ebc
Compare
No description provided.