Revision 487

Date:
2015/04/09 20:57:11
Author:
ahitrov
Revision Log:
Отдельный счетчик для кастомных таблиц
Files:

Legend:

 
Added
 
Removed
 
Modified
  • koi8/core/lib/Contenido/Object.pm

     
    149 149 $func_end_encode = ', Encode::FB_HTMLCREF)';
    150 150 }
    151 151
    152 my @funct_default_fields = ("class=>'$class'", "keeper=>\$keeper");
    152 my @funct_default_fields = ("class=>'$class'", "keeper=>\$keeper", "__light=>\$light");
    153 153 my @funct_exra_fields = ();
    154 154
    155 155 #�� ���� ������� ���� ������� ���������� ��� ������������� ������
     
    506 506 }
    507 507
    508 508 #���� ����������� toast �� ���������� �� 1 sql ������ � extra ����
    509 if (($self->keeper->store_method() eq 'toast') and $self->class_table->have_extra) {
    509 if (($self->keeper->store_method() eq 'toast') and $self->class_table->have_extra and !$self->{__light}) {
    510 510 push @fields, 'data';
    511 511 push @values, $self->_create_extra_dump();
    512 512 }
     
    536 536 }
    537 537 $sth->finish();
    538 538
    539 if (($self->keeper->store_method() ne 'toast') and $self->class_table->have_extra) {
    539 if (($self->keeper->store_method() ne 'toast') and $self->class_table->have_extra and !$self->{__light}) {
    540 540 $self->store_extras(mode => $mode) || return $self->t_abort();
    541 541 }
    542 542
     
    563 563 }
    564 564 $sth->finish();
    565 565
    566 my $id = $self->keeper->TSQL->selectrow_array("SELECT currval('documents_id_seq')");
    566 my $id = $self->keeper->TSQL->selectrow_array("SELECT currval('".$self->class_table->db_id_sequence()."')");
    567 567 $self->id($id);
    568 568 return $self->t_abort("��������� �������� �������� �������������") if (! defined($self->{id}) || ($self->{id} <= 0));
    569 569
    570 if (($self->keeper->store_method() ne 'toast') and $self->class_table->have_extra) {
    570 if (($self->keeper->store_method() ne 'toast') and $self->class_table->have_extra and !$self->{__light}) {
    571 571 $self->store_extras(mode => $mode) || return $self->t_abort();
    572 572 }
    573 573
  • koi8/core/lib/SQL/DocumentTable.pm

     
    45 45 # ----------------------------------------------------------------------------
    46 46 sub required_properties
    47 47 {
    48 my $self = shift;
    49 my $id_sequence = $self->db_id_sequence();
    48 50 return (
    49 51 { # ������������� ���������, �������� �� ���� �����...
    50 52 'attr' => 'id',
     
    55 57 'auto' => 1,
    56 58 'db_field' => 'id',
    57 59 'db_type' => 'integer',
    58 'db_opts' => "not null default nextval('public.documents_id_seq'::text)",
    60 'db_opts' => "not null default nextval('public.$id_sequence'::text)",
    59 61 },
    60 62 { # ����� ���������...
    61 63 'attr' => 'class',
  • koi8/core/lib/SQL/ProtoTable.pm

     
    29 29 return 0;
    30 30 }
    31 31
    32 sub db_id_sequence {
    33 return 'documents_id_seq';
    34 }
    35
    32 36 sub available_filters {
    33 37 return ();
    34 38 }