diff Lib/Schema/DB/Constraint/Index.pm @ 0:03e58a454b20

Создан репозитарий
author Sergey
date Tue, 14 Jul 2009 12:54:37 +0400
parents
children 16ada169ca75
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Lib/Schema/DB/Constraint/Index.pm	Tue Jul 14 12:54:37 2009 +0400
@@ -0,0 +1,14 @@
+package Schema::DB::Constraint::Index;
+use strict;
+use Common;
+use base qw(Schema::DB::Constraint);
+
+sub CTOR {
+    my $this = shift;
+    $this->SUPER::CTOR(@_);
+    
+    my %colnames;
+    not grep { $colnames{$_}++ } $this->Columns or die new Exception('Each column in the index can occur only once');
+}
+
+1;