Skip to content

Conversation

@davewood
Copy link

hfh checks all unique constraints of the result source by default.

opting out of this doesnt work as described in the docs because the unique_constraints uses lazy_build and a separate build sub and not default.

... so you need to override '_build_unique_constraints'
instead of setting a default for the 'unique_constraints'
attribute.

... so you need to override '_build_unique_constraints'
instead of setting a default for the 'unique_constraints'
attribute.
@davewood
Copy link
Author

ping

@davewood
Copy link
Author

davewood commented Feb 11, 2019

workaround

#package MyApp::Schema::Result::Foo;
__PACKAGE__->add_unique_constraint('my_unique_constraint_name' => [qw/ bar baz /]);

#package MyApp::Web::Form::Foo;
override '_build_unique_constraints' => sub { ['my_unique_constraint_name'] };

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.

1 participant