« Tapper/Schema/TestrunDB/Result/Benchs.pm
↑ Summary
Tapper/Schema/TestrunDB/Result/ChartLineAdditionals.pm »
| 1 | package Tapper::Schema::TestrunDB::Result::ChartAxisTypes; | ||
| 2 | 10 | our $AUTHORITY = 'cpan:TAPPER'; | |
| 3 | 10 | $Tapper::Schema::TestrunDB::Result::ChartAxisTypes::VERSION = '5.0.12'; | |
| 4 | # ABSTRACT: Tapper - Keep Charts Axis Types for Tapper-Reports-Web-GUI | ||
| 5 | |||
| 6 | 10 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 10 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 10 | ▶ | use parent 'DBIx::Class'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 10 | __PACKAGE__->load_components(qw/InflateColumn::DateTime Core/); | |
| 12 | 10 | __PACKAGE__->table('chart_axis_types'); | |
| 13 | 10 | __PACKAGE__->add_columns( | |
| 14 | 'chart_axis_type_id', { | ||
| 15 | data_type => 'TINYINT', | ||
| 16 | default_value => undef, | ||
| 17 | is_nullable => 0, | ||
| 18 | size => 4, | ||
| 19 | is_auto_increment => 1, | ||
| 20 | extra => { | ||
| 21 | unsigned => 1, | ||
| 22 | }, | ||
| 23 | }, | ||
| 24 | 'chart_axis_type_name' , { | ||
| 25 | data_type => 'VARCHAR', | ||
| 26 | default_value => undef, | ||
| 27 | is_nullable => 0, | ||
| 28 | size => 64, | ||
| 29 | }, | ||
| 30 | 'created_at', { | ||
| 31 | data_type => 'TIMESTAMP', | ||
| 32 | default_value => undef, | ||
| 33 | is_nullable => 0, | ||
| 34 | set_on_create => 1, | ||
| 35 | }, | ||
| 36 | ); | ||
| 37 | |||
| 38 | |||
| 39 | 10 | (my $basepkg = __PACKAGE__) =~ s/::\w+$//; | |
| 40 | |||
| 41 | 10 | __PACKAGE__->set_primary_key('chart_axis_type_id'); | |
| 42 | 10 | __PACKAGE__->add_unique_constraint( | |
| 43 | 'ux_chart_axis_types_01' => ['chart_axis_type_name'], | ||
| 44 | ); | ||
| 45 | |||
| 46 | 10 | __PACKAGE__->has_many( | |
| 47 | chart_versions_column_x => 'Tapper::Schema::TestrunDB::Result::ChartVersions', | ||
| 48 | { 'foreign.chart_axis_type_x_id' => 'self.chart_version_id' }, | ||
| 49 | ); | ||
| 50 | 10 | __PACKAGE__->has_many( | |
| 51 | chart_versions_column_y => 'Tapper::Schema::TestrunDB::Result::ChartVersions', | ||
| 52 | { 'foreign.chart_axis_type_y_id' => 'self.chart_version_id' }, | ||
| 53 | ); | ||
| 54 | |||
| 55 | 10 | 1; | |
| 56 | |||
| 57 | __END__ | ||