Skip to content

Commit

Permalink
Added a month table (finally!)
Browse files Browse the repository at this point in the history
  • Loading branch information
davorg committed Feb 18, 2017
1 parent 9c0a13b commit b1a007e
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 2 deletions.
103 changes: 103 additions & 0 deletions lib/Magnum/Schema/Result/Month.pm
@@ -0,0 +1,103 @@
use utf8;
package Magnum::Schema::Result::Month;

# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

=head1 NAME
Magnum::Schema::Result::Month
=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>
=back
=cut

__PACKAGE__->load_components("InflateColumn::DateTime");

=head1 TABLE: C<month>
=cut

__PACKAGE__->table("month");

=head1 ACCESSORS
=head2 id
data_type: 'integer'
is_auto_increment: 1
is_nullable: 0
=head2 name
data_type: 'varchar'
is_nullable: 0
size: 20
=head2 year
data_type: 'integer'
is_nullable: 0
=head2 month
data_type: 'integer'
is_nullable: 0
=head2 month_name
data_type: 'varchar'
is_nullable: 1
size: 15
=cut

__PACKAGE__->add_columns(
"id",
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
"name",
{ data_type => "varchar", is_nullable => 0, size => 20 },
"year",
{ data_type => "integer", is_nullable => 0 },
"month",
{ data_type => "integer", is_nullable => 0 },
"month_name",
{ data_type => "varchar", is_nullable => 1, size => 15 },
);

=head1 PRIMARY KEY
=over 4
=item * L</id>
=back
=cut

__PACKAGE__->set_primary_key("id");


# Created by DBIx::Class::Schema::Loader v0.07046 @ 2017-02-18 10:28:49
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:VhXq5OAeWFLW1O2kddZESQ


# You can replace this text with custom code or comments, and it will be preserved on regeneration
__PACKAGE__->meta->make_immutable;
1;
11 changes: 9 additions & 2 deletions lib/Magnum/Schema/Result/Week.pm
Expand Up @@ -62,6 +62,11 @@ __PACKAGE__->table("week");
data_type: 'tinyint'
is_nullable: 1
=head2 month
data_type: 'integer'
is_nullable: 0
=cut

__PACKAGE__->add_columns(
Expand All @@ -78,6 +83,8 @@ __PACKAGE__->add_columns(
},
"invoiced",
{ data_type => "tinyint", is_nullable => 1 },
"month",
{ data_type => "integer", is_nullable => 0 },
);

=head1 PRIMARY KEY
Expand Down Expand Up @@ -140,8 +147,8 @@ __PACKAGE__->has_many(
);


# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-07-28 21:49:56
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:o8Iy9O6QxxcFYV51R38TYA
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2017-02-18 11:17:45
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KTpIye3gDoHn65FkgNVLGQ

sub is_in_month {
my $self = shift;
Expand Down

0 comments on commit b1a007e

Please sign in to comment.