chrFactions (CCP DB)
From EVEDev
| CCP DB Table Categories |
|---|
You can check the Factions page for in-game mappings from the database and API.
Contents |
[edit] Structure
| Column | Index | Type | Attributes | Default | Note |
|---|---|---|---|---|---|
| factionID | Y | int(11) | NOT NULL | ||
| factionName | Y | varchar(100) | assumed NOT NULL | index, attr differ from distro | |
| description | N | varchar(1000) | NULL | NULL | |
| raceIDs | N | int(11) | assumed NOT NULL | races involved in faction bit field of chrRaces.raceID examples below attr differ from distro | |
| solarSystemID | Y | int(11) | assumed NOT NULL | System Head quarters attr differ from distro | |
| corporationID | Y | int(11) | assumed NOT NULL | NPC corp representing faction attr differ from distro | |
| sizeFactor | N | double | assumed NOT NULL | size of faction, unknown formula | |
| stationCount | N | smallint(6) | assumed NOT NULL | number of stations owned attr differ from distro | |
| stationSystemCount | N | smallint(6) | assumed NOT NULL | number of systems where faction owns stations attr differ from distro | |
| militiaCorporationID | Y | int(11) | NULL | NULL | corporation for faction warfare |
| iconID | Y | int(11) | NULL | NULL | ID of icon |
[edit] Indexes
| Columns | Type | Foreign Table | Note |
|---|---|---|---|
| factionID | Primary Key Foreign Key | loose eveNames.itemID | |
| factionName | Unique | assumed, not in distro | |
| solarSystemID | Foreign Key | mapSolarSystems.solarSystemID | |
| corporationID | Foreign Key | crpNPCCorporations.corporationID loose eveNames.itemID | |
| militiaCorporationID | Foreign Key | crpNPCCorporations.corporationID loose eveNames.itemID | |
| iconID | Foreign Key | eveIcons.iconID | |
Foreign keys to: crpNPCCorporations (x2), mapSolarSystems
Loose foreign keys to: eveNames (x3)
Foreign keys from: None
Loose foreign keys from: None
[edit] RaceIDs bit field
This column is a bit field of raceIDs, meaning it is the SUM or logical AND of them. For exaple, Guristas have a RaceIDs of 9, which is Caldari (id 1) and Gallente (id 8). Query examples for determining races based on a bit field bellow.
[edit] CCP Image Dump
While we are not provided with an image mapping for factions, you can obtain a user submitted table with common mappings. chrFactionGraphics
[edit] Query Examples
[edit] Human readable columns
SELECT `t1`.`factionName` AS `name`, `t1`.`description` AS `description`, `t1`.`sizeFactor` AS `size`, `t1`.`stationCount` AS `stationCount`, `t1`.`stationSystemCount` AS `stationSystemCount`, `t1`.`raceIDs` AS `raceMask`, `t3`.`solarSystemName` AS `system`, `t4`.`itemName` AS `corp`, `t5`.`itemName` AS `militia` FROM `chrFactions` AS `t1` LEFT JOIN `mapSolarSystems` AS `t3` ON `t1`.`solarSystemID` = `t3`.`solarSystemID` LEFT JOIN `eveNames` AS `t4` ON `t1`.`corporationID` = `t4`.`itemID` LEFT JOIN `eveNames` AS `t5` ON `t1`.`militiaCorporationID` = `t5`.`itemID` ORDER BY `t1`.`factionName`
Limited Result:
| name | description | size | stationCount | stationSystemCount | raceMask | system | corp | militia |
|---|---|---|---|---|---|---|---|---|
| Amarr Empire | The largest of the five main empires, the Amarr Empire is a sprawling patch-work of feudal-like provinces held together by the might of the emperor. Religion has always played a big part in Amarrian politics and the Amarrians believe they are the rightful masters of the world, souring their relations with their neighbours. Another source of ill-feelings on part of the other empires is the fact that the Amarrians embrace slavery. | 5 | 998 | 484 | 4 | Amarr | Amarr Navy | 24th Imperial Crusade |
[edit] Races for Factions
SELECT `t2`.`factionName` AS `factionName`, `t1`.`raceName` AS `raceName` FROM `chrRaces` AS `t1` INNER JOIN `chrFactions` AS `t2` WHERE `t2`.`RaceIDs` & `t1`.`RaceID` = `t1`.`RaceID` ORDER BY `t2`.`factionName` ASC, `t1`.`raceName` ASC
Limited Result:
| factionName | raceName |
|---|---|
| Angel Cartel | Amarr |
| Angel Cartel | Caldari |
| Angel Cartel | Gallente |
| Angel Cartel | Minmatar |

