Zone regions (Database Table)

From SWGANH Wiki
Jump to: navigation, search

Database Table - Zone 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 int(11) Symbol OK.png Symbol OK.png NO Primary Zone Region ID
region_id int(11) Symbol OK.png NO 1 Region ID
planet_id int(2) NO 0 Planet ID
qtDepth int(2) Symbol OK.png NO 8 Quad Tree Depth

Related Tags

75% This document is nearing completion.

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 `zone_regions`;
CREATE TABLE `zone_regions` (
  `Id` int(11) unsigned NOT NULL auto_increment,
  `region_id` int(11) unsigned NOT NULL default '1',
  `planet_id` int(2) NOT NULL default '0',
  `qtDepth` int(2) unsigned NOT NULL default '8',
  PRIMARY KEY  (`Id`),
  KEY `fk_zone_region` (`region_id`),
  KEY `fk_zone_planet` (`planet_id`),
  CONSTRAINT `fk_zone_region` FOREIGN KEY (`region_id`) REFERENCES `planet_regions` (`region_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_zone_planet` FOREIGN KEY (`planet_id`) REFERENCES `planet` (`planet_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;

Table Describe

mysql> desc zone_regions;
+-----------+------------------+------+-----+---------+----------------+
| Field     | Type             | Null | Key | Default | Extra          |
+-----------+------------------+------+-----+---------+----------------+
| Id        | int(11) unsigned | NO   | PRI | NULL    | auto_increment |
| region_id | int(11) unsigned | NO   | MUL | 1       |                |
| planet_id | int(2)           | NO   | MUL | 0       |                |
| qtDepth   | int(2) unsigned  | NO   |     | 8       |                |
+-----------+------------------+------+-----+---------+----------------+
4 rows in set (0.01 sec)