[Dbix-class] view and is_nullable
Thomas Sibley
trsibley at uw.edu
Tue Nov 7 20:48:08 GMT 2017
What I do in this situation is amend the generated result definition with another call to add_columns, like so:
__PACKAGE__->add_columns(“+column_name" => { is_nullable => 0 });
That overrides the generated value, and dbicdump preserves your custom amendments to the class provided they’re at the bottom, outside of the delimited “don’t change this” block.
> On Oct 18, 2017, at 07:06 , Alex Povolotsky <tarkhil at over.ru> wrote:
>
> Hello
>
> I'm using a view to make code more readable; dbicdump sets is_nullable to 1 for all fields.
>
> Than I'm copying relation from one of the tables used in view, and
>
> "might_have/has_one" must not be on columns with is_nullable set to true (Billing::Schema::Result::BillDebt/at_id). This might indicate an incorrect use of those relationship helpers instead of belongs_to
>
> while that column is not nullable and join is not left.
>
> How do I make automated dbicdump's view column not nullable?
>
> Alex
>
>
> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk
More information about the DBIx-Class
mailing list