Badge regions (Database Table)

From SWGANH Wiki
Revision as of 23:09, 12 March 2010 by Nebula (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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)