From c00c855cc5decf73d598af5d74a2ef57c547efd3 Mon Sep 17 00:00:00 2001
From: Charles Krinke
Date: Mon, 12 Jan 2009 20:14:39 +0000
Subject: Thank you kindly, Tlaukkan (Tommil) for a patch that: Cleaned up
 schema creation scripts of MySQL to compliant form and created SQLite scripts
 from them. In future it would be optimal if scripts from different databases
 could be generated from MySQL scripts to ensure optimal consistency between
 schemas of different databases. Did not yet review column names. ID columns
 seem to have variety in naming which can be confusing.

---
 .../Resources/SQLiteDialect/001_GridStore.sql      | 69 +++++++++++-----------
 1 file changed, 33 insertions(+), 36 deletions(-)

(limited to 'OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_GridStore.sql')

diff --git a/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_GridStore.sql b/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_GridStore.sql
index 1cb18e3..336a277 100644
--- a/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_GridStore.sql
+++ b/OpenSim/Data/NHibernate/Resources/SQLiteDialect/001_GridStore.sql
@@ -1,38 +1,35 @@
-BEGIN TRANSACTION;
-
-create table Regions (
-  Uuid NVARCHAR(255) not null,
-   RegionHandle BIGINT null,
-   RegionName NVARCHAR(32) null,
-   RegionRecvKey NVARCHAR(128) null,
-   RegionSendKey NVARCHAR(128) null,
-   RegionSecret NVARCHAR(128) null,
-   RegionDataURI NVARCHAR(255) null,
-   ServerIP NVARCHAR(64) null,
-   ServerPort INT null,
-   ServerURI NVARCHAR(255) null,
-   RegionLocX INT null,
-   RegionLocY INT null,
-   RegionLocZ INT null,
-   EastOverrideHandle BIGINT null,
-   WestOverrideHandle BIGINT null,
-   SouthOverrideHandle BIGINT null,
-   NorthOverrideHandle BIGINT null,
-   RegionAssetURI NVARCHAR(255) null,
-   RegionAssetRecvKey NVARCHAR(128) null,
-   RegionAssetSendKey NVARCHAR(128) null,
-   RegionUserURI NVARCHAR(255) null,
-   RegionUserRecvKey NVARCHAR(128) null,
-   RegionUserSendKey NVARCHAR(128) null,
-   ServerHttpPort INT null,
-   ServerRemotingPort INT null,
-   RegionMapTextureID NVARCHAR(255) null,
-   Owner_uuid NVARCHAR(255) null,
-   OriginUUID NVARCHAR(255) null,
-   primary key (Uuid)
+CREATE TABLE Regions (
+  RegionId VARCHAR(36) NOT NULL,
+  RegionHandle BIGINT UNSIGNED NOT NULL,
+  RegionName VARCHAR(32) DEFAULT NULL,
+  RegionRecvKey VARCHAR(128) DEFAULT NULL,
+  RegionSendKey VARCHAR(128) DEFAULT NULL,
+  RegionSecret VARCHAR(128) DEFAULT NULL,
+  RegionDataURI VARCHAR(255) DEFAULT NULL,
+  ServerIP VARCHAR(64) DEFAULT NULL,
+  ServerPort INT UNSIGNED DEFAULT NULL,
+  ServerURI VARCHAR(255) DEFAULT NULL,
+  RegionLocX INT UNSIGNED DEFAULT NULL,
+  RegionLocY INT UNSIGNED DEFAULT NULL,
+  RegionLocZ INT UNSIGNED DEFAULT NULL,
+  EastOverrideHandle BIGINT UNSIGNED DEFAULT NULL,
+  WestOverrideHandle BIGINT UNSIGNED DEFAULT NULL,
+  SouthOverrideHandle BIGINT UNSIGNED DEFAULT NULL,
+  NorthOverrideHandle BIGINT UNSIGNED DEFAULT NULL,
+  RegionAssetURI VARCHAR(255) DEFAULT NULL,
+  RegionAssetRecvKey VARCHAR(128) DEFAULT NULL,
+  RegionAssetSendKey VARCHAR(128) DEFAULT NULL,
+  RegionUserURI VARCHAR(255) DEFAULT NULL,
+  RegionUserRecvKey VARCHAR(128) DEFAULT NULL,
+  RegionUserSendKey VARCHAR(128) DEFAULT NULL, 
+  regionMapTexture VARCHAR(36) DEFAULT NULL,
+  ServerHttpPort INT DEFAULT NULL, 
+  ServerRemotingPort INT DEFAULT NULL,
+  OwnerID VARCHAR(36) DEFAULT NULL,
+  OriginID VARCHAR(36) DEFAULT NULL,
+  PRIMARY KEY  (uuid),
 );
 
-create index region_handle on Regions (RegionHandle);
-create index region_name on Regions (RegionName);
-
-COMMIT;
\ No newline at end of file
+CREATE INDEX RegionNameIndex ON Regions (RegionName);
+CREATE INDEX RegionHandleIndex ON Regions (RegionHandle);
+CREATE INDEX RegionHandlesIndex ON Regions (EastOverrideHandle,WestOverrideHandle,SouthOverrideHandle,NorthOverrideHandle);
-- 
cgit v1.1

