Technology definitions loader

* Added "dummy" data file for technologies (for now it simply copies the
old, line-based technologies) and corresponding XML schema

* Added missing SQL stored procedure to clear all dependencies and
reverse dependencies from a technology

* Added import classes, loader and import tool for the technology graph

* Added tech graph import tool to post-build tests
This commit is contained in:
Emmanuel BENOîT 2012-02-27 20:04:02 +01:00
parent c5464212bc
commit 1f3c7a9202
24 changed files with 1731 additions and 43 deletions
legacyworlds-server-data/db-structure/parts/040-functions

View file

@ -324,6 +324,47 @@ GRANT EXECUTE
/*
* Remove all dependencies for a technology
* -----------------------------------------
*
* This stored procedure removes all dependencies and reverse dependencies for
* some technology.
*
* Parameters:
* _technology The name of the technology
*/
DROP FUNCTION IF EXISTS defs.techdep_clear( TEXT );
CREATE FUNCTION defs.techdep_clear( _technology TEXT )
RETURNS VOID
LANGUAGE SQL
STRICT VOLATILE
SECURITY DEFINER
AS $techdep_clear$
DELETE FROM defs.technology_dependencies
WHERE technology_name_id = (
SELECT id FROM defs.strings
WHERE name = $1
);
DELETE FROM defs.technology_dependencies
WHERE technology_name_id_depends = (
SELECT id FROM defs.strings
WHERE name = $1
);
$techdep_clear$;
REVOKE EXECUTE
ON FUNCTION defs.techdep_clear( TEXT )
FROM PUBLIC;
GRANT EXECUTE
ON FUNCTION defs.techdep_clear( TEXT )
TO :dbuser;
-- ********************************************************
-- OLD CODE BELOW
-- ********************************************************