]> ruin.nu Git - ndwebbie.git/blob - database/r100.sql
Updates for round 100
[ndwebbie.git] / database / r100.sql
1 ALTER TYPE governments RENAME TO govs;
2 \i tables/races.sql
3 \i data/races.sql
4 \i tables/governments.sql
5 \i data/governments.sql
6
7 DROP VIEW full_defcalls;
8 DROP VIEW defcalls;
9 DROP VIEW full_intel;
10 DROP VIEW users_defprio;
11 DROP VIEW alliance_resources;
12 DROP VIEW current_planet_stats_full;
13 DROP VIEW current_planet_stats;
14 ALTER TABLE planets
15         ALTER COLUMN race TYPE TEXT,
16         ALTER COLUMN gov TYPE TEXT,
17         ALTER COLUMN gov SET DEFAULT '';
18 ALTER TABLE planets ADD FOREIGN KEY (race) REFERENCES races(race) ON UPDATE CASCADE ON DELETE RESTRICT;
19 ALTER TABLE planets ADD FOREIGN KEY (gov) REFERENCES governments(gov) ON UPDATE CASCADE ON DELETE SET DEFAULT;
20 \d planets
21 \i views/current_planet_stats.sql
22 \i views/alliances_resources.sql
23 \i views/users_defprio.sql
24 \i views/full_intel.sql
25 \i views/defcalls.sql
26
27 DROP FUNCTION IF EXISTS find_planet_id(text,text,text,race);
28 DROP FUNCTION covop_alert(integer, integer, integer, integer, govs, integer);
29 \i functions/find_planet_id.sql
30 \i functions/find_planet_id.sql
31 ALTER TABLE ship_stats ADD FOREIGN KEY (race) REFERENCES races(race) ON UPDATE CASCADE ON DELETE CASCADE;
32 \d ship_stats
33
34 DROP TYPE race;
35 DROP TYPE govs;
36
37 \i functions/hostile_alliances.sql