that does not work.
i get this err:
DBIx::Class::ResultSource::_minimal_valueset_satisfying_constraint(): Unable to
satisfy requested constraint 'primary', missing values for column(s): 'nodeid'
at ./test.pl line 80
when i remove the key part altogether i get new err:
DBIx::Class::Row::store_column(): No such column 'nodeName' on
Mydb::Schema::Result::Node at ./test.pl line 80
and we know that column exist. so i think there is some crap happening with
CamleCase in col names. I will try with changed col names. it is very
frustrating.
On Monday, August 21, 2017 9:38 AM, tirveni yadav <[email protected]>
wrote:
On Mon, Aug 21, 2017 at 7:15 PM, Rajeev Prasad <[email protected]> wrote:
> no, nodeID is auto increment field as seen in tabel description. it is
> complaining there is no such key. i dont know why...
>
>
>
> On Monday, August 21, 2017 7:39 AM, tirveni yadav <[email protected]>
> wrote:
>
>
> On Mon, Aug 21, 2017 at 6:50 AM, Rajeev Prasad <[email protected]> wrote:
>>
>> why am i getting this err in DBIx::Class ?
>>
>> $./update_db.pl
>> DBIx::Class::ResultSource::unique_constraint_columns(): Unknown unique
>> constraint nodeid on 'node' at ./update_from_ieds.pl line 80
>>
>>
>> relevant code:
>> ...
>> sub addNode
>> {
>> my $node = shift; my $lcNode = lc($node);
>> my $id = $schema
>> ->resultset('Node')
>> ->find_or_create
>> (
>> { nodeName => $lcNode },
>> { key => 'nodeid' }
>> );
>> return $id;
>> }
>
>
> Are you trying to do this:
>
>
> my $id = $schema
> ->resultset('Node')->find_or_create
> (
> {
> nodeName => $lcNode ,
>
> nodeID => $nodeid,
> }
> );
>
In my view, unique constraint naming issue:
Try this:
A.
In Node.pm:
__PACKAGE__->add_unique_constraint(node_nodeid => [ qw/nodeid/ ], );
B.
function add_node
{
my $rs_node = $dbic->resultset('Node');
my $row_node;
$row_node = $rs_node->find_or_create
(
{
nodename => 'October',
nodeid => '10',
},
{ key => 'node_nodeid' }
);
return $row_node;
}
--
Regards,
Tirveni Yadav
www.udyansh.org
www.bael.io
What is this Universe ? From what it arises ? Into what does it go?
In freedom it arises, In freedom it rests and into freedom it melts away.
Upanishads.
_______________________________________________
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/[email protected]