"Buildables" depend on tech graph

* Modified buildable definitions and loader to use technologies from the
tech graph as dependencies instead of the old research system

* Modified planet-related views and functions accordingly
This commit is contained in:
Emmanuel BENOîT 2012-04-08 14:30:43 +02:00
parent 76a01cbf1c
commit 070d55dc05
6 changed files with 89 additions and 104 deletions
legacyworlds-server-data/db-structure/parts/030-data

View file

@ -10,21 +10,26 @@
-- "Buildables"
--
CREATE TABLE tech.buildables(
name_id INT NOT NULL PRIMARY KEY ,
description_id INT NOT NULL ,
cost INT NOT NULL CHECK( cost > 0 ) ,
work INT NOT NULL CHECK( work > 0 ) ,
upkeep INT NOT NULL CHECK( upkeep >= 0 )
name_id INT NOT NULL PRIMARY KEY ,
description_id INT NOT NULL ,
technology_name_id INT ,
cost INT NOT NULL CHECK( cost > 0 ) ,
work INT NOT NULL CHECK( work > 0 ) ,
upkeep INT NOT NULL CHECK( upkeep >= 0 )
);
CREATE INDEX idx_buildables_description
ON tech.buildables (description_id);
CREATE INDEX idx_buildables_technology
ON tech.buildables ( technology_name_id );
ALTER TABLE tech.buildables
ADD CONSTRAINT fk_buildables_name
FOREIGN KEY (name_id) REFERENCES defs.strings ,
ADD CONSTRAINT fk_buildables_description
FOREIGN KEY (description_id) REFERENCES defs.strings;
FOREIGN KEY (description_id) REFERENCES defs.strings ,
ADD CONSTRAINT fk_buildables_technology
FOREIGN KEY (technology_name_id) REFERENCES defs.technologies;
--