aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/Resources
diff options
context:
space:
mode:
authorSean Dague2008-04-02 15:24:31 +0000
committerSean Dague2008-04-02 15:24:31 +0000
commitc52c68f314c67c76c7181a6d0828f476290fbd66 (patch)
tree66ab347502892902a096fa985f31b25738eb1381 /OpenSim/Data/MySQL/Resources
parentreorganizing namespaces to put all the Data stuff into it's own namespace (diff)
downloadopensim-SC_OLD-c52c68f314c67c76c7181a6d0828f476290fbd66.zip
opensim-SC_OLD-c52c68f314c67c76c7181a6d0828f476290fbd66.tar.gz
opensim-SC_OLD-c52c68f314c67c76c7181a6d0828f476290fbd66.tar.bz2
opensim-SC_OLD-c52c68f314c67c76c7181a6d0828f476290fbd66.tar.xz
whole lot more moving
Diffstat (limited to 'OpenSim/Data/MySQL/Resources')
-rw-r--r--OpenSim/Data/MySQL/Resources/AvatarAppearance.sql42
-rw-r--r--OpenSim/Data/MySQL/Resources/CreateAgentsTable.sql24
-rw-r--r--OpenSim/Data/MySQL/Resources/CreateAssetsTable.sql11
-rw-r--r--OpenSim/Data/MySQL/Resources/CreateFoldersTable.sql11
-rw-r--r--OpenSim/Data/MySQL/Resources/CreateItemsTable.sql18
-rw-r--r--OpenSim/Data/MySQL/Resources/CreateLogsTable.sql10
-rw-r--r--OpenSim/Data/MySQL/Resources/CreateRegionsTable.sql32
-rw-r--r--OpenSim/Data/MySQL/Resources/CreateUserFriendsTable.sql11
-rw-r--r--OpenSim/Data/MySQL/Resources/CreateUsersTable.sql35
-rw-r--r--OpenSim/Data/MySQL/Resources/UpgradeFoldersTableToVersion2.sql4
-rw-r--r--OpenSim/Data/MySQL/Resources/UpgradeItemsTableToVersion2.sql9
-rw-r--r--OpenSim/Data/MySQL/Resources/UpgradeRegionsTableToVersion2.sql4
-rw-r--r--OpenSim/Data/MySQL/Resources/UpgradeRegionsTableToVersion3.sql18
-rw-r--r--OpenSim/Data/MySQL/Resources/UpgradeUsersTableToVersion2.sql3
14 files changed, 232 insertions, 0 deletions
diff --git a/OpenSim/Data/MySQL/Resources/AvatarAppearance.sql b/OpenSim/Data/MySQL/Resources/AvatarAppearance.sql
new file mode 100644
index 0000000..b638ee2
--- /dev/null
+++ b/OpenSim/Data/MySQL/Resources/AvatarAppearance.sql
@@ -0,0 +1,42 @@
1--
2-- Create schema avatar_appearance
3--
4
5CREATE DATABASE IF NOT EXISTS avatar_appearance;
6USE avatar_appearance;
7
8DROP TABLE IF EXISTS `avatarappearance`;
9CREATE TABLE `avatarappearance` (
10 `UUID` char(36) NOT NULL,
11 `Serial` int(10) unsigned NOT NULL,
12 `WearableItem0` char(36) NOT NULL,
13 `WearableAsset0` char(36) NOT NULL,
14 `WearableItem1` char(36) NOT NULL,
15 `WearableAsset1` char(36) NOT NULL,
16 `WearableItem2` char(36) NOT NULL,
17 `WearableAsset2` char(36) NOT NULL,
18 `WearableItem3` char(36) NOT NULL,
19 `WearableAsset3` char(36) NOT NULL,
20 `WearableItem4` char(36) NOT NULL,
21 `WearableAsset4` char(36) NOT NULL,
22 `WearableItem5` char(36) NOT NULL,
23 `WearableAsset5` char(36) NOT NULL,
24 `WearableItem6` char(36) NOT NULL,
25 `WearableAsset6` char(36) NOT NULL,
26 `WearableItem7` char(36) NOT NULL,
27 `WearableAsset7` char(36) NOT NULL,
28 `WearableItem8` char(36) NOT NULL,
29 `WearableAsset8` char(36) NOT NULL,
30 `WearableItem9` char(36) NOT NULL,
31 `WearableAsset9` char(36) NOT NULL,
32 `WearableItem10` char(36) NOT NULL,
33 `WearableAsset10` char(36) NOT NULL,
34 `WearableItem11` char(36) NOT NULL,
35 `WearableAsset11` char(36) NOT NULL,
36 `WearableItem12` char(36) NOT NULL,
37 `WearableAsset12` char(36) NOT NULL,
38
39
40 PRIMARY KEY (`UUID`)
41) ENGINE=InnoDB DEFAULT CHARSET=utf8;
42
diff --git a/OpenSim/Data/MySQL/Resources/CreateAgentsTable.sql b/OpenSim/Data/MySQL/Resources/CreateAgentsTable.sql
new file mode 100644
index 0000000..3ef7bc9
--- /dev/null
+++ b/OpenSim/Data/MySQL/Resources/CreateAgentsTable.sql
@@ -0,0 +1,24 @@
1SET FOREIGN_KEY_CHECKS=0;
2-- ----------------------------
3-- Table structure for agents
4-- ----------------------------
5CREATE TABLE `agents` (
6 `UUID` varchar(36) NOT NULL,
7 `sessionID` varchar(36) NOT NULL,
8 `secureSessionID` varchar(36) NOT NULL,
9 `agentIP` varchar(16) NOT NULL,
10 `agentPort` int(11) NOT NULL,
11 `agentOnline` tinyint(4) NOT NULL,
12 `loginTime` int(11) NOT NULL,
13 `logoutTime` int(11) NOT NULL,
14 `currentRegion` varchar(36) NOT NULL,
15 `currentHandle` bigint(20) unsigned NOT NULL,
16 `currentPos` varchar(64) NOT NULL,
17 PRIMARY KEY (`UUID`),
18 UNIQUE KEY `session` (`sessionID`),
19 UNIQUE KEY `ssession` (`secureSessionID`)
20) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 1';
21
22-- ----------------------------
23-- Records
24-- ----------------------------
diff --git a/OpenSim/Data/MySQL/Resources/CreateAssetsTable.sql b/OpenSim/Data/MySQL/Resources/CreateAssetsTable.sql
new file mode 100644
index 0000000..2c750fe
--- /dev/null
+++ b/OpenSim/Data/MySQL/Resources/CreateAssetsTable.sql
@@ -0,0 +1,11 @@
1CREATE TABLE `assets` (
2 `id` binary(16) NOT NULL,
3 `name` varchar(64) NOT NULL,
4 `description` varchar(64) NOT NULL,
5 `assetType` tinyint(4) NOT NULL,
6 `invType` tinyint(4) NOT NULL,
7 `local` tinyint(1) NOT NULL,
8 `temporary` tinyint(1) NOT NULL,
9 `data` longblob NOT NULL,
10 PRIMARY KEY (`id`)
11) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 1'; \ No newline at end of file
diff --git a/OpenSim/Data/MySQL/Resources/CreateFoldersTable.sql b/OpenSim/Data/MySQL/Resources/CreateFoldersTable.sql
new file mode 100644
index 0000000..b5bddde
--- /dev/null
+++ b/OpenSim/Data/MySQL/Resources/CreateFoldersTable.sql
@@ -0,0 +1,11 @@
1CREATE TABLE `inventoryfolders` (
2 `folderID` varchar(36) NOT NULL default '',
3 `agentID` varchar(36) default NULL,
4 `parentFolderID` varchar(36) default NULL,
5 `folderName` varchar(64) default NULL,
6 `type` smallint NOT NULL default 0,
7 `version` int NOT NULL default 0,
8 PRIMARY KEY (`folderID`),
9 KEY `owner` (`agentID`),
10 KEY `parent` (`parentFolderID`)
11) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 2';
diff --git a/OpenSim/Data/MySQL/Resources/CreateItemsTable.sql b/OpenSim/Data/MySQL/Resources/CreateItemsTable.sql
new file mode 100644
index 0000000..1723ee3
--- /dev/null
+++ b/OpenSim/Data/MySQL/Resources/CreateItemsTable.sql
@@ -0,0 +1,18 @@
1CREATE TABLE `inventoryitems` (
2 `inventoryID` varchar(36) NOT NULL default '',
3 `assetID` varchar(36) default NULL,
4 `assetType` int(11) default NULL,
5 `parentFolderID` varchar(36) default NULL,
6 `avatarID` varchar(36) default NULL,
7 `inventoryName` varchar(64) default NULL,
8 `inventoryDescription` varchar(128) default NULL,
9 `inventoryNextPermissions` int(10) unsigned default NULL,
10 `inventoryCurrentPermissions` int(10) unsigned default NULL,
11 `invType` int(11) default NULL,
12 `creatorID` varchar(36) default NULL,
13 `inventoryBasePermissions` int(10) unsigned NOT NULL default 0,
14 `inventoryEveryOnePermissions` int(10) unsigned NOT NULL default 0,
15 PRIMARY KEY (`inventoryID`),
16 KEY `owner` (`avatarID`),
17 KEY `folder` (`parentFolderID`)
18) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 2';
diff --git a/OpenSim/Data/MySQL/Resources/CreateLogsTable.sql b/OpenSim/Data/MySQL/Resources/CreateLogsTable.sql
new file mode 100644
index 0000000..64b3a80
--- /dev/null
+++ b/OpenSim/Data/MySQL/Resources/CreateLogsTable.sql
@@ -0,0 +1,10 @@
1CREATE TABLE `logs` (
2 `logID` int(10) unsigned NOT NULL auto_increment,
3 `target` varchar(36) default NULL,
4 `server` varchar(64) default NULL,
5 `method` varchar(64) default NULL,
6 `arguments` varchar(255) default NULL,
7 `priority` int(11) default NULL,
8 `message` text,
9 PRIMARY KEY (`logID`)
10) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 1';
diff --git a/OpenSim/Data/MySQL/Resources/CreateRegionsTable.sql b/OpenSim/Data/MySQL/Resources/CreateRegionsTable.sql
new file mode 100644
index 0000000..cb0f9bd
--- /dev/null
+++ b/OpenSim/Data/MySQL/Resources/CreateRegionsTable.sql
@@ -0,0 +1,32 @@
1CREATE TABLE `regions` (
2 `uuid` varchar(36) NOT NULL,
3 `regionHandle` bigint(20) unsigned NOT NULL,
4 `regionName` varchar(32) default NULL,
5 `regionRecvKey` varchar(128) default NULL,
6 `regionSendKey` varchar(128) default NULL,
7 `regionSecret` varchar(128) default NULL,
8 `regionDataURI` varchar(255) default NULL,
9 `serverIP` varchar(64) default NULL,
10 `serverPort` int(10) unsigned default NULL,
11 `serverURI` varchar(255) default NULL,
12 `locX` int(10) unsigned default NULL,
13 `locY` int(10) unsigned default NULL,
14 `locZ` int(10) unsigned default NULL,
15 `eastOverrideHandle` bigint(20) unsigned default NULL,
16 `westOverrideHandle` bigint(20) unsigned default NULL,
17 `southOverrideHandle` bigint(20) unsigned default NULL,
18 `northOverrideHandle` bigint(20) unsigned default NULL,
19 `regionAssetURI` varchar(255) default NULL,
20 `regionAssetRecvKey` varchar(128) default NULL,
21 `regionAssetSendKey` varchar(128) default NULL,
22 `regionUserURI` varchar(255) default NULL,
23 `regionUserRecvKey` varchar(128) default NULL,
24 `regionUserSendKey` varchar(128) default NULL, `regionMapTexture` varchar(36) default NULL,
25 `serverHttpPort` int(10) default NULL, `serverRemotingPort` int(10) default NULL,
26 `owner_uuid` varchar(36) default '00000000-0000-0000-0000-000000000000' not null,
27 `originUUID` varchar(36),
28 PRIMARY KEY (`uuid`),
29 KEY `regionName` (`regionName`),
30 KEY `regionHandle` (`regionHandle`),
31 KEY `overrideHandles` (`eastOverrideHandle`,`westOverrideHandle`,`southOverrideHandle`,`northOverrideHandle`)
32) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Rev. 3';
diff --git a/OpenSim/Data/MySQL/Resources/CreateUserFriendsTable.sql b/OpenSim/Data/MySQL/Resources/CreateUserFriendsTable.sql
new file mode 100644
index 0000000..8480d48
--- /dev/null
+++ b/OpenSim/Data/MySQL/Resources/CreateUserFriendsTable.sql
@@ -0,0 +1,11 @@
1SET FOREIGN_KEY_CHECKS=0;
2-- ----------------------------
3-- Table structure for users
4-- ----------------------------
5CREATE TABLE `userfriends` (
6 `ownerID` VARCHAR(37) NOT NULL,
7 `friendID` VARCHAR(37) NOT NULL,
8 `friendPerms` INT NOT NULL,
9 `datetimestamp` INT NOT NULL,
10 UNIQUE KEY (`ownerID`, `friendID`)
11) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev.1'; \ No newline at end of file
diff --git a/OpenSim/Data/MySQL/Resources/CreateUsersTable.sql b/OpenSim/Data/MySQL/Resources/CreateUsersTable.sql
new file mode 100644
index 0000000..d9e8ae2
--- /dev/null
+++ b/OpenSim/Data/MySQL/Resources/CreateUsersTable.sql
@@ -0,0 +1,35 @@
1SET FOREIGN_KEY_CHECKS=0;
2-- ----------------------------
3-- Table structure for users
4-- ----------------------------
5CREATE TABLE `users` (
6 `UUID` varchar(36) NOT NULL default '',
7 `username` varchar(32) NOT NULL,
8 `lastname` varchar(32) NOT NULL,
9 `passwordHash` varchar(32) NOT NULL,
10 `passwordSalt` varchar(32) NOT NULL,
11 `homeRegion` bigint(20) unsigned default NULL,
12 `homeLocationX` float default NULL,
13 `homeLocationY` float default NULL,
14 `homeLocationZ` float default NULL,
15 `homeLookAtX` float default NULL,
16 `homeLookAtY` float default NULL,
17 `homeLookAtZ` float default NULL,
18 `created` int(11) NOT NULL,
19 `lastLogin` int(11) NOT NULL,
20 `userInventoryURI` varchar(255) default NULL,
21 `userAssetURI` varchar(255) default NULL,
22 `profileCanDoMask` int(10) unsigned default NULL,
23 `profileWantDoMask` int(10) unsigned default NULL,
24 `profileAboutText` text,
25 `profileFirstText` text,
26 `profileImage` varchar(36) default NULL,
27 `profileFirstImage` varchar(36) default NULL,
28 `webLoginKey` varchar(36) default NULL,
29 PRIMARY KEY (`UUID`),
30 UNIQUE KEY `usernames` (`username`,`lastname`)
31) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 2';
32
33-- ----------------------------
34-- Records
35-- ----------------------------
diff --git a/OpenSim/Data/MySQL/Resources/UpgradeFoldersTableToVersion2.sql b/OpenSim/Data/MySQL/Resources/UpgradeFoldersTableToVersion2.sql
new file mode 100644
index 0000000..b5a7964
--- /dev/null
+++ b/OpenSim/Data/MySQL/Resources/UpgradeFoldersTableToVersion2.sql
@@ -0,0 +1,4 @@
1ALTER TABLE `inventoryfolders`
2 ADD COLUMN `type` smallint NOT NULL default 0,
3 ADD COLUMN `version` int NOT NULL default 0,
4COMMENT='Rev. 2';
diff --git a/OpenSim/Data/MySQL/Resources/UpgradeItemsTableToVersion2.sql b/OpenSim/Data/MySQL/Resources/UpgradeItemsTableToVersion2.sql
new file mode 100644
index 0000000..d1ef504
--- /dev/null
+++ b/OpenSim/Data/MySQL/Resources/UpgradeItemsTableToVersion2.sql
@@ -0,0 +1,9 @@
1ALTER TABLE `inventoryitems`
2 CHANGE COLUMN `type` `assetType` int(11) default NULL,
3 ADD COLUMN `invType` int(11) default NULL,
4 ADD COLUMN `creatorID` varchar(36) default NULL,
5 ADD COLUMN `inventoryBasePermissions` int(10) unsigned NOT NULL default 0,
6 ADD COLUMN `inventoryEveryOnePermissions` int(10) unsigned NOT NULL default 0,
7COMMENT='Rev. 2';
8
9UPDATE `inventoryitems` SET invType=assetType;
diff --git a/OpenSim/Data/MySQL/Resources/UpgradeRegionsTableToVersion2.sql b/OpenSim/Data/MySQL/Resources/UpgradeRegionsTableToVersion2.sql
new file mode 100644
index 0000000..034b755
--- /dev/null
+++ b/OpenSim/Data/MySQL/Resources/UpgradeRegionsTableToVersion2.sql
@@ -0,0 +1,4 @@
1ALTER TABLE `regions`
2 ADD COLUMN `originUUID` varchar(36),
3COMMENT='Rev. 2';
4UPDATE `regions` SET originUUID=uuid;
diff --git a/OpenSim/Data/MySQL/Resources/UpgradeRegionsTableToVersion3.sql b/OpenSim/Data/MySQL/Resources/UpgradeRegionsTableToVersion3.sql
new file mode 100644
index 0000000..b48afec
--- /dev/null
+++ b/OpenSim/Data/MySQL/Resources/UpgradeRegionsTableToVersion3.sql
@@ -0,0 +1,18 @@
1DROP PROCEDURE IF EXISTS upgraderegions3;
2
3create procedure upgraderegions3()
4BEGIN
5DECLARE db_name varchar(64);
6select database() into db_name;
7IF ((select count(*) from information_schema.columns where table_name='regions' and column_name='owner_uuid' and table_schema=db_name) > 0)
8THEN
9 ALTER TABLE `regions`, COMMENT='Rev. 3';
10ELSE
11 ALTER TABLE `regions`
12 ADD COLUMN `owner_uuid` varchar(36) default '00000000-0000-0000-0000-000000000000' not null after serverRemotingPort, COMMENT='Rev. 3';
13END IF;
14END;
15
16call upgraderegions3();
17
18
diff --git a/OpenSim/Data/MySQL/Resources/UpgradeUsersTableToVersion2.sql b/OpenSim/Data/MySQL/Resources/UpgradeUsersTableToVersion2.sql
new file mode 100644
index 0000000..dd21a66
--- /dev/null
+++ b/OpenSim/Data/MySQL/Resources/UpgradeUsersTableToVersion2.sql
@@ -0,0 +1,3 @@
1ALTER TABLE `users`
2 ADD COLUMN `webLoginKey` varchar(36) default '00000000-0000-0000-0000-000000000000' NOT NULL,
3COMMENT='Rev. 2'; \ No newline at end of file