CREATE TABLE `prims` (
  `UUID` varchar(255) NOT NULL,
  `RegionUUID` varchar(255) default NULL,
  `ParentID` int(11) default NULL,
  `CreationDate` int(11) default NULL,
  `Name` varchar(255) default NULL,
  `SceneGroupID` varchar(255) default NULL,
  `Text` varchar(255) default NULL,
  `Description` varchar(255) default NULL,
  `SitName` varchar(255) default NULL,
  `TouchName` varchar(255) default NULL,
  `ObjectFlags` int(11) default NULL,
  `CreatorID` varchar(255) default NULL,
  `OwnerID` varchar(255) default NULL,
  `GroupID` varchar(255) default NULL,
  `LastOwnerID` varchar(255) default NULL,
  `OwnerMask` int(11) default NULL,
  `NextOwnerMask` int(11) default NULL,
  `GroupMask` int(11) default NULL,
  `EveryoneMask` int(11) default NULL,
  `BaseMask` int(11) default NULL,
  `PositionX` float default NULL,
  `PositionY` float default NULL,
  `PositionZ` float default NULL,
  `GroupPositionX` float default NULL,
  `GroupPositionY` float default NULL,
  `GroupPositionZ` float default NULL,
  `VelocityX` float default NULL,
  `VelocityY` float default NULL,
  `VelocityZ` float default NULL,
  `AngularVelocityX` float default NULL,
  `AngularVelocityY` float default NULL,
  `AngularVelocityZ` float default NULL,
  `AccelerationX` float default NULL,
  `AccelerationY` float default NULL,
  `AccelerationZ` float default NULL,
  `RotationX` float default NULL,
  `RotationY` float default NULL,
  `RotationZ` float default NULL,
  `RotationW` float default NULL,
  `SitTargetOffsetX` float default NULL,
  `SitTargetOffsetY` float default NULL,
  `SitTargetOffsetZ` float default NULL,
  `SitTargetOrientW` float default NULL,
  `SitTargetOrientX` float default NULL,
  `SitTargetOrientY` float default NULL,
  `SitTargetOrientZ` float default NULL,
  PRIMARY KEY  (`UUID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1

CREATE TABLE `primshapes` (
  `UUID` varchar(255) NOT NULL,
  `Shape` int(11) default NULL,
  `ScaleX` float default NULL,
  `ScaleY` float default NULL,
  `ScaleZ` float default NULL,
  `PCode` int(11) default NULL,
  `PathBegin` int(11) default NULL,
  `PathEnd` int(11) default NULL,
  `PathScaleX` int(11) default NULL,
  `PathScaleY` int(11) default NULL,
  `PathShearX` int(11) default NULL,
  `PathShearY` int(11) default NULL,
  `PathSkew` int(11) default NULL,
  `PathCurve` int(11) default NULL,
  `PathRadiusOffset` int(11) default NULL,
  `PathRevolutions` int(11) default NULL,
  `PathTaperX` int(11) default NULL,
  `PathTaperY` int(11) default NULL,
  `PathTwist` int(11) default NULL,
  `PathTwistBegin` int(11) default NULL,
  `ProfileBegin` int(11) default NULL,
  `ProfileEnd` int(11) default NULL,
  `ProfileCurve` int(11) default NULL,
  `ProfileHollow` int(11) default NULL,
  `State` int(11) default NULL,
  `Texture` longblob,
  `ExtraParams` longblob,
  PRIMARY KEY  (`UUID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1

CREATE TABLE `primitems` (
  `itemID` varchar(255) NOT NULL,
  `primID` varchar(255) default NULL,
  `assetID` varchar(255) default NULL,
  `parentFolderID` varchar(255) default NULL,
  `invType` int(11) default NULL,
  `assetType` int(11) default NULL,
  `name` varchar(255) default NULL,
  `description` varchar(255) default NULL,
  `creationDate` bigint(20) default NULL,
  `creatorID` varchar(255) default NULL,
  `ownerID` varchar(255) default NULL,
  `lastOwnerID` varchar(255) default NULL,
  `groupID` varchar(255) default NULL,
  `nextPermissions` int(11) default NULL,
  `currentPermissions` int(11) default NULL,
  `basePermissions` int(11) default NULL,
  `everyonePermissions` int(11) default NULL,
  `groupPermissions` int(11) default NULL,
  PRIMARY KEY  (`itemID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1

CREATE TABLE `terrain` (
  `RegionUUID` varchar(255) default NULL,
  `Revision` int(11) default NULL,
  `Heightfield` longblob
) ENGINE=MyISAM DEFAULT CHARSET=latin1

CREATE TABLE `land` (
  `UUID` varchar(255) NOT NULL,
  `RegionUUID` varchar(255) default NULL,
  `LocalLandID` int(11) default NULL,
  `Bitmap` longblob,
  `Name` varchar(255) default NULL,
  `Description` varchar(255) default NULL,
  `OwnerUUID` varchar(255) default NULL,
  `IsGroupOwned` int(11) default NULL,
  `Area` int(11) default NULL,
  `AuctionID` int(11) default NULL,
  `Category` int(11) default NULL,
  `ClaimDate` int(11) default NULL,
  `ClaimPrice` int(11) default NULL,
  `GroupUUID` varchar(255) default NULL,
  `SalePrice` int(11) default NULL,
  `LandStatus` int(11) default NULL,
  `LandFlags` int(11) default NULL,
  `LandingType` int(11) default NULL,
  `MediaAutoScale` int(11) default NULL,
  `MediaTextureUUID` varchar(255) default NULL,
  `MediaURL` varchar(255) default NULL,
  `MusicURL` varchar(255) default NULL,
  `PassHours` float default NULL,
  `PassPrice` int(11) default NULL,
  `SnapshotUUID` varchar(255) default NULL,
  `UserLocationX` float default NULL,
  `UserLocationY` float default NULL,
  `UserLocationZ` float default NULL,
  `UserLookAtX` float default NULL,
  `UserLookAtY` float default NULL,
  `UserLookAtZ` float default NULL,
  `AuthbuyerID` varchar(36) NOT NULL default '00000000-0000-0000-0000-000000000000',
  PRIMARY KEY  (`UUID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 2'

CREATE TABLE `landaccesslist` (
  `LandUUID` varchar(255) default NULL,
  `AccessUUID` varchar(255) default NULL,
  `Flags` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1