BEGIN TRANSACTION;

create table Prims (
  UUID TEXT not null,
   ParentID INTEGER,
   ParentUUID TEXT,
   RegionID TEXT,
   CreationDate INTEGER,
   Name TEXT,
   Text TEXT,
   Description TEXT,
   SitName TEXT,
   TouchName TEXT,
   ObjectFlags INTEGER,
   CreatorID TEXT,
   OwnerID TEXT,
   GroupID TEXT,
   LastOwnerID TEXT,
   OwnerMask INTEGER,
   NextOwnerMask INTEGER,
   GroupMask INTEGER,
   EveryoneMask INTEGER,
   BaseMask INTEGER,
   PositionX NUMERIC,
   PositionY NUMERIC,
   PositionZ NUMERIC,
   GroupPositionX NUMERIC,
   GroupPositionY NUMERIC,
   GroupPositionZ NUMERIC,
   VelocityX NUMERIC,
   VelocityY NUMERIC,
   VelocityZ NUMERIC,
   AngularVelocityX NUMERIC,
   AngularVelocityY NUMERIC,
   AngularVelocityZ NUMERIC,
   AccelerationX NUMERIC,
   AccelerationY NUMERIC,
   AccelerationZ NUMERIC,
   SitTargetOffsetX NUMERIC,
   SitTargetOffsetY NUMERIC,
   SitTargetOffsetZ NUMERIC,
   RotationX NUMERIC,
   RotationY NUMERIC,
   RotationZ NUMERIC,
   RotationW NUMERIC,
   SitTargetOrientX NUMERIC,
   SitTargetOrientY NUMERIC,
   SitTargetOrientZ NUMERIC,
   SitTargetOrientW NUMERIC,
   ScaleX NUMERIC,
   ScaleY NUMERIC,
   ScaleZ NUMERIC,
   PCode INTEGER,
   PathBegin INTEGER,
   PathEnd INTEGER,
   PathScaleX INTEGER,
   PathScaleY INTEGER,
   PathShearX INTEGER,
   PathShearY INTEGER,
   PathSkew INTEGER,
   PathCurve INTEGER,
   PathRadiusOffset INTEGER,
   PathRevolutions INTEGER,
   PathTaperX INTEGER,
   PathTwist INTEGER,
   ProfileBegin INTEGER,
   ProfileEnd INTEGER,
   ProfileCurve INTEGER,
   ProfileHollow INTEGER,
   Texture BLOB,
   ExtraParams BLOB,
   State INTEGER,
   primary key (UUID)
);
create table Terrain (
  RegionID TEXT not null,
   MapData BLOB,
   primary key (RegionID)
);
create table PrimItems (
  ItemID TEXT not null,
   PrimID TEXT,
   AssetID TEXT,
   ParentFolderID TEXT,
   CreatorID TEXT,
   OwnerID TEXT,
   GroupID TEXT,
   LastOwnerID TEXT,
   CurrentPermissions INTEGER,
   BasePermissions INTEGER,
   EveryonePermissions INTEGER,
   GroupPermissions INTEGER,
   NextPermissions INTEGER,
   Name TEXT,
   Description TEXT,
   CreationDate INTEGER,
   Flags INTEGER,
   InvType INTEGER,
   primary key (ItemID)
);

COMMIT;