Fix silent failures on autoinc PK without an is_auto_increment attribute
[dbsrgits/DBIx-Class.git] / t / cdbi / testlib / Film.pm
CommitLineData
8273e845 1package # hide from PAUSE
c6d74d3e 2 Film;
ea2e61bf 3
4a233f30 4use warnings;
ea2e61bf 5use strict;
6
4a233f30 7use base 'DBIC::Test::SQLite';
8
ea2e61bf 9__PACKAGE__->set_table('Movies');
10__PACKAGE__->columns('Primary', 'Title');
11__PACKAGE__->columns('Essential', qw( Title ));
12__PACKAGE__->columns('Directors', qw( Director CoDirector ));
13__PACKAGE__->columns('Other', qw( Rating NumExplodingSheep HasVomit ));
14
7305f6f9 15# Disables the implicit autoinc-on-non-supplied-pk behavior
16# (and the warning that goes with it)
17# This is the same behavior as it was pre 0.082900
18__PACKAGE__->column_info('title')->{is_auto_increment} = 0;
19
ea2e61bf 20sub create_sql {
6a3bf251 21 return qq{
22 title VARCHAR(255),
23 director VARCHAR(80),
24 codirector VARCHAR(80),
25 rating CHAR(5),
26 numexplodingsheep INTEGER,
27 hasvomit CHAR(1)
ea2e61bf 28 }
29}
30
8273e845 31sub create_test_film {
6a3bf251 32 return shift->create({
33 Title => 'Bad Taste',
34 Director => 'Peter Jackson',
35 Rating => 'R',
36 NumExplodingSheep => 1,
37 });
ea2e61bf 38}
39
40package DeletingFilm;
41
42use base 'Film';
43sub DESTROY { shift->delete }
44
451;
46