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

Exclude virtual columns #14

Merged
merged 2 commits into from
Sep 20, 2017

Conversation

semifor
Copy link
Contributor

@semifor semifor commented Sep 15, 2017

dump_object dumps the hash returned by get_columns. If the result source includes virtual columns defined with resultset_attributes, they get dumped as well. Then populating from fixtures fails because the virtual columns don't exist in the table.

This change dumps only columns defined in columns_info, effectively excluding the virtual columns.

See t/lib/DBICTest/Schema3.pm for an example of a virtual column.

I'm not sure this in the best (or correct) way to exclude virtual columns, or even if defining virtual columns this way is correct. But this fixes an issue I encountered in an existing database and passes all other tests as well.

Two commits. The first is a failing test. The second is the fix.

Fixtures dumps virtual columns which causes populate to fail because the
column doesn't exist in the table.

This failing test demonstrates the problem.
Don't dump virtual columns since they don't exist in the table and
populate will choke.
@samuelkaufman
Copy link

@semifor hey sorry just saw this, I'll check it out tomorrow morning, thanks for the pr!

@dbsrgits-sync dbsrgits-sync merged commit 8b97485 into dbsrgits:master Sep 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants