Difference between revisions of "Badges (Database Table)"

From SWGANH Wiki
Jump to: navigation, search
(New page: {{PageHeader|Database Table|badges}} {| border="0" width="90%" cellpadding=6 |- |valign=top| ==Table Structure== {| align="center" |- || {| class = "wikitable" |- align="center" style="...)
 
 
Line 13: Line 13:
 
||'''Field'''||'''Type'''||'''Unsigned'''||'''Autoinc'''||'''Null'''||'''Key'''||'''Default Value'''||'''Description'''
 
||'''Field'''||'''Type'''||'''Unsigned'''||'''Autoinc'''||'''Null'''||'''Key'''||'''Default Value'''||'''Description'''
 
|- align="center"  
 
|- align="center"  
|align="left"| || ||align="center"|[[Image:Symbol OK.png|10px]]||align="center"|[[Image:Symbol OK.png|10px]]|| || || ||  
+
|align="left"|Id||int(11)||align="center"|[[Image:Symbol OK.png|10px]]||align="center"| ||No||Primary||0||Badge ID
 
|- align="center" style="background-color:#F1F1F1;"
 
|- align="center" style="background-color:#F1F1F1;"
|| || ||align="center"| ||align="center"| || || || ||  
+
|align="left"|name||char(255)||align="center"| ||align="center"| ||YES||Unique||NULL||Badge Name
|-
+
|- align="center"
 +
|align="left"|sound||int(11)||align="center"|[[Image:Symbol OK.png|10px]]||align="center"| ||NO|| ||0||Sound ID
 +
|- align="center" style="background-color:#F1F1F1;"
 +
||category||int(11)||align="center"|[[Image:Symbol OK.png|10px]]||align="center"| ||NO|| ||0||Category ID
 
|}
 
|}
 
|}
 
|}
Line 25: Line 28:
 
{|align="center"
 
{|align="center"
 
|-
 
|-
||{{D25%}}
+
||{{D100%}}
 
|-
 
|-
 
||{{Database}}
 
||{{Database}}
Line 36: Line 39:
 
==Table Create Script==
 
==Table Create Script==
 
<pre>
 
<pre>
   
+
--
 +
-- 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;
 
</pre>
 
</pre>
  
 
==Table Describe==
 
==Table Describe==
 
<pre>
 
<pre>
   
+
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)
 
</pre>
 
</pre>

Latest revision as of 00:17, 13 March 2010

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)