Skip to content

Rework changes detection; Implement tests for renames - #188

Merged
rabbiveesh merged 14 commits into
dbsrgits:masterfrom
KES777:implement_tests_for_renames
Sep 22, 2026
Merged

rabbiveesh merged 14 commits into
dbsrgits:masterfrom
KES777:implement_tests_for_renames

Conversation

@KES777

@KES777 KES777 commented Apr 5, 2025

Copy link
Copy Markdown
Contributor

In this PR we:

  • Add more tests for renames workflows.
  • Simplify code to detect renames.
    Now function could be easily reused for different types of objects
  • Document code
  • Fix the issue when field is created before renames happened.
    This happens when we want to drop the old object and give the name of dropped object to another one.

This changes are related to #184

Eugen Konkov added 3 commits April 3, 2025 22:44
When object has 'renamed_from' property, but the previous version does not exists, the
warning should be issued and for this object CREATE XXX query should be generated.
Fixes: 185

GitHub: dbsrgits#185
@KES777
KES777 force-pushed the implement_tests_for_renames branch from 0575de1 to 9ddf601 Compare April 5, 2025 03:16
@KES777

KES777 commented Apr 6, 2025

Copy link
Copy Markdown
Contributor Author

Also fixes this: jjn1056/DBIx-Class-Migration#129

Eugen Konkov added 5 commits May 4, 2025 17:03
Renames should go first, otherwise it could not be possible to add a new column with
the name which was just renamed to something. Eg. SRC:x->DST:y, Create DST:x.
Otherwise we can not run 'Create DST:x', because schema still have 'x' column.
@KES777
KES777 force-pushed the implement_tests_for_renames branch from f9e50ba to fd58e13 Compare May 4, 2025 21:03

@rabbiveesh rabbiveesh left a comment

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.

apologies on the slow turnaround; out of perl now and just started a new $job, but i'll see if i can squeeze this in.
Trying to understand the full intent + then i can dig into more

Comment thread t/30sqlt-new-diff-pgsql.t

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.

the tests here have nothing to do with the rest of the producer behaviors, could you just put this in a new diff test which produces yaml?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll do that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Btw it was done few month ago.

Comment thread lib/SQL/Translator/Diff.pm Outdated
@KES777

KES777 commented Jun 8, 2025

Copy link
Copy Markdown
Contributor Author

Intention in this PR is to fix bugs, generalize code and extend tests.

@KES777
KES777 requested a review from rabbiveesh June 8, 2025 19:07
Comment thread lib/SQL/Translator/Producer/PostgreSQL.pm
@KES777
KES777 requested a review from matthewpersico October 7, 2025 00:11

@matthewpersico matthewpersico left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

So sorry this fell off the table.

Comment thread lib/SQL/Translator/Diff.pm

@rabbiveesh rabbiveesh left a comment

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.

I've settled on names, and then i have comments about the $skip bit in the table field diff

@KES777
KES777 requested a review from rabbiveesh September 19, 2026 01:49
@KES777

KES777 commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor Author

@rabbiveesh done. Once merged, I'll create follow up PR.

@rabbiveesh rabbiveesh left a comment

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.

grand! thanks so much for your work (sorry that it took so long)

@rabbiveesh
rabbiveesh merged commit fb2f3ca into dbsrgits:master Sep 22, 2026
5 checks passed
@KES777

KES777 commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

@rabbiveesh No worries, I am happy this was merged. May we cooperate for the next improvements?

@rabbiveesh

Copy link
Copy Markdown
Contributor

Sure, hit me up on discord.

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.

3 participants