Mercurial > pub > Impl
comparison Lib/IMPL/SQL/Schema/Constraint/Index.pm @ 168:6148f89bb7bf
IMPL::SQL::Schema::Traits::Diff alfa version
IMPL::lang added hash traits
| author | sourcer | 
|---|---|
| date | Mon, 16 May 2011 04:30:38 +0400 | 
| parents | 76515373dac0 | 
| children | 
   comparison
  equal
  deleted
  inserted
  replaced
| 167:1f7a6d762394 | 168:6148f89bb7bf | 
|---|---|
| 1 package IMPL::SQL::Schema::Constraint::Index; | 1 package IMPL::SQL::Schema::Constraint::Index; | 
| 2 use strict; | 2 use strict; | 
| 3 use parent qw(IMPL::SQL::Schema::Constraint); | 3 use parent qw(IMPL::SQL::Schema::Constraint); | 
| 4 | 4 | 
| 5 __PACKAGE__->PassThroughArgs; | 5 __PACKAGE__->PassThroughArgs; | 
| 6 __PACKAGE__->RegisterAlias('index'); | |
| 6 | 7 | 
| 7 sub CTOR { | 8 sub CTOR { | 
| 8 my $this = shift; | 9 my $this = shift; | 
| 9 | 10 | 
| 10 my %colnames; | 11 my %colnames; | 
| 11 not grep { $colnames{$_}++ } @{$this->columns} or die new Exception('Each column in the index can occur only once'); | 12 not grep { $colnames{$_}++ } $this->columns or die new Exception('Each column in the index can occur only once'); | 
| 12 } | 13 } | 
| 13 | 14 | 
| 14 1; | 15 1; | 
