# @tag: add_more_constraints_fibu_projekt_xplace3
# @description: Falls der Datenbestand es unproblematisch hergibt, ein paar 'schärfere' Constraints für die acc_trans gesetzt. Keine acc_trans-Eintrag ohne trans_id oder chart_id. Ferner project_id in acc_trans als Fremdschlüssel für project definiert.
# @depends: release_2_6_0 fix_acc_trans_ap_taxkey_bug
# @tag: add_more_constraints_fibu_projekt_xplace3
# @description: Falls der Datenbestand es unproblematisch hergibt, ein paar 'schärfere' Constraints für die acc_trans gesetzt. Keine acc_trans-Eintrag ohne trans_id oder chart_id. Ferner project_id in acc_trans als Fremdschlüssel für project definiert.
# @depends: release_2_6_0 fix_acc_trans_ap_taxkey_bug
push @queries, "ALTER TABLE acc_trans ADD FOREIGN KEY (project_id) REFERENCES project(id)";
my $query = qq|select count(*) from acc_trans where chart_id is NULL|;
push @queries, "ALTER TABLE acc_trans ADD FOREIGN KEY (project_id) REFERENCES project(id)";
my $query = qq|select count(*) from acc_trans where chart_id is NULL|;
while (my $hash_ref = $sth_all_groups->fetchrow_hashref()) { # Schleife
if ($hash_ref->{count} eq 0){
while (my $hash_ref = $sth_all_groups->fetchrow_hashref()) { # Schleife
if ($hash_ref->{count} eq 0){
# Gewissheit zu haben, dass kein acc_trans-Eintrag ohne chart_id vorhanden ist
push @queries, "ALTER TABLE acc_trans ALTER COLUMN chart_id SET NOT NULL";
}
}
$sth_all_groups->finish();
# Gewissheit zu haben, dass kein acc_trans-Eintrag ohne chart_id vorhanden ist
push @queries, "ALTER TABLE acc_trans ALTER COLUMN chart_id SET NOT NULL";
}
}
$sth_all_groups->finish();
- my $query = qq|select count(*) from acc_trans where trans_id is NULL|;
- my $sth_all_groups = prepare_execute_query($form, $dbh, $query);
+ $query = qq|select count(*) from acc_trans where trans_id is NULL|;
+ $sth_all_groups = prepare_execute_query($::form, $self->dbh, $query);
while (my $hash_ref = $sth_all_groups->fetchrow_hashref()) { # Schleife
if ($hash_ref->{count} eq 0){
while (my $hash_ref = $sth_all_groups->fetchrow_hashref()) { # Schleife
if ($hash_ref->{count} eq 0){
# Gewissheit zu haben, dass kein acc_trans-Eintrag ohne trans_id vorhanden ist
push @queries, "ALTER TABLE acc_trans ALTER COLUMN trans_id SET NOT NULL";
}
# Gewissheit zu haben, dass kein acc_trans-Eintrag ohne trans_id vorhanden ist
push @queries, "ALTER TABLE acc_trans ALTER COLUMN trans_id SET NOT NULL";
}
- my $sth = prepare_query($form, $dbh, $query);
- do_statement($form,$sth,$query);
+ my $sth = prepare_query($::form, $self->dbh, $query);
+ do_statement($::form,$sth,$query);