Interchange6-Schema

 view release on metacpan or  search on metacpan

lib/Interchange6/Schema/Result/State.pm  view on Meta::CPAN

=head2 priority

Display sort order. Defaults to 0.

=cut

column priority =>
  { data_type => "integer", default_value => 0 };

=head2 active

Whether state is an active shipping destination. Defaults to 1 (true).

=cut

column active =>
  { data_type => "boolean", default_value => 1 };

=head1 UNIQUE CONSTRAINT

=head2 states_state_country

=over 4

=item * L</country_iso_code>

=item * L</state_iso_code>

=back

=cut

unique_constraint states_state_country => [qw/country_iso_code state_iso_code/];

=head1 RELATIONS

=head2 country

Type: belongs_to

Related object: L<Interchange6::Schema::Result::Country>

=cut

belongs_to
  country => "Interchange6::Schema::Result::Country",
  "country_iso_code",
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" };

=head2 zone_states

Type: has_many

Related object L<Interchange6::Schema::Result::ZoneState>

=cut

has_many
  zone_states => "Interchange6::Schema::Result::ZoneState",
  "states_id",
  { cascade_copy => 0, cascade_delete => 0 };

=head2 zones

Type: many_to_many

Composing rels: L</zone_states> -> zone

=cut

many_to_many zones => "zone_states", "zone";

1;



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