[Dbix-class] Forcing might_have with dbicdump?
Alex Povolotsky
tarkhil at over.ru
Mon Oct 3 11:16:58 GMT 2016
Ok, thank you, it's clear now
On 03.10.2016 14:02, Dagfinn Ilmari Mannsåker wrote:
> Alex Povolotsky <tarkhil at over.ru> writes:
>
>> Hello
>>
>> I have two tables, list of all images for processing (say, table images
>> ( id int primary key not null)) and separate list of unprocessed images
>> (added recently, due to slow search in huge table of images - say, table
>> images_queue (id int not null references images(id))
>>
>> How can I force dbicdump to make might_have in Images.pm instead of
>> default has_many?
>
> dbicdump creates a has_many because your current schema allows multiple
> image_queue rows per images row. It will only crete a migth_have if
> there can only be one, i.e. if there's a unique constraint on the
> foreign key.
>
>> Alex
>
> Ilmari
>
More information about the DBIx-Class
mailing list