use utf8;
package CLMApp::Schema::Result::ChainUnit;

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

=head1 NAME

CLMApp::Schema::Result::ChainUnit

=cut

use strict;
use warnings;

use base 'DBIx::Class::Core';

=head1 COMPONENTS LOADED

=over 4

=item * L<DBIx::Class::InflateColumn::DateTime>

=back

=cut

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

=head1 TABLE: C<ChainUnit>

=cut

__PACKAGE__->table("ChainUnit");

=head1 ACCESSORS

=head2 chainunitid

  data_type: 'integer'
  is_auto_increment: 1
  is_nullable: 0

=head2 chainunitname

  data_type: 'varchar'
  is_nullable: 1
  size: 50

=head2 chaingroupid

  data_type: 'integer'
  is_foreign_key: 1
  is_nullable: 0

=head2 active

  data_type: 'integer'
  default_value: 1
  is_nullable: 1

=cut

__PACKAGE__->add_columns(
  "chainunitid",
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
  "chainunitname",
  { data_type => "varchar", is_nullable => 1, size => 50 },
  "chaingroupid",
  { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
  "chainconceptid",
  { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
  "active",
  { data_type => "integer", default_value => 1, is_nullable => 1 },
);

=head1 PRIMARY KEY

=over 4

=item * L</chainunitid>

=back

=cut

__PACKAGE__->set_primary_key("chainunitid");

=head1 RELATIONS

=head2 chaingroupid

Type: belongs_to

Related object: L<CLMApp::Schema::Result::ChainGroup>

=cut

__PACKAGE__->belongs_to(
  "customer",
  "CLMApp::Schema::Result::Customer",
  { chainunitid => "chainunitid" },
  { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT", join_type => 'left'  },
);

__PACKAGE__->belongs_to(
  "chaingrp",
  "CLMApp::Schema::Result::ChainGroup",
  { chaingroupid => "chaingroupid" },
  { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT", join_type => 'left'  },
);


__PACKAGE__->belongs_to(
  "chaincncpt",
  "CLMApp::Schema::Result::ChainConcept",
  { chainconceptid => "chainconceptid" },
  { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT", join_type => 'left'  },
);

# Created by DBIx::Class::Schema::Loader v0.07039 @ 2017-06-11 11:53:07
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:DsH6i897QpOW8O7Q+KCWyw


# You can replace this text with custom code or comments, and it will be preserved on regeneration
1;
