Guest User

Convert EvE Crucible 1.1 SDE MyISAM to InnoDB + FK

a guest
Feb 8th, 2012
227
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- Converts EvE Crucible 1.1 Static Data Export in MyISAM format to InnoDB + Foreign Keys
  2.  
  3. ALTER TABLE `agtAgents` ENGINE = InnoDB;
  4. ALTER TABLE `agtAgentTypes` ENGINE = InnoDB;
  5. ALTER TABLE `agtResearchAgents` ENGINE = InnoDB;
  6. ALTER TABLE `chrAncestries` ENGINE = InnoDB;
  7. ALTER TABLE `chrAttributes` ENGINE = InnoDB;
  8. ALTER TABLE `chrBloodlines` ENGINE = InnoDB;
  9. ALTER TABLE `chrFactions` ENGINE = InnoDB;
  10. ALTER TABLE `chrRaces` ENGINE = InnoDB;
  11. ALTER TABLE `crpActivities` ENGINE = InnoDB;
  12. ALTER TABLE `crpNPCCorporationDivisions` ENGINE = InnoDB;
  13. ALTER TABLE `crpNPCCorporationResearchFields` ENGINE = InnoDB;
  14. ALTER TABLE `crpNPCCorporations` ENGINE = InnoDB;
  15. ALTER TABLE `crpNPCCorporationTrades` ENGINE = InnoDB;
  16. ALTER TABLE `crpNPCDivisions` ENGINE = InnoDB;
  17. ALTER TABLE `crtCategories` ENGINE = InnoDB;
  18. ALTER TABLE `crtCertificates` ENGINE = InnoDB;
  19. ALTER TABLE `crtClasses` ENGINE = InnoDB;
  20. ALTER TABLE `crtRecommendations` ENGINE = InnoDB;
  21. ALTER TABLE `crtRelationships` ENGINE = InnoDB;
  22. ALTER TABLE `dgmAttributeCategories` ENGINE = InnoDB;
  23. ALTER TABLE `dgmAttributeTypes` ENGINE = InnoDB;
  24. ALTER TABLE `dgmEffects` ENGINE = InnoDB;
  25. ALTER TABLE `dgmTypeAttributes` ENGINE = InnoDB;
  26. ALTER TABLE `dgmTypeEffects` ENGINE = InnoDB;
  27. ALTER TABLE `eveGraphics` ENGINE = InnoDB;
  28. ALTER TABLE `eveIcons` ENGINE = InnoDB;
  29. ALTER TABLE `eveUnits` ENGINE = InnoDB;
  30. ALTER TABLE `invBlueprintTypes` ENGINE = InnoDB;
  31. ALTER TABLE `invCategories` ENGINE = InnoDB;
  32. ALTER TABLE `invContrabandTypes` ENGINE = InnoDB;
  33. ALTER TABLE `invControlTowerResourcePurposes` ENGINE = InnoDB;
  34. ALTER TABLE `invControlTowerResources` ENGINE = InnoDB;
  35. ALTER TABLE `invFlags` ENGINE = InnoDB;
  36. ALTER TABLE `invGroups` ENGINE = InnoDB;
  37. ALTER TABLE `invItems` ENGINE = InnoDB;
  38. ALTER TABLE `invMarketGroups` ENGINE = InnoDB;
  39. ALTER TABLE `invMetaGroups` ENGINE = InnoDB;
  40. ALTER TABLE `invMetaTypes` ENGINE = InnoDB;
  41. ALTER TABLE `invNames` ENGINE = InnoDB;
  42. ALTER TABLE `invPositions` ENGINE = InnoDB;
  43. ALTER TABLE `invTypeMaterials` ENGINE = InnoDB;
  44. ALTER TABLE `invTypeReactions` ENGINE = InnoDB;
  45. ALTER TABLE `invTypes` ENGINE = InnoDB;
  46. ALTER TABLE `invUniqueNames` ENGINE = InnoDB;
  47. ALTER TABLE `mapCelestialStatistics` ENGINE = InnoDB;
  48. ALTER TABLE `mapConstellationJumps` ENGINE = InnoDB;
  49. ALTER TABLE `mapConstellations` ENGINE = InnoDB;
  50. ALTER TABLE `mapDenormalize` ENGINE = InnoDB;
  51. ALTER TABLE `mapJumps` ENGINE = InnoDB;
  52. ALTER TABLE `mapLandmarks` ENGINE = InnoDB;
  53. ALTER TABLE `mapLocationScenes` ENGINE = InnoDB;
  54. ALTER TABLE `mapLocationWormholeClasses` ENGINE = InnoDB;
  55. ALTER TABLE `mapRegionJumps` ENGINE = InnoDB;
  56. ALTER TABLE `mapRegions` ENGINE = InnoDB;
  57. ALTER TABLE `mapSolarSystemJumps` ENGINE = InnoDB;
  58. ALTER TABLE `mapSolarSystems` ENGINE = InnoDB;
  59. ALTER TABLE `mapUniverse` ENGINE = InnoDB;
  60. ALTER TABLE `planetSchematics` ENGINE = InnoDB;
  61. ALTER TABLE `planetSchematicsPinMap` ENGINE = InnoDB;
  62. ALTER TABLE `planetSchematicsTypeMap` ENGINE = InnoDB;
  63. ALTER TABLE `ramActivities` ENGINE = InnoDB;
  64. ALTER TABLE `ramAssemblyLines` ENGINE = InnoDB;
  65. ALTER TABLE `ramAssemblyLineStations` ENGINE = InnoDB;
  66. ALTER TABLE `ramAssemblyLineTypeDetailPerCategory` ENGINE = InnoDB;
  67. ALTER TABLE `ramAssemblyLineTypeDetailPerGroup` ENGINE = InnoDB;
  68. ALTER TABLE `ramAssemblyLineTypes` ENGINE = InnoDB;
  69. ALTER TABLE `ramInstallationTypeContents` ENGINE = InnoDB;
  70. ALTER TABLE `ramTypeRequirements` ENGINE = InnoDB;
  71. ALTER TABLE `staStations` ENGINE = InnoDB;
  72. ALTER TABLE `staOperations` ENGINE = InnoDB;
  73. ALTER TABLE `staOperationServices` ENGINE = InnoDB;
  74. ALTER TABLE `staServices` ENGINE = InnoDB;
  75. ALTER TABLE `staStationTypes` ENGINE = InnoDB;
  76. ALTER TABLE `translationTables` ENGINE = InnoDB;
  77. ALTER TABLE `trnTranslations` ENGINE = InnoDB;
  78. ALTER TABLE `trnTranslationColumns` ENGINE = InnoDB;
  79. ALTER TABLE `trnTranslationLanguages` ENGINE = InnoDB;
  80. ALTER TABLE `warCombatZones` ENGINE = InnoDB;
  81. ALTER TABLE `warCombatZoneSystems` ENGINE = InnoDB;
  82.  
  83.  
  84. ALTER TABLE agtAgents
  85. ADD CONSTRAINT agtAgents_agentID_fkey FOREIGN KEY (agentID) REFERENCES invNames(itemID),
  86. ADD CONSTRAINT agtAgents_agentTypeID_fkey FOREIGN KEY (agentTypeID) REFERENCES agtAgentTypes(agentTypeID),
  87. ADD CONSTRAINT agtAgents_corporationID_fkey FOREIGN KEY (corporationID) REFERENCES crpNPCCorporations(corporationID),
  88. ADD CONSTRAINT agtAgents_divisionID_fkey FOREIGN KEY (divisionID) REFERENCES crpNPCDivisions(divisionID),
  89. ADD CONSTRAINT agtAgents_locationID_fkey FOREIGN KEY (locationID) REFERENCES mapDenormalize(itemID);
  90.  
  91. ALTER TABLE agtResearchAgents
  92. ADD CONSTRAINT agtResearchAgents_agentID_fkey FOREIGN KEY (agentID) REFERENCES agtAgents(agentID),
  93. ADD CONSTRAINT agtResearchAgents_typeID_fkey FOREIGN KEY (typeID) REFERENCES invTypes(typeID);
  94.  
  95. ALTER TABLE chrAncestries
  96. ADD CONSTRAINT chrAncestries_bloodlineID_fkey FOREIGN KEY (bloodlineID) REFERENCES chrBloodlines(bloodlineID),
  97. ADD CONSTRAINT chrAncestries_iconID_fkey FOREIGN KEY (iconID) REFERENCES eveIcons(iconID);
  98.  
  99. ALTER TABLE chrAttributes
  100. ADD CONSTRAINT chrAttributes_iconID_fkey FOREIGN KEY (iconID) REFERENCES eveIcons(iconID);
  101.  
  102. ALTER TABLE chrBloodlines
  103. ADD CONSTRAINT chrBloodlines_corporationID_fkey FOREIGN KEY (corporationID) REFERENCES crpNPCCorporations(corporationID),
  104. ADD CONSTRAINT chrBloodlines_iconID_fkey FOREIGN KEY (iconID) REFERENCES eveIcons(iconID),
  105. ADD CONSTRAINT chrBloodlines_raceID_fkey FOREIGN KEY (raceID) REFERENCES chrRaces(raceID),
  106. ADD CONSTRAINT chrBloodlines_shipTypeID_fkey FOREIGN KEY (shipTypeID) REFERENCES invTypes(typeID);
  107.  
  108. ALTER TABLE chrFactions
  109. ADD CONSTRAINT chrFactions_corporationID_fkey FOREIGN KEY (corporationID) REFERENCES crpNPCCorporations(corporationID),
  110. ADD CONSTRAINT chrFactions_iconID_fkey FOREIGN KEY (iconID) REFERENCES eveIcons(iconID),
  111. ADD CONSTRAINT chrFactions_militiaCorporationID_fkey FOREIGN KEY (militiaCorporationID) REFERENCES crpNPCCorporations(corporationID),
  112. ADD CONSTRAINT chrFactions_solarSystemID_fkey FOREIGN KEY (solarSystemID) REFERENCES mapSolarSystems(solarSystemID);
  113.  
  114. ALTER TABLE chrRaces
  115. ADD CONSTRAINT chrRaces_iconID_fkey FOREIGN KEY (iconID) REFERENCES eveIcons(iconID);
  116.  
  117. ALTER TABLE crpNPCCorporationDivisions
  118. ADD CONSTRAINT crpNPCCorporationDivisions_corporationID_fkey FOREIGN KEY (corporationID) REFERENCES crpNPCCorporations(corporationID),
  119. ADD CONSTRAINT crpNPCCorporationDivisions_divisionId_fkey FOREIGN KEY (divisionId) REFERENCES crpNPCDivisions(divisionId);
  120.  
  121. ALTER TABLE crpNPCCorporationResearchFields
  122. ADD CONSTRAINT crpNPCCorporationResearchFields_corporationID_fkey FOREIGN KEY (corporationID) REFERENCES crpNPCCorporations(corporationID),
  123. ADD CONSTRAINT crpNPCCorporationResearchFields_skillID_fkey FOREIGN KEY (skillID) REFERENCES invTypes(typeID);
  124.  
  125. ALTER TABLE crpNPCCorporations
  126. ADD CONSTRAINT crpNPCCorporations_corporationID_fkey FOREIGN KEY (corporationID) REFERENCES invNames(itemID),
  127. ADD CONSTRAINT crpNPCCorporations_enemyID_fkey FOREIGN KEY (enemyID) REFERENCES crpNPCCorporations(corporationID),
  128. ADD CONSTRAINT crpNPCCorporations_factionID_fkey FOREIGN KEY (factionID) REFERENCES chrFactions(factionID),
  129. ADD CONSTRAINT crpNPCCorporations_friendID_fkey FOREIGN KEY (friendID) REFERENCES crpNPCCorporations(corporationID),
  130. ADD CONSTRAINT crpNPCCorporations_iconID_fkey FOREIGN KEY (iconID) REFERENCES eveIcons(iconID),
  131. ADD CONSTRAINT crpNPCCorporations_investorID1_fkey FOREIGN KEY (investorID1) REFERENCES crpNPCCorporations(corporationID),
  132. ADD CONSTRAINT crpNPCCorporations_investorID2_fkey FOREIGN KEY (investorID2) REFERENCES crpNPCCorporations(corporationID),
  133. ADD CONSTRAINT crpNPCCorporations_investorID3_fkey FOREIGN KEY (investorID3) REFERENCES crpNPCCorporations(corporationID),
  134. ADD CONSTRAINT crpNPCCorporations_investorID4_fkey FOREIGN KEY (investorID4) REFERENCES crpNPCCorporations(corporationID),
  135. ADD CONSTRAINT crpNPCCorporations_solarSystemID_fkey FOREIGN KEY (solarSystemID) REFERENCES mapSolarSystems(solarSystemID);
  136.  
  137. ALTER TABLE crpNPCCorporationTrades
  138. ADD CONSTRAINT crpNPCCorporationTrades_corporationID_fkey FOREIGN KEY (corporationID) REFERENCES crpNPCCorporations(corporationID),
  139. ADD CONSTRAINT crpNPCCorporationTrades_typeID_fkey FOREIGN KEY (typeID) REFERENCES invTypes(typeID);
  140.  
  141. ALTER TABLE crtCertificates
  142. ADD CONSTRAINT crtCertificates_categoryID_fkey FOREIGN KEY (categoryID) REFERENCES crtCategories(categoryID),
  143. ADD CONSTRAINT crtCertificates_classID_fkey FOREIGN KEY (classID) REFERENCES crtClasses(classID),
  144. ADD CONSTRAINT crtCertificates_corpID_fkey FOREIGN KEY (corpID) REFERENCES crpNPCCorporations(corporationID),
  145. ADD CONSTRAINT crtCertificates_iconID_fkey FOREIGN KEY (iconID) REFERENCES eveIcons(iconID);
  146.  
  147. ALTER TABLE crtRecommendations
  148. ADD CONSTRAINT crtRecommendations_certificateID_fkey FOREIGN KEY (certificateID) REFERENCES crtCertificates(certificateID),
  149. ADD CONSTRAINT crtRecommendations_shiptypeID_fkey FOREIGN KEY (shiptypeID) REFERENCES invTypes(typeID);
  150.  
  151. ALTER TABLE crtRelationships
  152. ADD CONSTRAINT crtRelationships_childID_fkey FOREIGN KEY (childID) REFERENCES crtCertificates(certificateID),
  153. ADD CONSTRAINT crtRelationships_parentID_fkey FOREIGN KEY (parentID) REFERENCES crtCertificates(certificateID),
  154. ADD CONSTRAINT crtRelationships_parentTypeID_fkey FOREIGN KEY (parentTypeID) REFERENCES invTypes(typeID);
  155.  
  156. ALTER TABLE dgmAttributeTypes
  157. ADD CONSTRAINT dgmAttributeTypes_categoryID_fkey FOREIGN KEY (categoryID) REFERENCES dgmAttributeCategories(categoryID),
  158. ADD CONSTRAINT dgmAttributeTypes_iconID_fkey FOREIGN KEY (iconID) REFERENCES eveIcons(iconID),
  159. ADD CONSTRAINT dgmAttributeTypes_unitID_fkey FOREIGN KEY (unitID) REFERENCES eveUnits(unitID);
  160.  
  161. ALTER TABLE dgmEffects
  162. ADD CONSTRAINT dgmEffects_dischargeattributeID_fkey FOREIGN KEY (dischargeattributeID) REFERENCES dgmAttributeTypes(attributeID),
  163. ADD CONSTRAINT dgmEffects_durationattributeID_fkey FOREIGN KEY (durationattributeID) REFERENCES dgmAttributeTypes(attributeID),
  164. ADD CONSTRAINT dgmEffects_falloffAttributeID_fkey FOREIGN KEY (falloffAttributeID) REFERENCES dgmAttributeTypes(attributeID),
  165. ADD CONSTRAINT dgmEffects_fittingUsageChanceAttributeID_fkey FOREIGN KEY (fittingUsageChanceAttributeID) REFERENCES dgmAttributeTypes(attributeID),
  166. ADD CONSTRAINT dgmEffects_iconID_fkey FOREIGN KEY (iconID) REFERENCES eveIcons(iconID),
  167. ADD CONSTRAINT dgmEffects_npcActivationChanceAttributeID_fkey FOREIGN KEY (npcActivationChanceAttributeID) REFERENCES dgmAttributeTypes(attributeID),
  168. ADD CONSTRAINT dgmEffects_npcUsageChanceAttributeID_fkey FOREIGN KEY (npcUsageChanceAttributeID) REFERENCES dgmAttributeTypes(attributeID),
  169. ADD CONSTRAINT dgmEffects_rangeAttributeID_fkey FOREIGN KEY (rangeAttributeID) REFERENCES dgmAttributeTypes(attributeID),
  170. ADD CONSTRAINT dgmEffects_trackingSpeedAttributeID_fkey FOREIGN KEY (trackingSpeedAttributeID) REFERENCES dgmAttributeTypes(attributeID);
  171.  
  172. ALTER TABLE dgmTypeAttributes
  173. ADD CONSTRAINT dgmTypeAttributes_attributeID_fkey FOREIGN KEY (attributeID) REFERENCES dgmAttributeTypes(attributeID),
  174. ADD CONSTRAINT dgmTypeAttributes_typeID_fkey FOREIGN KEY (typeID) REFERENCES invTypes(typeID);
  175.  
  176. ALTER TABLE dgmTypeEffects
  177. ADD CONSTRAINT dgmTypeEffects_effectID_fkey FOREIGN KEY (effectID) REFERENCES dgmEffects(effectID),
  178. ADD CONSTRAINT dgmTypeEffects_typeID_fkey FOREIGN KEY (typeID) REFERENCES invTypes(typeID);
  179.  
  180. ALTER TABLE eveGraphics
  181. ADD CONSTRAINT eveGraphics_explosionID_fkey FOREIGN KEY (explosionID) REFERENCES eveGraphics(graphicID);
  182.  
  183. ALTER TABLE invBlueprintTypes
  184. ADD CONSTRAINT invBlueprintTypes_blueprintTypeID_fkey FOREIGN KEY (blueprintTypeID) REFERENCES invTypes(typeID),
  185. ADD CONSTRAINT invBlueprintTypes_parentBlueprintTypeID_fkey FOREIGN KEY (parentBlueprintTypeID) REFERENCES invTypes(typeID),
  186. ADD CONSTRAINT invBlueprintTypes_productTypeID_fkey FOREIGN KEY (productTypeID) REFERENCES invTypes(typeID);
  187.  
  188. ALTER TABLE invCategories
  189. ADD CONSTRAINT invCategories_iconID_fkey FOREIGN KEY (iconID) REFERENCES eveIcons(iconID);
  190.  
  191. ALTER TABLE invContrabandTypes
  192. ADD CONSTRAINT invContrabandTypes_factionID_fkey FOREIGN KEY (factionID) REFERENCES chrFactions(factionID),
  193. ADD CONSTRAINT invContrabandTypes_typeID_fkey FOREIGN KEY (typeID) REFERENCES invTypes(typeID);
  194.  
  195. ALTER TABLE invControlTowerResources
  196. ADD CONSTRAINT invControlTowerResources_controlTowerTypeID_fkey FOREIGN KEY (controlTowerTypeID) REFERENCES invTypes(typeID),
  197. ADD CONSTRAINT invControlTowerResources_factionID_fkey FOREIGN KEY (factionID) REFERENCES chrFactions(factionID),
  198. ADD CONSTRAINT invControlTowerResources_purpose_fkey FOREIGN KEY (purpose) REFERENCES invControlTowerResourcePurposes(purpose),
  199. ADD CONSTRAINT invControlTowerResources_resourcetypeID_fkey FOREIGN KEY (resourcetypeID) REFERENCES invTypes(typeID);
  200.  
  201. ALTER TABLE invGroups
  202. ADD CONSTRAINT invGroups_categoryID_fkey FOREIGN KEY (categoryID) REFERENCES invCategories(categoryID),
  203. ADD CONSTRAINT invGroups_iconID_fkey FOREIGN KEY (iconID) REFERENCES eveIcons(iconID);
  204.  
  205. ALTER TABLE invItems
  206. ADD CONSTRAINT invItems_locationID_fkey FOREIGN KEY (locationID) REFERENCES invPositions(itemID),
  207. ADD CONSTRAINT invItems_ownerID_fkey FOREIGN KEY (ownerID) REFERENCES invItems(itemID),
  208. ADD CONSTRAINT invItems_typeID_fkey FOREIGN KEY (typeID) REFERENCES invTypes(typeID);
  209.  
  210. ALTER TABLE invMarketGroups
  211. ADD CONSTRAINT invMarketGroups_iconID_fkey FOREIGN KEY (iconID) REFERENCES eveIcons(iconID),
  212. ADD CONSTRAINT invMarketGroups_parentGroupID_fkey FOREIGN KEY (parentGroupID) REFERENCES invMarketGroups(marketGroupID);
  213.  
  214. ALTER TABLE invMetaGroups
  215. ADD CONSTRAINT invMetaGroups_iconID_fkey FOREIGN KEY (iconID) REFERENCES eveIcons(iconID);
  216.  
  217. ALTER TABLE invMetaTypes
  218. ADD CONSTRAINT invMetaTypes_metaGroupID_fkey FOREIGN KEY (metaGroupID) REFERENCES invMetaGroups(metaGroupID),
  219. ADD CONSTRAINT invMetaTypes_parentTypeID_fkey FOREIGN KEY (parentTypeID) REFERENCES invTypes(typeID),
  220. ADD CONSTRAINT invMetaTypes_typeID_fkey FOREIGN KEY (typeID) REFERENCES invTypes(typeID);
  221.  
  222. ALTER TABLE invTypeMaterials
  223. ADD CONSTRAINT invTypeMaterials_materialTypeID_fkey FOREIGN KEY (materialTypeID) REFERENCES invTypes(typeID),
  224. ADD CONSTRAINT invTypeMaterials_typeID_fkey FOREIGN KEY (typeID) REFERENCES invTypes(typeID);
  225.  
  226. ALTER TABLE invTypeReactions
  227. ADD CONSTRAINT invTypeReactions_reactionTypeID_fkey FOREIGN KEY (reactionTypeID) REFERENCES invTypes(typeID),
  228. ADD CONSTRAINT invTypeReactions_typeID_fkey FOREIGN KEY (typeID) REFERENCES invTypes(typeID);
  229.  
  230. ALTER TABLE invTypes
  231. ADD CONSTRAINT invTypes_graphicID_fkey FOREIGN KEY (graphicID) REFERENCES eveGraphics(graphicID),
  232. ADD CONSTRAINT invTypes_groupID_fkey FOREIGN KEY (groupID) REFERENCES invGroups(groupID),
  233. ADD CONSTRAINT invTypes_iconID_fkey FOREIGN KEY (iconID) REFERENCES eveIcons(iconID),
  234. ADD CONSTRAINT invTypes_marketGroupID_fkey FOREIGN KEY (marketGroupID) REFERENCES invMarketGroups(marketGroupID),
  235. ADD CONSTRAINT invTypes_raceID_fkey FOREIGN KEY (raceID) REFERENCES chrRaces(raceID);
  236.  
  237. ALTER TABLE invUniqueNames
  238. ADD CONSTRAINT invUniqueNames_groupID_fkey FOREIGN KEY (groupID) REFERENCES invGroups(groupID);
  239.  
  240. ALTER TABLE mapCelestialStatistics
  241. ADD CONSTRAINT mapCelestialStatistics_celestialID_fkey FOREIGN KEY (celestialID) REFERENCES mapDenormalize(itemID);
  242.  
  243. ALTER TABLE mapConstellationJumps
  244. ADD CONSTRAINT mapConstellationJumps_fromConstellationID_fkey FOREIGN KEY (fromConstellationID, fromRegionID) REFERENCES mapConstellations(constellationID, regionID),
  245. ADD CONSTRAINT mapConstellationJumps_toConstellationID_fkey FOREIGN KEY (toConstellationID, toRegionID) REFERENCES mapConstellations(constellationID, regionID);
  246.  
  247. ALTER TABLE mapConstellations
  248. ADD CONSTRAINT mapConstellations_factionID_fkey FOREIGN KEY (factionID) REFERENCES chrFactions(factionID),
  249. ADD CONSTRAINT mapConstellations_regionID_fkey FOREIGN KEY (regionID) REFERENCES mapRegions(regionID);
  250.  
  251. ALTER TABLE mapDenormalize
  252. ADD CONSTRAINT mapDenormalize_constellationID_fkey FOREIGN KEY (constellationID) REFERENCES mapConstellations(constellationID),
  253. ADD CONSTRAINT mapDenormalize_groupID_fkey FOREIGN KEY (groupID) REFERENCES invGroups(groupID),
  254. ADD CONSTRAINT mapDenormalize_orbitID_fkey FOREIGN KEY (orbitID) REFERENCES mapDenormalize(itemID),
  255. ADD CONSTRAINT mapDenormalize_regionID_fkey FOREIGN KEY (regionID) REFERENCES mapRegions(regionID),
  256. ADD CONSTRAINT mapDenormalize_solarSystemID_fkey FOREIGN KEY (solarSystemID) REFERENCES mapSolarSystems(solarSystemID),
  257. ADD CONSTRAINT mapDenormalize_typeID_fkey FOREIGN KEY (typeID) REFERENCES invTypes(typeID);
  258.  
  259. ALTER TABLE mapJumps
  260. ADD CONSTRAINT mapJumps_celestialID_fkey FOREIGN KEY (celestialID) REFERENCES mapDenormalize(itemID),
  261. ADD CONSTRAINT mapJumps_stargateID_fkey FOREIGN KEY (stargateID) REFERENCES mapDenormalize(itemID);
  262.  
  263. ALTER TABLE mapLandmarks
  264. ADD CONSTRAINT mapLandmarks_iconID_fkey FOREIGN KEY (iconID) REFERENCES eveIcons(iconID),
  265. ADD CONSTRAINT mapLandmarks_locationID_fkey FOREIGN KEY (locationID) REFERENCES mapSolarSystems(solarSystemID);
  266.  
  267. ALTER TABLE mapLocationScenes
  268. ADD CONSTRAINT mapLocationScenes_locationID_fkey FOREIGN KEY (locationID) REFERENCES mapDenormalize(itemID);
  269.  
  270. ALTER TABLE mapLocationWormholeClasses
  271. ADD CONSTRAINT mapLocationWormholeClasses_locationID_fkey FOREIGN KEY (locationID) REFERENCES mapDenormalize(itemID);
  272.  
  273. ALTER TABLE mapRegionJumps
  274. ADD CONSTRAINT mapRegionJumps_fromRegionID_fkey FOREIGN KEY (fromRegionID) REFERENCES mapRegions(regionID);
  275.  
  276. ALTER TABLE mapRegionJumps
  277. ADD CONSTRAINT mapRegionJumps_toRegionID_fkey FOREIGN KEY (toRegionID) REFERENCES mapRegions(regionID);
  278.  
  279. ALTER TABLE mapRegions
  280. ADD CONSTRAINT mapRegions_factionID_fkey FOREIGN KEY (factionID) REFERENCES chrFactions(factionID);
  281.  
  282. ALTER TABLE mapSolarSystemJumps
  283. ADD CONSTRAINT mapSolarSystemJumps_fromSolarSystemID_fkey FOREIGN KEY (fromSolarSystemID, fromConstellationID, fromRegionID) REFERENCES mapSolarSystems(solarSystemID, constellationID, regionID),
  284. ADD CONSTRAINT mapSolarSystemJumps_toSolarSystemID_fkey FOREIGN KEY (toSolarSystemID, toConstellationID, toRegionID) REFERENCES mapSolarSystems(solarSystemID, constellationID, regionID);
  285.  
  286. ALTER TABLE mapSolarSystems
  287. ADD CONSTRAINT mapSolarSystems_constellationID_fkey FOREIGN KEY (constellationID) REFERENCES mapConstellations(constellationID),
  288. ADD CONSTRAINT mapSolarSystems_factionID_fkey FOREIGN KEY (factionID) REFERENCES chrFactions(factionID),
  289. ADD CONSTRAINT mapSolarSystems_regionID_fkey FOREIGN KEY (regionID) REFERENCES mapRegions(regionID),
  290. ADD CONSTRAINT mapSolarSystems_sunTypeID_fkey FOREIGN KEY (sunTypeID) REFERENCES invTypes(typeID);
  291.  
  292. ALTER TABLE planetSchematicsPinMap
  293. ADD CONSTRAINT planetSchematicsPinMap_pinTypeID_fkey FOREIGN KEY (pinTypeID) REFERENCES invTypes(typeID);
  294.  
  295. ALTER TABLE planetSchematicsPinMap
  296. ADD CONSTRAINT planetSchematicsPinMap_pinTypeID_fkey FOREIGN KEY (pinTypeID) REFERENCES invTypes(typeID),
  297. ADD CONSTRAINT planetSchematicsPinMap_schematicID_fkey FOREIGN KEY (schematicID) REFERENCES planetSchematics(schematicID);
  298.  
  299. ALTER TABLE planetSchematicsTypeMap
  300. ADD CONSTRAINT planetSchematicsTypeMap_schematicID_fkey FOREIGN KEY (schematicID) REFERENCES planetSchematics(schematicID),
  301. ADD CONSTRAINT planetSchematicsTypeMap_typeID_fkey FOREIGN KEY (typeID) REFERENCES invTypes(typeID);
  302.  
  303. ALTER TABLE ramAssemblyLines
  304. ADD CONSTRAINT ramAssemblyLines_activityID_fkey FOREIGN KEY (activityID) REFERENCES ramActivities(activityID),
  305. ADD CONSTRAINT ramAssemblyLines_assemblyLineTypeID_fkey FOREIGN KEY (assemblyLineTypeID) REFERENCES ramAssemblyLineTypes(assemblyLineTypeID),
  306. ADD CONSTRAINT ramAssemblyLines_containerID_fkey FOREIGN KEY (containerID) REFERENCES staStations(stationID),
  307. ADD CONSTRAINT ramAssemblyLines_ownerID_fkey FOREIGN KEY (ownerID) REFERENCES crpNPCCorporations(corporationID);
  308.  
  309. ALTER TABLE ramAssemblyLineStations
  310. ADD CONSTRAINT ramAssemblyLineStations_assemblyLineTypeID_fkey FOREIGN KEY (assemblyLineTypeID) REFERENCES ramAssemblyLineTypes(assemblyLineTypeID),
  311. ADD CONSTRAINT ramAssemblyLineStations_ownerID_fkey FOREIGN KEY (ownerID) REFERENCES crpNPCCorporations(corporationID),
  312. ADD CONSTRAINT ramAssemblyLineStations_regionID_fkey FOREIGN KEY (regionID) REFERENCES mapRegions(regionID),
  313. ADD CONSTRAINT ramAssemblyLineStations_solarSystemID_fkey FOREIGN KEY (solarSystemID) REFERENCES mapSolarSystems(solarSystemID),
  314. ADD CONSTRAINT ramAssemblyLineStations_stationID_fkey FOREIGN KEY (stationID) REFERENCES staStations(stationID),
  315. ADD CONSTRAINT ramAssemblyLineStations_stationTypeID_fkey FOREIGN KEY (stationTypeID) REFERENCES invTypes(typeID);
  316.  
  317. ALTER TABLE ramAssemblyLineTypeDetailPerCategory
  318. ADD CONSTRAINT ramAssemblyLineTypeDetailPerCategory_assemblyLineTypeID_fkey FOREIGN KEY (assemblyLineTypeID) REFERENCES ramAssemblyLineTypes(assemblyLineTypeID),
  319. ADD CONSTRAINT ramAssemblyLineTypeDetailPerCategory_categoryID_fkey FOREIGN KEY (categoryID) REFERENCES invCategories(categoryID);
  320.  
  321. ALTER TABLE ramAssemblyLineTypeDetailPerGroup
  322. ADD CONSTRAINT ramAssemblyLineTypeDetailPerGroup_assemblyLineTypeID_fkey FOREIGN KEY (assemblyLineTypeID) REFERENCES ramAssemblyLineTypes(assemblyLineTypeID),
  323. ADD CONSTRAINT ramAssemblyLineTypeDetailPerGroup_groupID_fkey FOREIGN KEY (groupID) REFERENCES invGroups(groupID);
  324.  
  325. ALTER TABLE ramAssemblyLineTypes
  326. ADD CONSTRAINT ramAssemblyLineTypes_activityID_fkey FOREIGN KEY (activityID) REFERENCES ramActivities(activityID);
  327.  
  328. ALTER TABLE ramInstallationTypeContents
  329. ADD CONSTRAINT ramInstallationTypeContents_assemblyLineTypeID_fkey FOREIGN KEY (assemblyLineTypeID) REFERENCES ramAssemblyLineTypes(assemblyLineTypeID),
  330. ADD CONSTRAINT ramInstallationTypeContents_installationTypeID_fkey FOREIGN KEY (installationTypeID) REFERENCES invTypes(typeID);
  331.  
  332. ALTER TABLE ramTypeRequirements
  333. ADD CONSTRAINT ramTypeRequirements_activityID_fkey FOREIGN KEY (activityID) REFERENCES ramActivities(activityID),
  334. ADD CONSTRAINT ramTypeRequirements_requiredTypeID_fkey FOREIGN KEY (requiredTypeID) REFERENCES invTypes(typeID),
  335. ADD CONSTRAINT ramTypeRequirements_typeID_fkey FOREIGN KEY (typeID) REFERENCES invTypes(typeID);
  336.  
  337. ALTER TABLE staOperations
  338. ADD CONSTRAINT staOperations_activityID_fkey FOREIGN KEY (activityID) REFERENCES crpActivities(activityID),
  339. ADD CONSTRAINT staOperations_amarrStationTypeID_fkey FOREIGN KEY (amarrStationTypeID) REFERENCES staStationTypes(stationTypeID),
  340. ADD CONSTRAINT staOperations_caldariStationTypeID_fkey FOREIGN KEY (caldariStationTypeID) REFERENCES staStationTypes(stationTypeID),
  341. ADD CONSTRAINT staOperations_gallenteStationTypeID_fkey FOREIGN KEY (gallenteStationTypeID) REFERENCES staStationTypes(stationTypeID),
  342. ADD CONSTRAINT staOperations_joveStationTypeID_fkey FOREIGN KEY (joveStationTypeID) REFERENCES staStationTypes(stationTypeID),
  343. ADD CONSTRAINT staOperations_minmatarStationTypeID_fkey FOREIGN KEY (minmatarStationTypeID) REFERENCES staStationTypes(stationTypeID);
  344.  
  345. ALTER TABLE staOperationServices
  346. ADD CONSTRAINT staOperationServices_operationID_fkey FOREIGN KEY (operationID) REFERENCES staOperations(operationID),
  347. ADD CONSTRAINT staOperationServices_serviceID_fkey FOREIGN KEY (serviceID) REFERENCES staServices(serviceID);
  348.  
  349. ALTER TABLE staStations
  350. ADD CONSTRAINT staStations_corporationID_fkey FOREIGN KEY (corporationID) REFERENCES crpNPCCorporations(corporationID),
  351. ADD CONSTRAINT staStations_operationID_fkey FOREIGN KEY (operationID) REFERENCES staOperations(operationID),
  352. ADD CONSTRAINT staStations_solarSystemID_fkey FOREIGN KEY (solarSystemID, constellationID, regionID) REFERENCES mapSolarSystems(solarSystemID, constellationID, regionID),
  353. ADD CONSTRAINT staStations_stationTypeID_fkey FOREIGN KEY (stationTypeID) REFERENCES staStationTypes(stationTypeID);
  354.  
  355. ALTER TABLE staStationTypes
  356. ADD CONSTRAINT staStationTypes_operationID_fkey FOREIGN KEY (operationID) REFERENCES staOperations(operationID),
  357. ADD CONSTRAINT staStationTypes_stationTypeID_fkey FOREIGN KEY (stationTypeID) REFERENCES invTypes(typeID);
  358.  
  359. ALTER TABLE trnTranslations
  360. ADD CONSTRAINT trnTranslations_tcID_fkey FOREIGN KEY (tcID) REFERENCES trnTranslationColumns(tcID);
  361.  
  362. ALTER TABLE warCombatZones
  363. ADD CONSTRAINT warCombatZones_centerSystemID_fkey FOREIGN KEY (centerSystemID) REFERENCES mapSolarSystems(solarSystemID),
  364. ADD CONSTRAINT warCombatZones_factionID_fkey FOREIGN KEY (factionID) REFERENCES chrFactions(factionID);
  365.  
  366. ALTER TABLE warCombatZoneSystems
  367. ADD CONSTRAINT warCombatZoneSystems_combatZoneID_fkey FOREIGN KEY (combatZoneID) REFERENCES warCombatZones(combatZoneID),
  368. ADD CONSTRAINT warCombatZoneSystems_solarSystemID_fkey FOREIGN KEY (solarSystemID) REFERENCES mapSolarSystems(solarSystemID);
RAW Paste Data