annotate Lib/Schema/DB/Constraint/Index.pm @ 11:75980091813b

DOM и навигация
author Sergey
date Wed, 02 Sep 2009 17:47:44 +0400
parents 03e58a454b20
children 16ada169ca75
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
1 package Schema::DB::Constraint::Index;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
2 use strict;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
3 use Common;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
4 use base qw(Schema::DB::Constraint);
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
5
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
6 sub CTOR {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
7 my $this = shift;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
8 $this->SUPER::CTOR(@_);
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
9
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
10 my %colnames;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
11 not grep { $colnames{$_}++ } $this->Columns or die new Exception('Each column in the index can occur only once');
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
12 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
13
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
14 1;