Revision 90221504
Von Moritz Bunkus vor mehr als 13 Jahren hinzugefügt
SL/AM.pm | ||
---|---|---|
378 | 378 |
|
379 | 379 |
} |
380 | 380 |
|
381 |
# Update chart.taxkey_id to the latest from taxkeys for this chart. |
|
382 |
$query = <<SQL; |
|
383 |
UPDATE chart |
|
384 |
SET taxkey_id = ( |
|
385 |
SELECT taxkey_id |
|
386 |
FROM taxkeys |
|
387 |
WHERE taxkeys.chart_id = chart.id |
|
388 |
ORDER BY startdate DESC |
|
389 |
LIMIT 1 |
|
390 |
) |
|
391 |
WHERE id = ? |
|
392 |
SQL |
|
393 |
|
|
394 |
do_query($form, $dbh, $query, $form->{id}); |
|
395 |
|
|
381 | 396 |
# commit |
382 | 397 |
my $rc = $dbh->commit; |
383 | 398 |
$dbh->disconnect; |
sql/Pg-upgrade2/chart_taxkey_id_from_taxkeys.sql | ||
---|---|---|
1 |
-- @tag: chart_taxkey_id_from_taxkeys |
|
2 |
-- @description: chart.taxkey_id aus taxkeys aktualisieren |
|
3 |
-- @depends: release_2_6_2 |
|
4 |
-- @charset: utf-8 |
|
5 |
UPDATE chart |
|
6 |
SET taxkey_id = ( |
|
7 |
SELECT taxkey_id |
|
8 |
FROM taxkeys |
|
9 |
WHERE taxkeys.chart_id = chart.id |
|
10 |
ORDER BY startdate DESC |
|
11 |
LIMIT 1 |
|
12 |
); |
Auch abrufbar als: Unified diff
Beim Speichern eines Kontos chart.taxkey_id aus taxkeys aktualisieren/setzen
Fix für Bug 1627.