annotate Lib/Schema/DB/Constraint/Index.pm @ 42:4ff27cd051e3

updated ORM schema model
author Sergey
date Thu, 07 Jan 2010 15:34:42 +0300
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;