diff Lib/IMPL/SQL/Schema/Constraint/Index.pm @ 32:56cef8e3cda6

+1
author Sergey
date Mon, 09 Nov 2009 01:39:31 +0300
parents
children 0004faa276dc
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Lib/IMPL/SQL/Schema/Constraint/Index.pm	Mon Nov 09 01:39:31 2009 +0300
@@ -0,0 +1,14 @@
+package IMPL::SQL::Schema::Constraint::Index;
+use strict;
+use base qw(IMPL::SQL::Schema::Constraint);
+
+__PACKAGE__->PassThroughArgs;
+
+sub CTOR {
+    my $this = shift;
+    
+    my %colnames;
+    not grep { $colnames{$_}++ } $this->Columns or die new Exception('Each column in the index can occur only once');
+}
+
+1;