Index: trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql.pm
===================================================================
--- trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql.pm	(revision 2235)
+++ trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql.pm	(revision 2236)
@@ -18,5 +18,5 @@
 our $VERSION = (q$Rev$ =~ /^Rev: (\d+) /)[0];
 
-sub SCHEMA_VERSION { 30 };
+sub SCHEMA_VERSION { 31 };
 
 =head1 NAME
@@ -104,24 +104,4 @@
                     $self->rollback;
                     return;
-                }
-            }
-        }
-
-        foreach my $otype ($self->list_supported_objects) {
-            my %attrlist = map { $_ => 1 } $self->list_registered_attributes($otype);
-            foreach my $attribute ($self->list_canonical_fields($otype, 'a')) {
-                my $attr = $self->attribute($otype, $attribute);
-                $attr->{inline} and next;
-                $attr->{managed} and next;
-
-                if ($attrlist{$attribute}) {
-                } else {
-                    if($self->register_attribute($otype, $attribute, $attr->{comment})) {
-                        $self->log(LA_NOTICE, "Attr. $attribute for object type $otype registred");
-                    } else {
-                        $self->log(LA_ERR, "Can't register attribute $attribute");
-                        $self->{_db}->rollback;
-                        return;
-                    }
                 }
             }
@@ -967,68 +947,4 @@
 }
 
-=head2 register_attribute ($otype, $attribute, $comment)
-
-Register a new attribute in base
-
-=cut
-
-sub register_attribute {
-    my ($self, $otype, $attribute, $comment) = @_;
-    my $pclass = $self->_load_obj_class($otype) or return;
-    $pclass->register_attribute($self, $attribute, $comment);
-}
-
-=head2 is_registered_attribute ($otype, $attribute)
-
-Return true is attribute already exists
-
-=cut
-
-sub is_registered_attribute {
-    my ($self, $otype, $attribute) = @_;
-    my $pclass = $self->_load_obj_class($otype) or return;
-    $pclass->is_registered_attribute($self, $attribute);
-}
-
-=head2 list_registered_attributes ($otype)
-
-List all regiestered attribute
-
-=cut
-
-sub list_registered_attributes {
-    my ($self, $otype) = @_;
-    my $pclass = $self->_load_obj_class($otype) or return;
-    if ($pclass->_has_extended_attributes) {
-        return $pclass->list_registered_attributes($self);
-    } else {
-        return ();
-    }
-}
-
-=head2 get_attribute_comment ($otype, $attribute)
-
-Return the comment associated to attribute
-
-=cut
-
-sub get_attribute_comment {
-    my ($self, $otype, $attribute) = @_;
-    my $pclass = $self->_load_obj_class($otype) or return;
-    $pclass->get_attribute_comment($self, $attribute);
-}
-
-=head2 set_attribute_comment ($otype, $attribute, $comment)
-
-Set comment to attribute
-
-=cut
-
-sub set_attribute_comment {
-    my ($self, $otype, $attribute, $comment) = @_;
-    my $pclass = $self->_load_obj_class($otype) or return;
-    $pclass->set_attribute_comment($self, $attribute, $comment);
-}
-
 =head2 getEmploymentRange
 
Index: trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/objects.pm
===================================================================
--- trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/objects.pm	(revision 2235)
+++ trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/objects.pm	(revision 2236)
@@ -19,6 +19,4 @@
 
 =cut
-
-sub _attributes_table { $_[0]->_object_table . '_attributes_list' }
 
 # Write extend attribute table
@@ -248,26 +246,4 @@
         foreach my $var (keys %{ $commons{$attr} }) {
             $info->{$attr}{$var} = $commons{$attr}{$var};
-        }
-    }
-
-    # TODO kill this code: useless since everything is declared in perl code
-    if ($class->_has_extended_attributes) {
-        if (!$base->{__cache}{$class->_object_table}{extend}) {
-            $base->{__cache}{$class->_object_table}{extend} = [];
-            my $sth = $base->db->prepare_cached(
-                sprintf(
-                    q{select canonical from %s order by canonical},
-                    $base->db->quote_identifier($class->_attributes_table),
-                )
-            );
-            $sth->execute;
-            while (my $res = $sth->fetchrow_hashref) {
-                push(@{$base->{__cache}{$class->_object_table}{extend}},
-                        $res->{canonical});
-            }
-        }
-        foreach (@{$base->{__cache}{$class->_object_table}{extend}}) {
-            #$base->log(LA_DEBUG, 'Attribute %s for %s not declared in code', $_, $class->type) if(!exists($info->{$_}));
-            $info->{$_} ||= {};
         }
     }
@@ -1246,128 +1222,4 @@
 }
 
-=head2 register_attribute
-
-Register attribute into base
-
-=cut
-
-sub register_attribute {
-    my ($class, $base, $attribute, $comment) = @_;
-
-    $class->is_registered_attribute($base, $attribute) and do {
-        $base->log(LA_ERR, "The attribute $attribute already exists");
-        return;
-    };
-    my $sth = $base->db->prepare(
-        sprintf(q{
-            insert into %s (canonical, description)
-            values (?,?)
-            }, $class->_attributes_table)
-    );
-    my $res = $sth->execute($attribute, $comment);
-}
-
-=head2 is_registered_attribute ($base, $attribute)
-
-Return true is attribute is registered into base
-
-=cut
-
-sub is_registered_attribute {
-    my ($class, $base, $attribute) = @_;
-
-    my $sth = $base->db->prepare(
-        sprintf(q{
-            select 1 from %s where canonical = ?
-            }, $class->_attributes_table
-        )
-    );
-    $sth->execute($attribute);
-    my $res = $sth->fetchrow_hashref;
-    return $res ? 1 : 0;
-}
-
-=head2 list_registered_attributes
-
-Return the list for all registered attribute
-
-=cut
-
-sub list_registered_attributes {
-    my ($class, $base) = @_;
-
-    my $sth = $base->db->prepare(
-        sprintf(q{
-            select canonical from %s
-            }, $class->_attributes_table
-        )
-    );
-    $sth->execute();
-    my @attrs = ();
-
-    while (my $res = $sth->fetchrow_hashref) {
-        push(@attrs, $res->{canonical});
-    }
-    return @attrs;
-}
-
-
-=head2 get_attribute_comment $base, $attribute)
-
-Return comment for C<$attribute>
-
-=cut
-
-# TODO: get_attribute_comment($attr, $base) { $base ||= $self->base ...
-
-sub get_attribute_comment {
-    my ($class, $base, $attribute) = @_;
-    $base->attribute($class->type, $attribute) or do {
-        $base->log(LA_ERR, "The attribute $attribute does not exists");
-        return;
-    };
-    my $sth = $base->db->prepare(
-        sprintf(q{
-            select description from %s
-            where canonical = ?
-            }, $class->_attributes_table)
-    );
-    $sth->execute($attribute);
-    if (my $res = $sth->fetchrow_hashref) {
-        $sth->finish;
-        return $res->{description};
-    } else {
-        return;
-    }
-}
-
-=head2 set_attribute_comment ($base, $attribute, $comment)
-
-Set comment to attribute
-
-=cut
-
-sub set_attribute_comment {
-    my ($class, $base, $attribute, $comment) = @_;
-
-    my $attr = $base->attribute($class->type, $attribute) or do {
-        $base->log(LA_ERR, "The attribute $attribute does not exists");
-        return;
-    };
-    $attr->{inline} and do {
-        $base->log(LA_ERR,
-            "Cannot set comment to inline attribute, sorry, blame the author !"
-        );
-        return;
-    };
-    my $sth = $base->db->prepare(
-        sprintf(q{
-            update %s set description = ?
-            where canonical = ?
-            }, $class->_attributes_table)
-    );
-    my $res = $sth->execute($comment, $attribute);
-}
-
 sub _update_aliases_ptr {
     my ($self) = @_;
Index: trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/upgrade.pm
===================================================================
--- trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/upgrade.pm	(revision 2235)
+++ trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/upgrade.pm	(revision 2236)
@@ -1188,4 +1188,12 @@
             recompute => 1,
         },
+        {
+            ver => 31,
+            sql => [
+                q{
+                DROP TABLE attributes_list CASCADE;
+                }
+            ],
+        },
     );
 
