eval "use DBD::SQLite";
plan $@
? ( skip_all => 'needs DBD::SQLite for testing' )
- : ( tests => 12 );
+ : ( tests => 14 );
}
my $schema = DBICTest->init_schema(no_populate => 1);
isa_ok($schema->_journal_schema->source('CDAuditHistory'), 'DBIx::Class::ResultSource', 'CDAuditHistory source exists');
isa_ok($schema->_journal_schema->source('ArtistAuditLog'), 'DBIx::Class::ResultSource', 'ArtistAuditLog source exists');
+{
+ my $count = eval {
+ warn $schema->_journal_schema->resultset('ArtistAuditLog')->count;
+ };
+ my $e = $@;
+
+ is( $count, undef, "no count" );
+ like( $e, qr/table.*artist_audit_log/i, "missing table error" );
+}
+
+$schema->journal_schema_deploy();
+
my $artist;
my $new_cd = $schema->txn_do( sub {
$artist = $schema->resultset('Artist')->create({
__PACKAGE__->load_components(qw/+DBIx::Class::Schema::Journal/);
+__PACKAGE__->journal_no_automatic_deploy(1);
+
__PACKAGE__->journal_connection(['dbi:SQLite:t/var/Audit.db']);
-__PACKAGE__->journal_user(['DBICTest::Schema::Artist', {'foreign.artistid' => 'self.user_id'}]);
no warnings qw/qw/;
DBICTest::Schema->load_classes(