-
Notifications
You must be signed in to change notification settings - Fork 90
Rework changes detection; Implement tests for renames #188
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
base: master
Are you sure you want to change the base?
Conversation
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
0575de1
to
9ddf601
Compare
Also fixes this: jjn1056/DBIx-Class-Migration#129 |
63d26ac
to
f9e50ba
Compare
Eg. SRC:x, DST:y:rx, DST:x
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.
f9e50ba
to
fd58e13
Compare
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.
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
t/30sqlt-new-diff-pgsql.t
Outdated
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.
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?
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.
I'll do that.
# alter ( $src_version, $dst_version ) | ||
# create( $dst_version ) | ||
# drop ( $src_version ) | ||
# next ( $dst_name, $dst_version ) |
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.
i'm not understanding what the next
callback is meant to do; would you mind expounding on that?
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.
next
call back is fired for every dst
column. This is to run some code for each dst
name/column/table.
At the moment this call back is used to prepare/initialize required data structures which will be filled/used later.
I agree that the name is not the best. Probably it could be better if we name it every
or init
. Just suggest better name you like and I'll change it.
Intention in this PR is to fix bugs, generalize code and extend tests. |
In this PR we:
renames
workflows.Now function could be easily reused for different types of objects
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