CC-3174 : showbuilder

changing playlist table to remove unused columns, adding foreign key to user, adding aggregate length column.
This commit is contained in:
Naomi Aro 2012-02-04 21:26:21 +01:00
parent 38f3d6bfb0
commit e8f2506474
18 changed files with 416 additions and 459 deletions

View file

@ -3,26 +3,5 @@
----------------------------------------------------------------------------------
DROP FUNCTION calculate_position() CASCADE;
/* remove this trigger for group adds/delete */
/*
CREATE FUNCTION calculate_position() RETURNS trigger AS
'
BEGIN
IF(TG_OP=''INSERT'') THEN
UPDATE cc_playlistcontents SET position = (position + 1)
WHERE (playlist_id = new.playlist_id AND position >= new.position AND id != new.id);
END IF;
IF(TG_OP=''DELETE'') THEN
UPDATE cc_playlistcontents SET position = (position - 1)
WHERE (playlist_id = old.playlist_id AND position > old.position);
END IF;
RETURN NULL;
END;
'
LANGUAGE 'plpgsql';
CREATE TRIGGER calculate_position AFTER INSERT OR DELETE ON cc_playlistcontents
FOR EACH ROW EXECUTE PROCEDURE calculate_position();
*/
--remove this trigger for group adds/delete