From: moltar Date: Tue, 14 May 2013 21:11:37 +0000 (-0400) Subject: Should have removed constraint, not index. Duh. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class-Tree.git;a=commitdiff_plain;h=f77790db189a9ede148067512fb5b890a316c184 Should have removed constraint, not index. Duh. --- diff --git a/lib/DBIx/Class/Tree/AdjacencyList.pm b/lib/DBIx/Class/Tree/AdjacencyList.pm index 4925416..a77eeda 100644 --- a/lib/DBIx/Class/Tree/AdjacencyList.pm +++ b/lib/DBIx/Class/Tree/AdjacencyList.pm @@ -368,15 +368,16 @@ __END__ If you are using L methods either directly or via L or L, you -will need the following L hook to remove the index -from C. +will need the following L hook to remove the constraint +from C, otherwise you will not be able to user 0 (zero) as +a value. sub sqlt_deploy_hook { my ($self, $sqlt_table) = @_; - foreach my $index ($sqlt_table->get_indices) { - if ($index->fields->[0] eq $self->parent_column) { - $sqlt_table->drop_index($index->name); + foreach my $constraint ($sqlt_table->get_constraints) { + if ($constraint->field_names->[0] eq $self->parent_column) { + $sqlt_table->drop_constraint($constraint->name); last; } }