| 1 | 2 | ▶ | use utf8; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | |||
| 3 | package Interchange6::Schema::Result::UriRedirect; | ||
| 4 | |||
| 5 | =head1 NAME | ||
| 6 | |||
| 7 | Interchange6::Schema::Result::UriRedirect | ||
| 8 | |||
| 9 | =cut | ||
| 10 | |||
| 11 | 2 | use Interchange6::Schema::Candy -components => | |
| 12 | 2 | ▶ | [qw(InflateColumn::DateTime TimeStamp)]; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | |||
| 14 | =head1 DESCRIPTION | ||
| 15 | |||
| 16 | The uri_redirects table stores uri_source and uri_target mappings. | ||
| 17 | |||
| 18 | =cut | ||
| 19 | |||
| 20 | =head1 ACCESSORS | ||
| 21 | |||
| 22 | =head2 uri_source | ||
| 23 | |||
| 24 | Primary key. | ||
| 25 | |||
| 26 | =cut | ||
| 27 | |||
| 28 | 2 | primary_column uri_source => { | |
| 29 | data_type => "varchar", | ||
| 30 | size => 255 | ||
| 31 | }; | ||
| 32 | |||
| 33 | =head2 uri_target | ||
| 34 | |||
| 35 | The target uri for redirect. | ||
| 36 | |||
| 37 | =cut | ||
| 38 | |||
| 39 | 2 | column uri_target => { | |
| 40 | data_type => "varchar", | ||
| 41 | size => 255 | ||
| 42 | }; | ||
| 43 | |||
| 44 | =head2 status_code | ||
| 45 | |||
| 46 | Http status code passed during redirect. | ||
| 47 | Default 301 "Moved Permanently". | ||
| 48 | |||
| 49 | =cut | ||
| 50 | |||
| 51 | 2 | column status_code => { | |
| 52 | data_type => "integer", | ||
| 53 | default_value => 301 | ||
| 54 | }; | ||
| 55 | |||
| 56 | =head2 created | ||
| 57 | |||
| 58 | Date and time when this record was created returned as L<DateTime> object. | ||
| 59 | Value is auto-set on insert. | ||
| 60 | |||
| 61 | =cut | ||
| 62 | |||
| 63 | 2 | column created => { | |
| 64 | data_type => "datetime", | ||
| 65 | set_on_create => 1 | ||
| 66 | }; | ||
| 67 | |||
| 68 | =head2 last_used | ||
| 69 | |||
| 70 | Date and time when this record was last used returned as L<DateTime> object. | ||
| 71 | Value is auto-set on insert and update. | ||
| 72 | |||
| 73 | =cut | ||
| 74 | |||
| 75 | 2 | column last_used => { | |
| 76 | data_type => "datetime", | ||
| 77 | set_on_create => 1, | ||
| 78 | }; | ||
| 79 | |||
| 80 | 2 | 1; | |