Badges (Database Table)

From SWGANH Wiki
Jump to: navigation, search

Database Table - badges

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 int(11) Symbol OK.png No Primary 0 Badge ID
name char(255) YES Unique NULL Badge Name
sound int(11) Symbol OK.png NO 0 Sound ID
category int(11) Symbol OK.png NO 0 Category ID

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

--
-- Definition of table `badges`
--

DROP TABLE IF EXISTS `badges`;
CREATE TABLE `badges` (
  `Id` int(11) unsigned NOT NULL default '0',
  `name` char(255) default NULL,
  `sound` int(11) unsigned NOT NULL default '0',
  `category` int(11) unsigned NOT NULL default '0',
  PRIMARY KEY  (`Id`),
  UNIQUE KEY `pk_badges_name` (`name`),
  KEY `fk_badges_cat_cat` (`category`),
  KEY `fk_badges_sound_sound` (`sound`),
  CONSTRAINT `fk_badges_cat_cat` FOREIGN KEY (`category`) REFERENCES `badge_categories` (`Id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_badges_sound_sound` FOREIGN KEY (`sound`) REFERENCES `sounds` (`Id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPRESSED;

Table Describe

mysql> describe badges;
+----------+------------------+------+-----+---------+-------+
| Field    | Type             | Null | Key | Default | Extra |
+----------+------------------+------+-----+---------+-------+
| Id       | int(11) unsigned | NO   | PRI | 0       |       |
| name     | char(255)        | YES  | UNI | NULL    |       |
| sound    | int(11) unsigned | NO   | MUL | 0       |       |
| category | int(11) unsigned | NO   | MUL | 0       |       |
+----------+------------------+------+-----+---------+-------+
4 rows in set (0.06 sec)