CatalystX-InjectModule

 view release on metacpan or  search on metacpan

t/lib/MyApp/Schema/Result/User.pm  view on Meta::CPAN

  "id",
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
  "username",
  { data_type => "varchar", is_nullable => 0, size => 40 },
  "name",
  { data_type => "varchar", is_nullable => 1, size => 40 },
  "website",
  { data_type => "varchar", is_nullable => 1, size => 100 },
  "password",
  { data_type => "char", is_nullable => 0, size => 40 },
  "email",
  { data_type => "varchar", is_nullable => 0, size => 100 },
  "tzone",
  { data_type => "varchar", is_nullable => 1, size => 100 },
  "created",
  { data_type => "timestamp", is_nullable => 1 },
  "active",
  { data_type => "tinyint", default_value => 0, is_nullable => 1 },
);

=head1 PRIMARY KEY

=over 4

=item * L</id>

=back

=cut

__PACKAGE__->set_primary_key("id");

=head1 UNIQUE CONSTRAINTS

=head2 C<username_unique>

=over 4

=item * L</username>

=back

=cut

__PACKAGE__->add_unique_constraint("username_unique", ["username"]);

=head1 RELATIONS

=head2 user_roles

Type: has_many

Related object: L<MyApp::Schema::Result::UserRole>

=cut

__PACKAGE__->has_many(
  "user_roles",
  "MyApp::Schema::Result::UserRole",
  { "foreign.user_id" => "self.id" },
  { cascade_copy => 0, cascade_delete => 1 },
);


=head2 roles

Type: many_to_many

Composing rels: L</user_roles> -> role

=cut

__PACKAGE__->many_to_many("roles", "user_roles", "role");



__PACKAGE__->meta->make_immutable;

1;



( run in 0.911 second using v1.01-cache-2.11-cpan-39bf76dae61 )