| 1 | package Tapper::Schema::TestrunDB::Result::Notification; | ||
| 2 | 10 | our $AUTHORITY = 'cpan:TAPPER'; | |
| 3 | 10 | $Tapper::Schema::TestrunDB::Result::Notification::VERSION = '5.0.12'; | |
| 4 | # ABSTRACT: Tapper - Keep data about notification subscriptions | ||
| 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 | 10 | ▶ | use YAML::Syck; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 10 | __PACKAGE__->load_components(qw/InflateColumn::DateTime Core/); | |
| 13 | 10 | __PACKAGE__->table("notification"); | |
| 14 | 10 | __PACKAGE__->add_columns | |
| 15 | ( "id", { data_type => "INT", default_value => undef, is_nullable => 0, size => 11, is_auto_increment => 1, }, | ||
| 16 | "owner_id", { data_type => "INT", default_value => undef, is_nullable => 1, size => 11, is_foreign_key => 1, extra => { renamed_from => 'user_id' }, }, | ||
| 17 | "persist", { data_type => "INT", default_value => undef, is_nullable => 1, size => 1, }, | ||
| 18 | "event", { data_type => "VARCHAR", default_value => undef, is_nullable => 0, size => 255, }, # subscribe to this event type | ||
| 19 | "filter", { data_type => "TEXT", default_value => undef, is_nullable => 0, }, # data for check handler | ||
| 20 | "comment", { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 255, }, # what shall we send | ||
| 21 | "created_at", { data_type => "TIMESTAMP", default_value => \'CURRENT_TIMESTAMP', is_nullable => 1, }, | ||
| 22 | "updated_at", { data_type => "DATETIME", default_value => undef, is_nullable => 1, }, | ||
| 23 | ); | ||
| 24 | |||
| 25 | 10 | (my $basepkg = __PACKAGE__) =~ s/::\w+$//; | |
| 26 | |||
| 27 | 10 | __PACKAGE__->set_primary_key("id"); | |
| 28 | 10 | __PACKAGE__->belongs_to( owner => "${basepkg}::Owner", { 'foreign.id' => 'self.owner_id' }); | |
| 29 | |||
| 30 | 10 | 1; | |
| 31 | |||
| 32 | __END__ | ||