Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added table to store some usage statistics
Address #44
- Loading branch information
Showing
5 changed files
with
186 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
use utf8; | ||
package AmuseWikiFarm::Schema::Result::TitleStat; | ||
|
||
# Created by DBIx::Class::Schema::Loader | ||
# DO NOT MODIFY THE FIRST PART OF THIS FILE | ||
|
||
=head1 NAME | ||
AmuseWikiFarm::Schema::Result::TitleStat - Usage statistics | ||
=cut | ||
|
||
use strict; | ||
use warnings; | ||
|
||
use Moose; | ||
use MooseX::NonMoose; | ||
use MooseX::MarkAsMethods autoclean => 1; | ||
extends 'DBIx::Class::Core'; | ||
|
||
=head1 COMPONENTS LOADED | ||
=over 4 | ||
=item * L<DBIx::Class::InflateColumn::DateTime> | ||
=item * L<DBIx::Class::PassphraseColumn> | ||
=back | ||
=cut | ||
|
||
__PACKAGE__->load_components("InflateColumn::DateTime", "PassphraseColumn"); | ||
|
||
=head1 TABLE: C<title_stat> | ||
=cut | ||
|
||
__PACKAGE__->table("title_stat"); | ||
|
||
=head1 ACCESSORS | ||
=head2 title_stat_id | ||
data_type: 'integer' | ||
is_auto_increment: 1 | ||
is_nullable: 0 | ||
=head2 site_id | ||
data_type: 'varchar' | ||
is_foreign_key: 1 | ||
is_nullable: 0 | ||
size: 16 | ||
=head2 title_id | ||
data_type: 'integer' | ||
is_foreign_key: 1 | ||
is_nullable: 0 | ||
=head2 accessed | ||
data_type: 'datetime' | ||
is_nullable: 0 | ||
=head2 notes | ||
data_type: 'text' | ||
is_nullable: 1 | ||
=cut | ||
|
||
__PACKAGE__->add_columns( | ||
"title_stat_id", | ||
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, | ||
"site_id", | ||
{ data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 16 }, | ||
"title_id", | ||
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, | ||
"accessed", | ||
{ data_type => "datetime", is_nullable => 0 }, | ||
"notes", | ||
{ data_type => "text", is_nullable => 1 }, | ||
); | ||
|
||
=head1 PRIMARY KEY | ||
=over 4 | ||
=item * L</title_stat_id> | ||
=back | ||
=cut | ||
|
||
__PACKAGE__->set_primary_key("title_stat_id"); | ||
|
||
=head1 RELATIONS | ||
=head2 site | ||
Type: belongs_to | ||
Related object: L<AmuseWikiFarm::Schema::Result::Site> | ||
=cut | ||
|
||
__PACKAGE__->belongs_to( | ||
"site", | ||
"AmuseWikiFarm::Schema::Result::Site", | ||
{ id => "site_id" }, | ||
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" }, | ||
); | ||
|
||
=head2 title | ||
Type: belongs_to | ||
Related object: L<AmuseWikiFarm::Schema::Result::Title> | ||
=cut | ||
|
||
__PACKAGE__->belongs_to( | ||
"title", | ||
"AmuseWikiFarm::Schema::Result::Title", | ||
{ id => "title_id" }, | ||
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" }, | ||
); | ||
|
||
|
||
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-05-06 10:04:21 | ||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:utoiskpjQd8Xg2KPtgPo8Q | ||
|
||
|
||
# You can replace this text with custom code or comments, and it will be preserved on regeneration | ||
__PACKAGE__->meta->make_immutable; | ||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters