Skip to content

Conversation

@kumarUjjawal
Copy link
Contributor

Add AlterField Operation to Migration Generator

Overview

This PR introduces support for the AlterField operation in the migration generator.

Related Issues

#205

Reviewer Notes

@github-actions github-actions bot added C-cli Crate: cot-cli (issues and Pull Requests related to Cot CLI) C-lib Crate: cot (main library crate) labels Jul 4, 2025
@codecov
Copy link

codecov bot commented Jul 4, 2025

Codecov Report

❌ Patch coverage is 71.79487% with 66 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cot/src/db/migrations.rs 0.00% 42 Missing ⚠️
cot-cli/src/migration_generator.rs 87.50% 24 Missing ⚠️
Flag Coverage Δ
rust 89.58% <71.79%> (-0.17%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
cot-cli/src/migration_generator.rs 89.06% <87.50%> (+0.77%) ⬆️
cot/src/db/migrations.rs 78.66% <0.00%> (-5.22%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kumarUjjawal
Copy link
Contributor Author

@seqre any feedback for me?

Copy link
Member

@seqre seqre left a comment

Choose a reason for hiding this comment

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

This operation has many edge cases, and it should be thoroughly tested. Can you please add more tests first?

Think about possible cases, such as: name change (this one can be skipped for now, it's tricky), type change, attributes change, etc. All those should be either handled or visibly err when a given case is unhandled or ambiguous.

It seems that cot-cli/src/migration_generator.rs does not have a test for alter model, would you be so kind and add that too?

@kumarUjjawal
Copy link
Contributor Author

Sure, Thank you!

@kumarUjjawal
Copy link
Contributor Author

@seqre I added more tests can you check if they are what you are expecting and any feedbacks next steps. Thanks!

@kumarUjjawal
Copy link
Contributor Author

@m4tx the error doesn't seem to come from my PR, can you take a look?

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

Labels

C-cli Crate: cot-cli (issues and Pull Requests related to Cot CLI) C-lib Crate: cot (main library crate)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants