1 DROP VIEW current_structure_scans;
2 DROP VIEW current_tech_scans;
3 DROP TABLE structure_scans;
6 CREATE TABLE development_scans (
7 id integer PRIMARY KEY REFERENCES scans(id),
8 planet integer NOT NULL REFERENCES planets(id),
10 light_fac integer NOT NULL,
11 medium_fac integer NOT NULL,
12 heavy_fac integer NOT NULL,
13 amps integer NOT NULL,
14 distorters integer NOT NULL,
15 metal_ref integer NOT NULL,
16 crystal_ref integer NOT NULL,
17 eonium_ref integer NOT NULL,
18 reslabs integer NOT NULL,
19 fincents integer NOT NULL,
20 seccents integer NOT NULL,
21 total integer NOT NULL,
23 travel integer NOT NULL,
24 infra integer NOT NULL,
25 hulls integer NOT NULL,
26 waves integer NOT NULL,
27 extraction integer NOT NULL,
28 covert integer NOT NULL,
29 mining integer NOT NULL
32 CREATE OR REPLACE VIEW current_development_scans AS
33 SELECT DISTINCT ON (planet) ds.*
34 FROM development_scans ds
35 ORDER BY planet, tick DESC, id DESC;
37 CREATE INDEX development_scans_planet_index ON development_scans(planet,tick);