package Vee::Schema::EvChains;

use strict;
use warnings;
use base 'DBIx::Class';

# NOTE FOR WHEN THIS IS REFACTORED:
# I *believe* that base is not actually used anywhere except in pokemon_list,
# but the IDEA is that it is essentially the Pokemon with the LOWEST NATIONAL
# DEX NUMBER, thus making it the ORIGINAL FORM of the Pokemon.
# My SOLE EXCEPTION to this is Manaphy, which is the base of its chain, but
# only because that's not a real chain anyway.

=head1 NAME

Vee::Schema::EvChains - DBIC class for the C<evchains> table

=cut

__PACKAGE__->load_components('Core');
__PACKAGE__->table('evchains');
__PACKAGE__->add_columns(qw/
    id
    base
    growth
    chain
    steps

    babygs
    babyc
    babyrusa

    baby_item
/);
__PACKAGE__->set_primary_key('id');

__PACKAGE__->has_many(pokemon => 'Vee::Schema::Pokemon', 'evid');
# TODO: delete the _pokemon suffix
__PACKAGE__->belongs_to(base_pokemon => 'Vee::Schema::Pokemon', 'base');

=head1 SEE ALSO

L<Vee::Schema>, L<DBIx::Class>

=head1 AUTHOR

Maintainer: Alex "Eevee" Munroe (C<veekun@veekun.com>)

See the included F<AUTHORS> file for a full list of contributers.

=head1 LICENSE

See the included F<LICENSE> file.

=cut

1;
