Difference between revisions of "Badge regions (Database Table)"

From SWGANH Wiki
Jump to: navigation, search
(New page: {{PageHeader|Database Table|badge_regions}} {| border="0" width="90%" cellpadding=6 |- |valign=top| ==Table Structure== {| align="center" |- || {| class = "wikitable" |- align="center" ...)
 
 
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||bigint(20)||align="center"|[[Image:Symbol OK.png|10px]]||align="center"| ||NO||Primary||0||  
 
|- align="center" style="background-color:#F1F1F1;"
 
|- align="center" style="background-color:#F1F1F1;"
|| || ||align="center"| ||align="center"| || || || ||  
+
|align="left"|region_id||int(11)||align="center"|[[Image:Symbol OK.png|10px]] ||align="center"| ||NO|| ||0||Region ID
|-
+
|- align="center"
 +
|align="left"|badge_id||int(11)||align="center"|[[Image:Symbol OK.png|10px]] ||align="center"| ||NO|| ||0||Badge ID
 +
|- align="center" style="background-color:#F1F1F1;"
 +
|align="left"|planet_id||int(2)||align="center"| ||align="center"| ||NO|| ||0||Planet ID
 +
|- align="center"
 +
|align="left"|parent_id||bigint(20)||align="center"|[[Image:Symbol OK.png|10px]] ||align="center"| ||NO|| ||0||Parent ID
 
|}
 
|}
 
|}
 
|}
Line 25: Line 30:
 
{|align="center"
 
{|align="center"
 
|-
 
|-
||{{D25%}}
+
||{{D100%}}
 
|-
 
|-
 
||{{Database}}
 
||{{Database}}
Line 36: Line 41:
 
==Table Create Script==
 
==Table Create Script==
 
<pre>
 
<pre>
   
+
--
 +
-- Definition of table `badge_regions`
 +
--
 +
 
 +
DROP TABLE IF EXISTS `badge_regions`;
 +
CREATE TABLE `badge_regions` (
 +
  `Id` bigint(20) unsigned NOT NULL default '0',
 +
  `region_id` int(11) unsigned NOT NULL default '0',
 +
  `badge_id` int(11) unsigned NOT NULL default '0',
 +
  `planet_id` int(2) NOT NULL default '0',
 +
  `parent_id` bigint(20) unsigned NOT NULL default '0',
 +
  PRIMARY KEY (`Id`),
 +
  KEY `fk_badge_regions_region_region` (`region_id`),
 +
  KEY `fk_badge_regions_badge_badge` (`badge_id`),
 +
  KEY `fk_badgeregion_planet_planet` (`planet_id`),
 +
  CONSTRAINT `fk_badgeregion_planet_planet` FOREIGN KEY (`planet_id`) REFERENCES `planet` (`planet_id`) ON DELETE CASCADE ON UPDATE CASCADE,
 +
  CONSTRAINT `fk_badge_regions_badge_badge` FOREIGN KEY (`badge_id`) REFERENCES `badges` (`Id`) ON DELETE CASCADE ON UPDATE CASCADE,
 +
  CONSTRAINT `fk_badge_regions_region_region` FOREIGN KEY (`region_id`) REFERENCES `planet_regions` (`region_id`) ON DELETE CASCADE ON UPDATE CASCADE
 +
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=REDUNDANT;
 
</pre>
 
</pre>
  
 
==Table Describe==
 
==Table Describe==
 
<pre>
 
<pre>
   
+
mysql> describe badge_regions;
 +
+-----------+---------------------+------+-----+---------+-------+
 +
| Field    | Type                | Null | Key | Default | Extra |
 +
+-----------+---------------------+------+-----+---------+-------+
 +
| Id        | bigint(20) unsigned | NO  | PRI | 0      |      |
 +
| region_id | int(11) unsigned    | NO  | MUL | 0      |      |
 +
| badge_id | int(11) unsigned    | NO  | MUL | 0      |      |
 +
| planet_id | int(2)              | NO  | MUL | 0      |      |
 +
| parent_id | bigint(20) unsigned | NO  |    | 0      |      |
 +
+-----------+---------------------+------+-----+---------+-------+
 +
5 rows in set (0.11 sec)
 
</pre>
 
</pre>

Latest revision as of 23:09, 12 March 2010

Database Table - badge_regions

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 NO Primary 0
region_id int(11) Symbol OK.png NO 0 Region ID
badge_id int(11) Symbol OK.png NO 0 Badge ID
planet_id int(2) NO 0 Planet ID
parent_id bigint(20) Symbol OK.png NO 0 Parent 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 `badge_regions`
--

DROP TABLE IF EXISTS `badge_regions`;
CREATE TABLE `badge_regions` (
  `Id` bigint(20) unsigned NOT NULL default '0',
  `region_id` int(11) unsigned NOT NULL default '0',
  `badge_id` int(11) unsigned NOT NULL default '0',
  `planet_id` int(2) NOT NULL default '0',
  `parent_id` bigint(20) unsigned NOT NULL default '0',
  PRIMARY KEY  (`Id`),
  KEY `fk_badge_regions_region_region` (`region_id`),
  KEY `fk_badge_regions_badge_badge` (`badge_id`),
  KEY `fk_badgeregion_planet_planet` (`planet_id`),
  CONSTRAINT `fk_badgeregion_planet_planet` FOREIGN KEY (`planet_id`) REFERENCES `planet` (`planet_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_badge_regions_badge_badge` FOREIGN KEY (`badge_id`) REFERENCES `badges` (`Id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_badge_regions_region_region` FOREIGN KEY (`region_id`) REFERENCES `planet_regions` (`region_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=REDUNDANT;

Table Describe

mysql> describe badge_regions;
+-----------+---------------------+------+-----+---------+-------+
| Field     | Type                | Null | Key | Default | Extra |
+-----------+---------------------+------+-----+---------+-------+
| Id        | bigint(20) unsigned | NO   | PRI | 0       |       |
| region_id | int(11) unsigned    | NO   | MUL | 0       |       |
| badge_id  | int(11) unsigned    | NO   | MUL | 0       |       |
| planet_id | int(2)              | NO   | MUL | 0       |       |
| parent_id | bigint(20) unsigned | NO   |     | 0       |       |
+-----------+---------------------+------+-----+---------+-------+
5 rows in set (0.11 sec)