File: 20050311.sql

package info (click to toggle)
gforge 4.5.14-22etch13
  • links: PTS
  • area: main
  • in suites: etch
  • size: 13,004 kB
  • ctags: 11,918
  • sloc: php: 36,047; sql: 29,050; sh: 10,538; perl: 6,496; xml: 3,810; makefile: 341; python: 263; ansic: 256
file content (13 lines) | stat: -rw-r--r-- 666 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
CREATE RULE artifact_delete_agg AS
	ON DELETE TO artifact DO
	UPDATE artifact_counts_agg SET
		count = (artifact_counts_agg.count - 1),
		open_count = (CASE WHEN old.status_id=1 THEN artifact_counts_agg.open_count - 1 ELSE artifact_counts_agg.open_count END)
		WHERE (artifact_counts_agg.group_artifact_id = old.group_artifact_id);
		
CREATE RULE projecttask_delete_agg AS
	ON DELETE TO project_task DO
	UPDATE project_counts_agg SET
		count = (project_counts_agg.count - 1),
		open_count = (CASE WHEN old.status_id=1 THEN project_counts_agg.open_count - 1 ELSE project_counts_agg.open_count END)
		WHERE (project_counts_agg.group_project_id = old.group_project_id);