Revision ad9b15c2
Von Moritz Bunkus vor fast 11 Jahren hinzugefügt
sql/Pg-upgrade2/delete_close_follow_ups_when_order_is_deleted_closed.sql | ||
---|---|---|
1 | 1 |
-- @tag: delete_close_follow_ups_when_order_is_deleted_closed |
2 | 2 |
-- @description: Wiedervorlagen löschen/schließen, wenn dazugehörige Belege gelöscht/geschlossen werden |
3 |
-- @depends: release_3_0_0
|
|
3 |
-- @depends: delete_close_follow_ups_when_order_is_deleted_closed_fkey_deletion
|
|
4 | 4 |
|
5 |
ALTER TABLE follow_up_links DROP CONSTRAINT follow_up_links_follow_up_id_fkey; |
|
6 |
ALTER TABLE follow_up_links ADD FOREIGN KEY (follow_up_id) REFERENCES follow_ups (id) ON DELETE CASCADE; |
|
5 |
ALTER TABLE follow_up_links ADD CONSTRAINT follow_up_links_follow_up_id_fkey FOREIGN KEY (follow_up_id) REFERENCES follow_ups (id) ON DELETE CASCADE; |
|
7 | 6 |
|
8 | 7 |
CREATE OR REPLACE FUNCTION follow_up_delete_notes_trigger() |
9 | 8 |
RETURNS TRIGGER AS $$ |
sql/Pg-upgrade2/delete_close_follow_ups_when_order_is_deleted_closed_fkey_deletion.pl | ||
---|---|---|
1 |
# @tag: delete_close_follow_ups_when_order_is_deleted_closed_fkey_deletion |
|
2 |
# @description: delete_close_follow_ups_when_order_is_deleted_closed_fkey_deletion |
|
3 |
# @depends: release_3_0_0 |
|
4 |
package SL::DBUpgrade2::delete_close_follow_ups_when_order_is_deleted_closed_fkey_deletion; |
|
5 |
|
|
6 |
use strict; |
|
7 |
use utf8; |
|
8 |
|
|
9 |
use parent qw(SL::DBUpgrade2::Base); |
|
10 |
|
|
11 |
sub run { |
|
12 |
my ($self) = @_; |
|
13 |
|
|
14 |
$self->drop_constraints(table => "follow_up_links"); |
|
15 |
|
|
16 |
return 1; |
|
17 |
} |
|
18 |
|
|
19 |
1; |
Auch abrufbar als: Unified diff
Fix DB-Upgrade »Wiedervorlagen löschen, wenn dazugehörige Belege gelöscht werden«
Wenn Datenbanken mit älteren PostgreSQL-Versionen angelegt wurden,
dann kann es sein, dass die FKEY-Constraint anders benannt war.