| 1 | package DBIO::Test::Schema::Event; | ||
| 2 | # ABSTRACT: Test result class for the event table with datetime inflation | ||
| 3 | |||
| 4 | 256 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 256 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 256 | our $VERSION = '0.900007'; | |
| 8 | |||
| 9 | 256 | ▶ | use base qw/DBIO::Test::BaseResult/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 256 | __PACKAGE__->load_components(qw/InflateColumn::DateTime/); | |
| 12 | |||
| 13 | 256 | __PACKAGE__->table('event'); | |
| 14 | |||
| 15 | 256 | __PACKAGE__->add_columns( | |
| 16 | id => { data_type => 'integer', is_auto_increment => 1 }, | ||
| 17 | |||
| 18 | starts_at => { data_type => 'date', datetime_undef_if_invalid => 1 }, | ||
| 19 | |||
| 20 | created_on => { data_type => 'timestamp' }, | ||
| 21 | varchar_date => { data_type => 'varchar', size => 20, is_nullable => 1 }, | ||
| 22 | varchar_datetime => { data_type => 'varchar', size => 20, is_nullable => 1 }, | ||
| 23 | skip_inflation => { data_type => 'datetime', inflate_datetime => 0, is_nullable => 1 }, | ||
| 24 | ts_without_tz => { data_type => 'datetime', is_nullable => 1 }, | ||
| 25 | ); | ||
| 26 | |||
| 27 | 256 | __PACKAGE__->set_primary_key('id'); | |
| 28 | |||
| 29 | # Test add_columns '+colname' to augment a column definition. | ||
| 30 | 256 | __PACKAGE__->add_columns( | |
| 31 | '+varchar_date' => { | ||
| 32 | inflate_date => 1, | ||
| 33 | }, | ||
| 34 | '+varchar_datetime' => { | ||
| 35 | inflate_datetime => 1, | ||
| 36 | }, | ||
| 37 | ); | ||
| 38 | |||
| 39 | 256 | 1; | |
| 40 | |||
| 41 | __END__ | ||