Removed old research system

* Removed all tables, views and functions

* Removed references to old system in Java code, including old import
tool

* Replaced XML dump code
This commit is contained in:
Emmanuel BENOîT 2012-04-09 11:36:09 +02:00
parent 070d55dc05
commit 96c296e9d5
22 changed files with 345 additions and 705 deletions
legacyworlds-server-data/db-structure/parts/030-data

View file

@ -161,56 +161,3 @@ ALTER TABLE defs.techdep_cache
REFERENCES defs.techdep_cache( technology_name_id , tdcache_reverse , tdcache_id )
ON DELETE CASCADE;
/*
* Old B6M1 research system below.
*/
--
-- Technology lines
--
CREATE TABLE tech.lines(
name_id INT NOT NULL PRIMARY KEY ,
description_id INT NOT NULL
);
CREATE INDEX idx_lines_description
ON tech.lines (description_id);
ALTER TABLE tech.lines
ADD CONSTRAINT fk_lines_name
FOREIGN KEY (name_id) REFERENCES defs.strings ,
ADD CONSTRAINT fk_lines_description
FOREIGN KEY (description_id) REFERENCES defs.strings;
--
-- Technology levels
--
CREATE TABLE tech.levels(
id SERIAL NOT NULL PRIMARY KEY ,
line_id INT NOT NULL ,
level INT NOT NULL CHECK( level > 0 ) ,
name_id INT NOT NULL ,
description_id INT NOT NULL ,
points INT NOT NULL CHECK( points > 0 ) ,
cost INT NOT NULL CHECK( cost > 0 )
);
CREATE UNIQUE INDEX idx_levels_linelevel
ON tech.levels (line_id, level);
CREATE INDEX idx_levels_name
ON tech.levels (name_id);
CREATE INDEX idx_levels_description
ON tech.levels (description_id);
ALTER TABLE tech.levels
ADD CONSTRAINT fk_levels_line
FOREIGN KEY (line_id) REFERENCES tech.lines ,
ADD CONSTRAINT fk_levels_name
FOREIGN KEY (name_id) REFERENCES defs.strings ,
ADD CONSTRAINT fk_levels_description
FOREIGN KEY (description_id) REFERENCES defs.strings;

View file

@ -32,25 +32,6 @@ ALTER TABLE tech.buildables
FOREIGN KEY (technology_name_id) REFERENCES defs.technologies;
--
-- Requirements
--
CREATE TABLE tech.buildable_requirements(
buildable_id INT NOT NULL ,
level_id INT NOT NULL ,
PRIMARY KEY( buildable_id , level_id )
);
CREATE INDEX idx_buildablereqs_level
ON tech.buildable_requirements( level_id );
ALTER TABLE tech.buildable_requirements
ADD CONSTRAINT fk_buildablereqs_buildable
FOREIGN KEY (buildable_id) REFERENCES tech.buildables ,
ADD CONSTRAINT fk_buildablereqs_level
FOREIGN KEY (level_id) REFERENCES tech.levels;
--
-- Buildings
--

View file

@ -146,32 +146,6 @@ ALTER TABLE emp.technologies_v2
FOREIGN KEY ( technology_name_id ) REFERENCES defs.technologies;
--
-- Empire technologies
--
CREATE TABLE emp.technologies(
empire_id INT NOT NULL ,
line_id INT NOT NULL ,
level INT NOT NULL DEFAULT 1
CHECK( level > 0 ) ,
accumulated REAL NOT NULL DEFAULT 0
CHECK( accumulated >= 0 ),
PRIMARY KEY( empire_id , line_id )
);
CREATE INDEX idx_technologies_line
ON emp.technologies (line_id);
ALTER TABLE emp.technologies
ADD CONSTRAINT fk_technologies_empire
FOREIGN KEY (empire_id) REFERENCES emp.empires
ON DELETE CASCADE ,
ADD CONSTRAINT fk_technologies_line
FOREIGN KEY (line_id) REFERENCES tech.lines;
--
-- Empire planets
--

View file

@ -83,28 +83,6 @@ ALTER TABLE events.bqe_locations
FOREIGN KEY (location_id) REFERENCES verse.planets;
--
-- Empire events
--
CREATE TABLE events.empire_events(
event_id BIGINT NOT NULL PRIMARY KEY ,
technology_id INT NOT NULL
);
CREATE INDEX idx_empevents_tech
ON events.empire_events (technology_id);
ALTER TABLE events.empire_events
ADD CONSTRAINT fk_empevents_event
FOREIGN KEY (event_id) REFERENCES events.events
ON DELETE CASCADE,
ADD CONSTRAINT fk_empevents_tech
FOREIGN KEY (technology_id) REFERENCES tech.levels;
--
-- Fleet events
--