File: 03-reschema.t

package info (click to toggle)
libtangram-perl 2.10-1.1
  • links: PTS
  • area: main
  • in suites: lenny, squeeze, wheezy
  • size: 1,064 kB
  • ctags: 703
  • sloc: perl: 9,665; makefile: 35
file content (31 lines) | stat: -rw-r--r-- 741 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#   -*- perl -*-

#  Kill two birds with one stone; re-org and reschema

use lib "t/musicstore";
use Prerequisites;
use strict;

use Test::More tests => 4;
use Tangram::Storage;

my $old_schema = MusicStore->schema;
my $new_schema = MusicStore->new_schema;


DBConfig->dialect->deploy($new_schema, DBConfig->cparm);
pass("deployed new schema successfully");

{
    my $storage_old = DBConfig->dialect->connect($old_schema, DBConfig->cparm);
    pass("connected to old schema");

    my $storage_new = DBConfig->dialect->connect($new_schema, DBConfig->cparm);
    pass("connected to new schema");

    my @oids = $storage_new->insert($storage_old->select("CD::Artist"));
    pass("inserted data into database (new oids: @oids)");

}

__END__