Skip to content
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: [#358] Remove driver.Schema #951

Merged
merged 1 commit into from
Mar 9, 2025
Merged

feat: [#358] Remove driver.Schema #951

merged 1 commit into from
Mar 9, 2025

Conversation

hwbrzzl
Copy link
Contributor

@hwbrzzl hwbrzzl commented Mar 9, 2025

📑 Description

goravel/goravel#358

This pull request includes significant changes to the contracts/database/driver/grammar.go and related test files to improve the handling of schema operations. The changes mainly involve refactoring the CompileRenameColumn and CompileRenameIndex methods to remove the dependency on the Schema interface and instead pass the necessary columns and indexes directly. The most important changes are detailed below:

Refactoring Schema Operations:

Testing Updates:

Cleanup:

✅ Checks

  • Added test cases for my code

@Copilot Copilot bot review requested due to automatic review settings March 9, 2025 09:21
@hwbrzzl hwbrzzl requested a review from a team as a code owner March 9, 2025 09:21

Choose a reason for hiding this comment

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

PR Overview

This PR removes the dependency on the Schema interface for rename operations and updates related tests and mock implementations accordingly. Key changes include:

  • Refactoring the CompileRenameColumn and CompileRenameIndex methods to accept columns and indexes directly.
  • Updating tests in blueprint_test.go to use a new mock schema and properly retrieve columns and indexes.
  • Removing the autogenerated Schema mock, as it is no longer needed.

Reviewed Changes

File Description
database/schema/blueprint_test.go Updated test setup to use a mock schema and adjusted expectations for renaming operations.
mocks/database/driver/Grammar.go Updated mock functions for compile rename operations to reflect new signatures.
mocks/database/driver/SchemaGrammar.go Updated mock functions for compile rename operations to reflect new signatures.
contracts/database/driver/grammar.go Removed Schema parameter from compile rename methods and eliminated the Schema interface.
database/schema/blueprint.go Modified ToSql to obtain columns/indexes with error checking before calling rename functions.
mocks/database/driver/Schema.go Removed autogenerated Schema mock as it is no longer needed.

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Copy link

codecov bot commented Mar 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.15%. Comparing base (9a7bcbe) to head (97f3326).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #951   +/-   ##
=======================================
  Coverage   69.15%   69.15%           
=======================================
  Files         157      157           
  Lines       10526    10526           
=======================================
  Hits         7279     7279           
  Misses       2913     2913           
  Partials      334      334           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hwbrzzl hwbrzzl merged commit 0d45fdd into master Mar 9, 2025
11 of 13 checks passed
@hwbrzzl hwbrzzl deleted the bowen/#358-21 branch March 9, 2025 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant