Characters (Database Table)

From SWGANH Wiki
Jump to: navigation, search

Database Table - character_skills

SWGANH Wiki is a repository of Star Wars Galaxies Developer information. This site is only meant to be used by SWGANH Developer team.


Table Structure

Field Type Unsigned Autoinc Null Key Default Value Description
id bigint(20) Symbol OK.png Symbol OK.png NO Primary NULL Character ID
account_id bigint(20) Symbol OK.png NO 0 Account ID
galaxy_id int(5) YES 0 Galaxy ID
firstname char(32) YES Unique NULL Character First Name
lastname char(32) YES NULL Character Last Name
race_id int(8) Symbol OK.png YES 0 Race ID
parent_id bigint(20) Symbol OK.png YES 0 Parent ID
planet_id int(2) NO 1 Planet ID
x float(10,6) YES NULL
y float(10,6) YES NULL
z float(10,6) YES NULL
oX float(10,6) YES NULL
oY float(10,6) YES NULL
oZ float(10,6) YES NULL
oW float(10,6) YES NULL
archived tinyint(1) Symbol OK.png NO 0
deletiondate date YES NULL Deletion Date
jedistate int(11) Symbol OK.png NO 0 Character Jedi State
bornyear char(8) YES NULL Born Year

Related Tags

100% This document is complete.

Database This document relates to the SWGANH Database Schema.

DB Table This document relates to the SWGANH Database Schema.

Table Create Script

DROP TABLE IF EXISTS `characters`;
CREATE TABLE `characters` (
  `id` bigint(20) unsigned NOT NULL auto_increment COMMENT 'Unique ID',
  `account_id` bigint(20) unsigned NOT NULL default '0' COMMENT 'Ties to the ACCOUNT Table',
  `galaxy_id` int(5) default '0' COMMENT 'Ties to the GALAXY Table',
  `firstname` char(32) default NULL COMMENT 'Character Firstname',
  `lastname` char(32) default NULL COMMENT 'Character Lastname',
  `race_id` int(8) unsigned default '0' COMMENT 'Ties to the RACE Table',
  `parent_id` bigint(20) unsigned default '0' COMMENT 'Ties to ... (Cell)',
  `planet_id` int(2) NOT NULL default '1' COMMENT 'Current Planet - Defualt Corellia',
  `x` float(10,6) default NULL COMMENT 'Character X Location',
  `y` float(10,6) default NULL COMMENT 'Character Y Location',
  `z` float(10,6) default NULL COMMENT 'Character Z Location',
  `oX` float(10,6) default NULL COMMENT 'Character Cell X Location',
  `oY` float(10,6) default NULL COMMENT 'Character Cell Y Location',
  `oZ` float(10,6) default NULL COMMENT 'Character Cell Z Location',
  `oW` float(10,6) default NULL COMMENT 'Character Cell Orientation',
  `archived` tinyint(1) unsigned default '0' COMMENT '0 = active / 1 = scheduled to be deleted',
  `deletiondate` date default NULL COMMENT 'DATE to be deleted',
  `jedistate` int(11) unsigned NOT NULL default '0',
  `bornyear` char(8) DEFAULT NULL COMMENT 'Year character was created.',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `pk_firstname` (`firstname`),
  KEY `fk_character_acc_acc` (`account_id`),
  KEY `fk_character_gal_gal` (`galaxy_id`),
  KEY `fk_character_race_race` (`race_id`),
  KEY `fk_character_planetid_planetid` (`planet_id`),
  KEY `FK_characters_jedistate_state` (`jedistate`),
  CONSTRAINT `characters_ibfk_1` FOREIGN KEY (`planet_id`) REFERENCES `planet` (`planet_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `characters_ibfk_2` FOREIGN KEY (`account_id`) REFERENCES `account` (`account_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `characters_ibfk_3` FOREIGN KEY (`galaxy_id`) REFERENCES `galaxy` (`galaxy_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `characters_ibfk_4` FOREIGN KEY (`race_id`) REFERENCES `race` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK_characters_jedistate_state` FOREIGN KEY (`jedistate`) REFERENCES `skills_jedi_states` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=8589935594 DEFAULT CHARSET=utf8;

Table Describe

mysql> describe characters;
+--------------+---------------------+------+-----+---------+----------------+
| Field        | Type                | Null | Key | Default | Extra          |
+--------------+---------------------+------+-----+---------+----------------+
| id           | bigint(20) unsigned | NO   | PRI | NULL    | auto_increment |
| account_id   | bigint(20) unsigned | NO   | MUL | 0       |                |
| galaxy_id    | int(5)              | YES  | MUL | 0       |                |
| firstname    | char(32)            | YES  | UNI | NULL    |                |
| lastname     | char(32)            | YES  |     | NULL    |                |
| race_id      | int(8) unsigned     | YES  | MUL | 0       |                |
| parent_id    | bigint(20) unsigned | YES  |     | 0       |                |
| planet_id    | int(2)              | NO   | MUL | 1       |                |
| x            | float(10,6)         | YES  |     | NULL    |                |
| y            | float(10,6)         | YES  |     | NULL    |                |
| z            | float(10,6)         | YES  |     | NULL    |                |
| oX           | float(10,6)         | YES  |     | NULL    |                |
| oY           | float(10,6)         | YES  |     | NULL    |                |
| oZ           | float(10,6)         | YES  |     | NULL    |                |
| oW           | float(10,6)         | YES  |     | NULL    |                |
| archived     | tinyint(1) unsigned | YES  |     | 0       |                |
| deletiondate | date                | YES  |     | NULL    |                |
| jedistate    | int(11) unsigned    | NO   | MUL | 0       |                |
| bornyear     | char(8)             | YES  |     | NULL    |                |
+--------------+---------------------+------+-----+---------+----------------+
19 rows in set (0.14 sec)