-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: rename table support #259
Conversation
WalkthroughThe pull request introduces comprehensive support for table renaming and synonym management in the Spanner schema migration system. The changes include adding new methods to the Changes
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/Schema/Grammar.php (1)
222-239
: Consider using parameterized values for SQL generation.While the current implementation uses the
wrapTable
method for escaping, consider using parameterized values for better SQL injection protection.- $schema = "alter table {$from} rename to {$to}"; + $schema = sprintf('alter table %s rename to %s', + $from, + $to + );
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
src/Schema/Blueprint.php
(1 hunks)src/Schema/Grammar.php
(1 hunks)src/Schema/RenameDefinition.php
(1 hunks)tests/Schema/BlueprintTest.php
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Run-PHPUnit
🔇 Additional comments (12)
src/Schema/RenameDefinition.php (2)
23-29
: LGTM! Well-documented class definition.The class is well-structured with clear PHPDoc annotations for properties and methods.
32-39
: LGTM! Clean constructor implementation.The constructor properly initializes the required properties through the parent Fluent class.
src/Schema/Blueprint.php (3)
311-319
: LGTM! Clean implementation of rename method.The method follows the class's pattern for schema modifications and properly integrates with the command system.
321-329
: LGTM! Well-implemented addSynonym method.The method correctly creates a RenameDefinition with synonym support.
331-339
: LGTM! Consistent dropSynonym implementation.The method maintains consistency with the other synonym-related methods.
src/Schema/Grammar.php (2)
241-251
: LGTM! Clean addSynonym compilation.The method properly generates the SQL for adding a synonym.
253-263
: LGTM! Consistent dropSynonym compilation.The method maintains consistency with other SQL generation methods.
tests/Schema/BlueprintTest.php (5)
371-390
: LGTM! Good test coverage for basic rename.The test properly verifies the basic table rename functionality.
392-411
: LGTM! Well-tested synonym support.The test thoroughly verifies renaming with synonym creation.
413-432
: LGTM! Comprehensive custom synonym testing.The test properly verifies custom synonym naming functionality.
434-453
: LGTM! Good coverage of addSynonym.The test verifies standalone synonym addition.
455-478
: LGTM! Complete synonym lifecycle testing.The test properly verifies the full lifecycle of synonym operations including cleanup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Closes #198
Summary by CodeRabbit
New Features
Tests