-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathprime_db.sql
132 lines (126 loc) · 3.87 KB
/
prime_db.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
/*
* This file is here to deal with some tables needing to contain both
* static and dynamic information. The solution for ease of release is
* to keep all the static info in a seperate copy of the tables such
* that it can be loaded into the non-static table.
*/
/*
* Truncate all the dynamic tables
*/
TRUNCATE TABLE alliance_ShortNames;
TRUNCATE TABLE billsPayable;
TRUNCATE TABLE billsReceivable;
TRUNCATE TABLE bookmarks;
TRUNCATE TABLE cacheLocations;
TRUNCATE TABLE cacheOwners;
TRUNCATE TABLE channelChars;
TRUNCATE TABLE channelMods;
TRUNCATE TABLE character_;
TRUNCATE TABLE chrApplications;
TRUNCATE TABLE chrEmployment;
TRUNCATE TABLE chrMissionState;
TRUNCATE TABLE chrNotes;
TRUNCATE TABLE chrNPCStandings;
TRUNCATE TABLE chrOffers;
TRUNCATE TABLE chrOwnerNote;
TRUNCATE TABLE chrSkillQueue;
TRUNCATE TABLE chrStandings;
TRUNCATE TABLE corporation;
TRUNCATE TABLE courierMissions;
TRUNCATE TABLE crpCharShares;
TRUNCATE TABLE crpOffices;
TRUNCATE TABLE droneState;
TRUNCATE TABLE entity;
TRUNCATE TABLE entity_attributes;
TRUNCATE TABLE eveMail;
TRUNCATE TABLE eveMailDetails;
TRUNCATE TABLE invBlueprints;
TRUNCATE TABLE market_history_old;
TRUNCATE TABLE market_journal;
TRUNCATE TABLE market_orders;
TRUNCATE TABLE market_transactions;
TRUNCATE TABLE npcStandings;
TRUNCATE TABLE ramAssemblyLineStationCostLogs;
TRUNCATE TABLE ramJobs;
TRUNCATE TABLE rentalInfo;
TRUNCATE TABLE srvStatus;
/*
* Insert static characters (agents)
* TODO: Develop a query which will populate character_ using agtAgents and
* random value generation)
*/
INSERT INTO character_
SELECT
characterID, accountID, title, description, bounty, balance, securityRating, petitionMessage, logonMinutes, 0 AS skillPoints,
corporationID, 0 AS corpRole, 0 AS rolesAtAll, 0 AS rolesAtBase, 0 AS rolesAtHQ, 0 AS rolesAtOther,
corporationDateTime, startDateTime, createDateTime,
ancestryID, careerID, schoolID, careerSpecialityID, gender,
stationID, solarSystemID, constellationID, regionID,
0 AS online, 2 AS freeRespecs, 0 AS nextRespec, 0 AS deletePrepareDateTime
FROM characterStatic;
/*
* Copy over the static entities:
* Static record of EVE System
*/
INSERT INTO entity (itemID, itemName, singleton, quantity)
VALUES (1, 'EVE System', 1, 1);
/*
* Insert solar systems
*/
INSERT INTO entity (itemID, itemName, typeID, ownerID, singleton, quantity, x, y, z)
SELECT solarSystemID, solarSystemName, 5, 1, 1, 1, x, y, z
FROM mapSolarSystems;
/*
* Insert stations
*/
INSERT INTO entity (itemID, itemName, typeID, ownerID, locationID, singleton, quantity, x, y, z)
SELECT stationID, stationName, stationTypeID, corporationID, solarSystemID, 1, 1, x, y, z
FROM staStations;
/*
* Insert characters
*/
INSERT INTO entity (itemID, itemName, typeID, ownerID, locationID, singleton, quantity)
SELECT characterID, characterName, typeID, 1, stationID, 1, 1
FROM characterStatic;
/*
* Set the auto-increment lower bound
*/
ALTER TABLE entity AUTO_INCREMENT=140000000;
/*
* Copy over the static corporation info
*/
INSERT INTO corporation
SELECT * FROM corporationStatic;
/*
* Set the auto-increment lower bound
*/
ALTER TABLE corporation AUTO_INCREMENT=2000001;
/*
* Copy over the static owner info.
* This is a bit hacky: we rebuild this table although it's static but it
* allows us not to include its data in dump.
*/
TRUNCATE TABLE eveStaticOwners;
/*
* Static record of EVE System
*/
INSERT INTO eveStaticOwners (ownerID, ownerName, typeID)
VALUES (1, 'EVE System', 0);
/*
* Insert agents
*/
INSERT INTO eveStaticOwners (ownerID, ownerName, typeID)
SELECT characterID, characterName, typeID
FROM characterStatic;
/*
* Insert factions
*/
INSERT INTO eveStaticOwners (ownerID, ownerName, typeID)
SELECT factionID, factionName, 30 AS typeID
FROM chrFactions;
/*
* Insert corporations
*/
INSERT INTO eveStaticOwners (ownerID, ownerName, typeID)
SELECT corporationID, corporationName, 2 AS typeID
FROM corporationStatic;