-- --------------------------------------------------------
-- Host:                         10.0.0.11
-- Server Version:               10.4.3-MariaDB-1:10.4.3+maria~bionic - mariadb.org binary distribution
-- Server Betriebssystem:        debian-linux-gnu
-- HeidiSQL Version:             11.2.0.6213
-- --------------------------------------------------------

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

-- Exportiere Struktur von Tabelle opensimland.grids
CREATE TABLE IF NOT EXISTS `grids` (
  `GridID` int(12) NOT NULL AUTO_INCREMENT,
  `GridName` varchar(128) NOT NULL DEFAULT '',
  `GridHomeURL` varchar(128) DEFAULT NULL,
  `GridAssetServer` varchar(128) DEFAULT NULL,
  `GridIMServer` varchar(128) DEFAULT NULL,
  PRIMARY KEY (`GridID`),
  UNIQUE KEY `GridName` (`GridName`)
) ENGINE=InnoDB AUTO_INCREMENT=19771 DEFAULT CHARSET=utf8;

-- Daten Export vom Benutzer nicht ausgewählt

-- Exportiere Struktur von Tabelle opensimland.items
CREATE TABLE IF NOT EXISTS `items` (
  `ItemID` int(12) NOT NULL AUTO_INCREMENT,
  `ObjectID` int(12) NOT NULL,
  `ItemUUID` varchar(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
  `ItemAssetUUID` varchar(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
  `ItemName` varchar(256) NOT NULL DEFAULT '',
  `ItemDescription` varchar(256) NOT NULL,
  `ItemType` int(2) NOT NULL DEFAULT 0,
  PRIMARY KEY (`ItemID`),
  UNIQUE KEY `ObjectID_ItemUUID` (`ObjectID`,`ItemUUID`),
  KEY `ObjectID` (`ObjectID`),
  CONSTRAINT `FK_items_objects` FOREIGN KEY (`ObjectID`) REFERENCES `objects` (`ObjectID`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- Daten Export vom Benutzer nicht ausgewählt

-- Exportiere Struktur von Tabelle opensimland.objects
CREATE TABLE IF NOT EXISTS `objects` (
  `ObjectID` int(12) NOT NULL AUTO_INCREMENT,
  `ParcelID` int(12) NOT NULL,
  `ObjectUUID` varchar(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
  `ObjectName` varchar(256) NOT NULL,
  `ObjectDescription` varchar(256) NOT NULL,
  `ObjectImage` varchar(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
  `ObjectInSearch` double NOT NULL DEFAULT 0,
  `ObejctForSale` tinyint(1) NOT NULL DEFAULT 0,
  `ObjectPrice` double NOT NULL DEFAULT 0,
  `ObjectFreeForCopy` tinyint(1) NOT NULL DEFAULT 0,
  `ObjectPosition` varchar(30) NOT NULL,
  `ObjectOwnerID` varchar(38) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
  PRIMARY KEY (`ObjectID`),
  UNIQUE KEY `ParcelID_ObjectUUID` (`ParcelID`,`ObjectUUID`),
  KEY `ParcelID` (`ParcelID`),
  CONSTRAINT `FK_objects_parcels` FOREIGN KEY (`ParcelID`) REFERENCES `parcels` (`ParcelID`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- Daten Export vom Benutzer nicht ausgewählt

-- Exportiere Struktur von Tabelle opensimland.onlinetimes
CREATE TABLE IF NOT EXISTS `onlinetimes` (
  `RegionUUID` varchar(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
  `RegionLastSeen` datetime NOT NULL,
  `RegionOnlineUser` double NOT NULL DEFAULT 0,
  PRIMARY KEY (`RegionUUID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- Daten Export vom Benutzer nicht ausgewählt

-- Exportiere Struktur von Tabelle opensimland.parcels
CREATE TABLE IF NOT EXISTS `parcels` (
  `ParcelID` int(12) NOT NULL AUTO_INCREMENT,
  `RegionID` int(12) NOT NULL,
  `ParcelUUID` varchar(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
  `GridName` varchar(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
  `ParcelName` varchar(128) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
  `ParcelDescription` text NOT NULL,
  `ParcelForSale` tinyint(1) NOT NULL DEFAULT 0,
  `ParcelInSearch` tinyint(1) NOT NULL DEFAULT 0,
  `ParcelPrice` double NOT NULL DEFAULT 0,
  `ParcelOwnerUUID` varchar(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
  `ParcelImage` varchar(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
  `ParcelBitmap` text NOT NULL,
  `ParcelTraffic` double NOT NULL DEFAULT 0,
  PRIMARY KEY (`ParcelID`),
  UNIQUE KEY `RegionID_ParcelUUID` (`RegionID`,`ParcelUUID`),
  KEY `RegionID` (`RegionID`),
  CONSTRAINT `FK_parcels_regions` FOREIGN KEY (`RegionID`) REFERENCES `regions` (`RegionID`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;

-- Daten Export vom Benutzer nicht ausgewählt

-- Exportiere Struktur von Tabelle opensimland.queue
CREATE TABLE IF NOT EXISTS `queue` (
  `QueueID` varchar(38) NOT NULL,
  `QueueType` varchar(24) NOT NULL,
  `QueueData` text NOT NULL,
  PRIMARY KEY (`QueueID`),
  KEY `QueueType` (`QueueType`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- Daten Export vom Benutzer nicht ausgewählt

-- Exportiere Struktur von Tabelle opensimland.regions
CREATE TABLE IF NOT EXISTS `regions` (
  `RegionID` int(12) NOT NULL AUTO_INCREMENT,
  `GridID` int(12) NOT NULL,
  `RegionName` varchar(256) NOT NULL,
  `Online` tinyint(1) NOT NULL DEFAULT 0,
  `LastSeen` datetime NOT NULL,
  `RegionUUID` varchar(36) NOT NULL,
  `UserUUID` varchar(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
  `RegionImage` varchar(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
  `RegionHostname` varchar(128) NOT NULL,
  `RegionPort` int(8) NOT NULL DEFAULT 7000,
  PRIMARY KEY (`RegionID`),
  UNIQUE KEY `GridID_RegionName` (`GridID`,`RegionName`),
  KEY `GridID` (`GridID`),
  KEY `OnlineFlag` (`Online`) USING BTREE,
  KEY `LastSeen` (`LastSeen`),
  CONSTRAINT `FK_regions_grids` FOREIGN KEY (`GridID`) REFERENCES `grids` (`GridID`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=19751 DEFAULT CHARSET=utf8;

-- Daten Export vom Benutzer nicht ausgewählt

-- Exportiere Struktur von Tabelle opensimland.textures
CREATE TABLE IF NOT EXISTS `textures` (
  `TextureID` int(12) NOT NULL AUTO_INCREMENT,
  `ObjectID` int(12) NOT NULL,
  `TextureAssetUUID` varchar(36) NOT NULL,
  PRIMARY KEY (`TextureID`),
  UNIQUE KEY `ObjectID_TextureUUID` (`ObjectID`,`TextureAssetUUID`) USING BTREE,
  KEY `ObjectID` (`ObjectID`),
  CONSTRAINT `FK_textures_objects` FOREIGN KEY (`ObjectID`) REFERENCES `objects` (`ObjectID`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- Daten Export vom Benutzer nicht ausgewählt

-- Exportiere Struktur von Tabelle opensimland.users
CREATE TABLE IF NOT EXISTS `users` (
  `UserID` int(12) NOT NULL AUTO_INCREMENT,
  `GridID` int(12) NOT NULL,
  `UserUUID` varchar(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
  `UserName` varchar(128) NOT NULL,
  `UserMail` varchar(128) NOT NULL,
  PRIMARY KEY (`UserID`),
  UNIQUE KEY `GridID_UserUUID` (`GridID`,`UserUUID`),
  KEY `GridID` (`GridID`),
  CONSTRAINT `FK_users_grids` FOREIGN KEY (`GridID`) REFERENCES `grids` (`GridID`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=19734 DEFAULT CHARSET=utf8;

-- Daten Export vom Benutzer nicht ausgewählt

/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40111 SET SQL_NOTES=IFNULL(@OLD_SQL_NOTES, 1) */;
