On Thu, May 24, 2007 at 03:49:23PM +0200, Marc Espie wrote:
> I've got a simple table schema:
>
> package Artist;
>
> use base qw/DBIx::Class/;
>
> __PACKAGE__->load_components(qw/PK::Auto Core/);
> __PACKAGE__->table('artist');
> __PACKAGE__->add_columns(qw/ artistid name /);
> __PACKAGE__->set_primary_key('artistid');
>
> and I'm trying to copy an old database over.
> I've got duplicates that differ a bit, which I'd like to unify.
>
> So I tried the following:
>
> my $rs = $db->resultset('Artist');
>
> $rs->find_or_create({
> name => {like => $oldname} });
>
> the result is surprising: the new records end up having a HASH instead
> of the old names...
Er. I don't think there's a sane general way for us to handle that.
Might be an idea to make it throw an exception in a case like that?
--
Matt S Trout Need help with your Catalyst or DBIx::Class project?
Technical Director Want a managed development or deployment platform?
Shadowcat Systems Ltd. Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/ http://www.shadowcatsystems.co.uk/
_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/