backend mostly done for show, can remove a scheduled group from a show.
This commit is contained in:
parent
f2560a6aa6
commit
25c7d4cb90
5 changed files with 98 additions and 64 deletions
|
@ -30,13 +30,9 @@ DROP FUNCTION show_content() CASCADE;
|
|||
CREATE FUNCTION show_content() RETURNS trigger AS
|
||||
'
|
||||
BEGIN
|
||||
IF(TG_OP=''INSERT'') THEN
|
||||
UPDATE cc_show_schedule SET position = (position + 1)
|
||||
WHERE (id = new.id AND position >= new.position AND id != new.id);
|
||||
END IF;
|
||||
IF(TG_OP=''DELETE'') THEN
|
||||
UPDATE cc_show_schedule SET position = (position - 1)
|
||||
WHERE (id = old.id AND position > old.position);
|
||||
WHERE (show_id = old.show_id AND show_day = old.show_day AND position > old.position);
|
||||
END IF;
|
||||
RETURN NULL;
|
||||
END;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue