8 my $schema = DBICTest->init_schema();
13 my $new_artistid = $schema->resultset("Artist")->get_column('artistid')->max + 1;
17 my $artist = $schema->resultset("Artist")->find($old_artistid);
18 ok(defined $artist, 'found an artist with the new PK');
20 $artist->update({ artistid => $new_artistid });
21 is($artist->artistid, $new_artistid, 'artist ID matches');
26 my $artist = $schema->resultset("Artist")->find($old_artistid);
27 ok(!defined $artist, 'no artist found with the old PK');
32 my $artist = $schema->resultset("Artist")->find($new_artistid);
33 ok(defined $artist, 'found an artist with the new PK');
34 is($artist->artistid, $new_artistid, 'artist ID matches');
37 # Do it all over again, using a different methodology:
38 $old_artistid = $new_artistid;
43 my $artist = $schema->resultset("Artist")->find($old_artistid);
44 ok(defined $artist, 'found an artist with the new PK');
46 $artist->artistid($new_artistid);
48 is($artist->artistid, $new_artistid, 'artist ID matches');
53 my $artist = $schema->resultset("Artist")->find($old_artistid);
54 ok(!defined $artist, 'no artist found with the old PK');
59 my $artist = $schema->resultset("Artist")->find($new_artistid);
60 ok(defined $artist, 'found an artist with the new PK');
61 is($artist->artistid, $new_artistid, 'artist ID matches');