Fix silent failures on autoinc PK without an is_auto_increment attribute
[dbsrgits/DBIx-Class.git] / t / cdbi / testlib / Log.pm
index 914c60d..c17b9bb 100644 (file)
@@ -1,11 +1,13 @@
 package # hide from PAUSE
     Log;
 
+use warnings;
+use strict;
+
 use base 'MyBase';
 
-use strict;
 use Time::Piece::MySQL;
-use POSIX;
+use POSIX ();
 
 __PACKAGE__->set_table();
 __PACKAGE__->columns(All => qw/id message datetime_stamp/);
@@ -15,6 +17,11 @@ __PACKAGE__->has_a(
   deflate        => 'mysql_datetime'
 );
 
+# Disables the implicit autoinc-on-non-supplied-pk behavior
+# (and the warning that goes with it)
+# This is the same behavior as it was pre 0.082900
+__PACKAGE__->column_info('id')->{is_auto_increment} = 0;
+
 __PACKAGE__->add_trigger(before_create => \&set_dts);
 __PACKAGE__->add_trigger(before_update => \&set_dts);