Flatten migrations for MySQL.

Conflicts:
	OpenSim/Data/MySQL/Resources/RegionStore.migrations
	OpenSim/Data/MySQL/Resources/UserAccount.migrations
LSLKeyTest
Diva Canto 2016-02-20 19:08:02 -08:00
parent 367b7d7e5e
commit 134e94a7e9
13 changed files with 429 additions and 1511 deletions

View File

@ -1,81 +1,21 @@
# ----------------- # -----------------
:VERSION 1 :VERSION 10
BEGIN; BEGIN;
CREATE TABLE `assets` ( CREATE TABLE IF NOT EXISTS `assets` (
`id` binary(16) NOT NULL,
`name` varchar(64) NOT NULL, `name` varchar(64) NOT NULL,
`description` varchar(64) NOT NULL, `description` varchar(64) NOT NULL,
`assetType` tinyint(4) NOT NULL, `assetType` tinyint(4) NOT NULL,
`invType` tinyint(4) NOT NULL,
`local` tinyint(1) NOT NULL, `local` tinyint(1) NOT NULL,
`temporary` tinyint(1) NOT NULL, `temporary` tinyint(1) NOT NULL,
`data` longblob NOT NULL, `data` longblob NOT NULL,
`id` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
`create_time` int(11) DEFAULT '0',
`access_time` int(11) DEFAULT '0',
`asset_flags` int(11) NOT NULL DEFAULT '0',
`CreatorID` varchar(128) NOT NULL DEFAULT '',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 1'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
COMMIT; COMMIT;
# -----------------
:VERSION 2
BEGIN;
ALTER TABLE assets change id oldid binary(16);
ALTER TABLE assets add id varchar(36) not null default '';
UPDATE assets set id = concat(substr(hex(oldid),1,8),"-",substr(hex(oldid),9,4),"-",substr(hex(oldid),13,4),"-",substr(hex(oldid),17,4),"-",substr(hex(oldid),21,12));
ALTER TABLE assets drop oldid;
ALTER TABLE assets add constraint primary key(id);
COMMIT;
# -----------------
:VERSION 3
BEGIN;
ALTER TABLE assets change id oldid varchar(36);
ALTER TABLE assets add id char(36) not null default '00000000-0000-0000-0000-000000000000';
UPDATE assets set id = oldid;
ALTER TABLE assets drop oldid;
ALTER TABLE assets add constraint primary key(id);
COMMIT;
# -----------------
:VERSION 4
BEGIN;
ALTER TABLE assets drop InvType;
COMMIT;
# -----------------
:VERSION 5
BEGIN;
ALTER TABLE assets add create_time integer default 0;
ALTER TABLE assets add access_time integer default 0;
COMMIT;
# -----------------
:VERSION 6
DELETE FROM assets WHERE id = 'dc4b9f0b-d008-45c6-96a4-01dd947ac621'
:VERSION 7
ALTER TABLE assets ADD COLUMN asset_flags INTEGER NOT NULL DEFAULT 0;
:VERSION 8
ALTER TABLE assets ADD COLUMN CreatorID varchar(128) NOT NULL DEFAULT '';
:VERSION 9
BEGIN;
COMMIT;

View File

@ -1,16 +1,17 @@
:VERSION 1 # ------------------------------- :VERSION 4 # -------------------------------
begin; begin;
CREATE TABLE `auth` ( CREATE TABLE IF NOT EXISTS `auth` (
`UUID` char(36) NOT NULL, `UUID` char(36) NOT NULL,
`passwordHash` char(32) NOT NULL default '', `passwordHash` char(32) NOT NULL DEFAULT '',
`passwordSalt` char(32) NOT NULL default '', `passwordSalt` char(32) NOT NULL DEFAULT '',
`webLoginKey` varchar(255) NOT NULL default '', `webLoginKey` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`UUID`) `accountType` varchar(32) NOT NULL DEFAULT 'UserAccount',
) ENGINE=InnoDB; PRIMARY KEY (`UUID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `tokens` ( CREATE TABLE IF NOT EXISTS `tokens` (
`UUID` char(36) NOT NULL, `UUID` char(36) NOT NULL,
`token` varchar(255) NOT NULL, `token` varchar(255) NOT NULL,
`validity` datetime NOT NULL, `validity` datetime NOT NULL,
@ -18,22 +19,6 @@ CREATE TABLE `tokens` (
KEY `UUID` (`UUID`), KEY `UUID` (`UUID`),
KEY `token` (`token`), KEY `token` (`token`),
KEY `validity` (`validity`) KEY `validity` (`validity`)
) ENGINE=InnoDB; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
commit;
:VERSION 2 # -------------------------------
BEGIN;
INSERT INTO auth (UUID, passwordHash, passwordSalt, webLoginKey) SELECT `UUID` AS UUID, `passwordHash` AS passwordHash, `passwordSalt` AS passwordSalt, `webLoginKey` AS webLoginKey FROM users;
COMMIT;
:VERSION 3 # -------------------------------
BEGIN;
ALTER TABLE `auth` ADD COLUMN `accountType` VARCHAR(32) NOT NULL DEFAULT 'UserAccount';
COMMIT; COMMIT;

View File

@ -1,20 +1,13 @@
:VERSION 1 :VERSION 3
BEGIN; BEGIN;
CREATE TABLE Avatars ( CREATE TABLE IF NOT EXISTS `avatars` (
PrincipalID CHAR(36) NOT NULL, `PrincipalID` char(36) NOT NULL,
Name VARCHAR(32) NOT NULL, `Name` varchar(32) NOT NULL,
Value VARCHAR(255) NOT NULL DEFAULT '', `Value` text,
PRIMARY KEY(PrincipalID, Name), PRIMARY KEY (`PrincipalID`,`Name`),
KEY(PrincipalID)); KEY `PrincipalID` (`PrincipalID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
COMMIT;
:VERSION 2
BEGIN;
alter table Avatars change column Value Value text;
COMMIT; COMMIT;

View File

@ -1,41 +1,29 @@
:VERSION 13 :VERSION 34
# The estate migrations used to be in Region store
# here they will do nothing (bad) if the tables are already there,
# just update the store version.
BEGIN; BEGIN;
CREATE TABLE IF NOT EXISTS `estate_managers` (
`EstateID` int(10) unsigned NOT NULL,
`uuid` char(36) NOT NULL,
KEY `EstateID` (`EstateID`)
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS `estate_groups` ( CREATE TABLE IF NOT EXISTS `estate_groups` (
`EstateID` int(10) unsigned NOT NULL, `EstateID` int(10) unsigned NOT NULL,
`uuid` char(36) NOT NULL, `uuid` char(36) NOT NULL,
KEY `EstateID` (`EstateID`) KEY `EstateID` (`EstateID`)
) ENGINE=InnoDB; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `estate_users` ( CREATE TABLE IF NOT EXISTS `estate_managers` (
`EstateID` int(10) unsigned NOT NULL, `EstateID` int(10) unsigned NOT NULL,
`uuid` char(36) NOT NULL, `uuid` char(36) NOT NULL,
KEY `EstateID` (`EstateID`) KEY `EstateID` (`EstateID`)
) ENGINE=InnoDB; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `estateban` ( CREATE TABLE IF NOT EXISTS `estate_map` (
`EstateID` int(10) unsigned NOT NULL, `RegionID` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
`bannedUUID` varchar(36) NOT NULL, `EstateID` int(11) NOT NULL,
`bannedIp` varchar(16) NOT NULL, PRIMARY KEY (`RegionID`),
`bannedIpHostMask` varchar(16) NOT NULL, KEY `EstateID` (`EstateID`)
`bannedNameMask` varchar(64) default NULL, ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
KEY `estateban_EstateID` (`EstateID`)
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS `estate_settings` ( CREATE TABLE IF NOT EXISTS `estate_settings` (
`EstateID` int(10) unsigned NOT NULL auto_increment, `EstateID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`EstateName` varchar(64) default NULL, `EstateName` varchar(64) DEFAULT NULL,
`AbuseEmailToEstateOwner` tinyint(4) NOT NULL, `AbuseEmailToEstateOwner` tinyint(4) NOT NULL,
`DenyAnonymous` tinyint(4) NOT NULL, `DenyAnonymous` tinyint(4) NOT NULL,
`ResetHomeOnTeleport` tinyint(4) NOT NULL, `ResetHomeOnTeleport` tinyint(4) NOT NULL,
@ -55,33 +43,29 @@ CREATE TABLE IF NOT EXISTS `estate_settings` (
`EstateSkipScripts` tinyint(4) NOT NULL, `EstateSkipScripts` tinyint(4) NOT NULL,
`BillableFactor` float NOT NULL, `BillableFactor` float NOT NULL,
`PublicAccess` tinyint(4) NOT NULL, `PublicAccess` tinyint(4) NOT NULL,
`AbuseEmail` varchar(255) not null, `AbuseEmail` varchar(255) NOT NULL,
`EstateOwner` varchar(36) not null, `EstateOwner` varchar(36) NOT NULL,
`DenyMinors` tinyint not null, `DenyMinors` tinyint(4) NOT NULL,
`AllowLandmark` tinyint(4) NOT NULL DEFAULT '1',
`AllowParcelChanges` tinyint(4) NOT NULL DEFAULT '1',
`AllowSetHome` tinyint(4) NOT NULL DEFAULT '1',
PRIMARY KEY (`EstateID`)
) ENGINE=InnoDB AUTO_INCREMENT=101 DEFAULT CHARSET=utf8;
PRIMARY KEY (`EstateID`) CREATE TABLE IF NOT EXISTS `estate_users` (
) ENGINE=InnoDB AUTO_INCREMENT=100; `EstateID` int(10) unsigned NOT NULL,
`uuid` char(36) NOT NULL,
CREATE TABLE IF NOT EXISTS `estate_map` (
`RegionID` char(36) NOT NULL default '00000000-0000-0000-0000-000000000000',
`EstateID` int(11) NOT NULL,
PRIMARY KEY (`RegionID`),
KEY `EstateID` (`EstateID`) KEY `EstateID` (`EstateID`)
) ENGINE=InnoDB; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `estateban` (
`EstateID` int(10) unsigned NOT NULL,
`bannedUUID` varchar(36) NOT NULL,
`bannedIp` varchar(16) NOT NULL,
`bannedIpHostMask` varchar(16) NOT NULL,
`bannedNameMask` varchar(64) DEFAULT NULL,
KEY `estateban_EstateID` (`EstateID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
COMMIT; COMMIT;
:VERSION 32 #--------------------- (moved from RegionStore migr, just in case)
BEGIN;
ALTER TABLE estate_settings AUTO_INCREMENT = 100;
COMMIT;
:VERSION 33 #---------------------
BEGIN;
ALTER TABLE estate_settings ADD COLUMN `AllowLandmark` tinyint(4) NOT NULL default '1';
ALTER TABLE estate_settings ADD COLUMN `AllowParcelChanges` tinyint(4) NOT NULL default '1';
ALTER TABLE estate_settings ADD COLUMN `AllowSetHome` tinyint(4) NOT NULL default '1';
COMMIT;

View File

@ -1,32 +1,14 @@
:VERSION 1 # ------------------------- :VERSION 4 # -------------------------
BEGIN; BEGIN;
CREATE TABLE `Friends` ( CREATE TABLE IF NOT EXISTS `friends` (
`PrincipalID` CHAR(36) NOT NULL, `PrincipalID` varchar(255) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
`Friend` VARCHAR(255) NOT NULL, `Friend` varchar(255) NOT NULL,
`Flags` VARCHAR(16) NOT NULL DEFAULT 0, `Flags` varchar(16) NOT NULL DEFAULT '0',
`Offered` VARCHAR(32) NOT NULL DEFAULT 0, `Offered` varchar(32) NOT NULL DEFAULT '0',
PRIMARY KEY(`PrincipalID`, `Friend`), PRIMARY KEY (`PrincipalID`(36),`Friend`(36)),
KEY(`PrincipalID`) KEY `PrincipalID` (`PrincipalID`)
) ENGINE=InnoDB; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
COMMIT;
:VERSION 2 # -------------------------
BEGIN;
INSERT INTO `Friends` SELECT `ownerID`, `friendID`, `friendPerms`, 0 FROM `userfriends`;
COMMIT;
:VERSION 3 # -------------------------
BEGIN;
ALTER TABLE `Friends` MODIFY COLUMN PrincipalID varchar(255) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
ALTER TABLE `Friends` DROP PRIMARY KEY;
ALTER TABLE `Friends` ADD PRIMARY KEY(PrincipalID(36), Friend(36));
COMMIT; COMMIT;

View File

@ -1,109 +1,52 @@
:VERSION 1 :VERSION 10
BEGIN; BEGIN;
CREATE TABLE `regions` ( CREATE TABLE IF NOT EXISTS `regions` (
`uuid` varchar(36) NOT NULL, `uuid` varchar(36) NOT NULL,
`regionHandle` bigint(20) unsigned NOT NULL, `regionHandle` bigint(20) unsigned NOT NULL,
`regionName` varchar(32) default NULL, `regionName` varchar(128) DEFAULT NULL,
`regionRecvKey` varchar(128) default NULL, `regionRecvKey` varchar(128) DEFAULT NULL,
`regionSendKey` varchar(128) default NULL, `regionSendKey` varchar(128) DEFAULT NULL,
`regionSecret` varchar(128) default NULL, `regionSecret` varchar(128) DEFAULT NULL,
`regionDataURI` varchar(255) default NULL, `regionDataURI` varchar(255) DEFAULT NULL,
`serverIP` varchar(64) default NULL, `serverIP` varchar(64) DEFAULT NULL,
`serverPort` int(10) unsigned default NULL, `serverPort` int(10) unsigned DEFAULT NULL,
`serverURI` varchar(255) default NULL, `serverURI` varchar(255) DEFAULT NULL,
`locX` int(10) unsigned default NULL, `locX` int(10) unsigned DEFAULT NULL,
`locY` int(10) unsigned default NULL, `locY` int(10) unsigned DEFAULT NULL,
`locZ` int(10) unsigned default NULL, `locZ` int(10) unsigned DEFAULT NULL,
`eastOverrideHandle` bigint(20) unsigned default NULL, `eastOverrideHandle` bigint(20) unsigned DEFAULT NULL,
`westOverrideHandle` bigint(20) unsigned default NULL, `westOverrideHandle` bigint(20) unsigned DEFAULT NULL,
`southOverrideHandle` bigint(20) unsigned default NULL, `southOverrideHandle` bigint(20) unsigned DEFAULT NULL,
`northOverrideHandle` bigint(20) unsigned default NULL, `northOverrideHandle` bigint(20) unsigned DEFAULT NULL,
`regionAssetURI` varchar(255) default NULL, `regionAssetURI` varchar(255) DEFAULT NULL,
`regionAssetRecvKey` varchar(128) default NULL, `regionAssetRecvKey` varchar(128) DEFAULT NULL,
`regionAssetSendKey` varchar(128) default NULL, `regionAssetSendKey` varchar(128) DEFAULT NULL,
`regionUserURI` varchar(255) default NULL, `regionUserURI` varchar(255) DEFAULT NULL,
`regionUserRecvKey` varchar(128) default NULL, `regionUserRecvKey` varchar(128) DEFAULT NULL,
`regionUserSendKey` varchar(128) default NULL, `regionMapTexture` varchar(36) default NULL, `regionUserSendKey` varchar(128) DEFAULT NULL,
`serverHttpPort` int(10) default NULL, `serverRemotingPort` int(10) default NULL, `regionMapTexture` varchar(36) DEFAULT NULL,
`owner_uuid` varchar(36) default '00000000-0000-0000-0000-000000000000' not null, `serverHttpPort` int(10) DEFAULT NULL,
`originUUID` varchar(36), `serverRemotingPort` int(10) DEFAULT NULL,
PRIMARY KEY (`uuid`), `owner_uuid` varchar(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
`originUUID` varchar(36) DEFAULT NULL,
`access` int(10) unsigned DEFAULT '1',
`ScopeID` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
`sizeX` int(11) NOT NULL DEFAULT '0',
`sizeY` int(11) NOT NULL DEFAULT '0',
`flags` int(11) NOT NULL DEFAULT '0',
`last_seen` int(11) NOT NULL DEFAULT '0',
`PrincipalID` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
`Token` varchar(255) NOT NULL,
`parcelMapTexture` varchar(36) DEFAULT NULL,
PRIMARY KEY (`uuid`),
KEY `regionName` (`regionName`), KEY `regionName` (`regionName`),
KEY `regionHandle` (`regionHandle`), KEY `regionHandle` (`regionHandle`),
KEY `overrideHandles` (`eastOverrideHandle`,`westOverrideHandle`,`southOverrideHandle`,`northOverrideHandle`) KEY `overrideHandles` (`eastOverrideHandle`,`westOverrideHandle`,`southOverrideHandle`,`northOverrideHandle`),
KEY `ScopeID` (`ScopeID`),
KEY `flags` (`flags`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
COMMIT; COMMIT;
:VERSION 2
BEGIN;
ALTER TABLE regions add column access integer unsigned default 1;
COMMIT;
:VERSION 3
BEGIN;
ALTER TABLE regions add column ScopeID char(36) not null default '00000000-0000-0000-0000-000000000000';
create index ScopeID on regions(ScopeID);
COMMIT;
:VERSION 4
BEGIN;
ALTER TABLE regions add column sizeX integer not null default 0;
ALTER TABLE regions add column sizeY integer not null default 0;
COMMIT;
:VERSION 5
BEGIN;
ALTER TABLE `regions` ADD COLUMN `flags` integer NOT NULL DEFAULT 0;
CREATE INDEX flags ON regions(flags);
COMMIT;
:VERSION 6
BEGIN;
ALTER TABLE `regions` ADD COLUMN `last_seen` integer NOT NULL DEFAULT 0;
COMMIT;
:VERSION 7
BEGIN;
ALTER TABLE `regions` ADD COLUMN `PrincipalID` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
ALTER TABLE `regions` ADD COLUMN `Token` varchar(255) NOT NULL;
COMMIT;
:VERSION 8 # ------------
BEGIN;
alter table regions modify column regionName varchar(128) default NULL;
COMMIT;
:VERSION 9 # ------------
BEGIN;
alter table regions add column `parcelMapTexture` varchar(36) default NULL;
COMMIT;

View File

@ -1,42 +1,16 @@
:VERSION 1 # -------------------------- :VERSION 5 # --------------------------
BEGIN; BEGIN;
CREATE TABLE `im_offline` ( CREATE TABLE IF NOT EXISTS `im_offline` (
`ID` MEDIUMINT NOT NULL AUTO_INCREMENT, `ID` mediumint(9) NOT NULL AUTO_INCREMENT,
`PrincipalID` char(36) NOT NULL default '', `PrincipalID` char(36) NOT NULL DEFAULT '',
`FromID` char(36) NOT NULL DEFAULT '',
`Message` text NOT NULL, `Message` text NOT NULL,
`TMStamp` timestamp NOT NULL, `TMStamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`ID`), PRIMARY KEY (`ID`),
KEY `PrincipalID` (`PrincipalID`) KEY `PrincipalID` (`PrincipalID`),
) ENGINE=MyISAM; KEY `FromID` (`FromID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
COMMIT;
:VERSION 2 # --------------------------
BEGIN;
INSERT INTO `im_offline` SELECT * from `diva_im_offline`;
DROP TABLE `diva_im_offline`;
DELETE FROM `migrations` WHERE name='diva_im_Store';
COMMIT;
:VERSION 3 # --------------------------
BEGIN;
ALTER TABLE `im_offline`
ADD `FromID` char(36) NOT NULL default '' AFTER `PrincipalID`,
ADD KEY `FromID` (`FromID`);
COMMIT;
:VERSION 4 # --------------------------
BEGIN;
ALTER TABLE im_offline CONVERT TO CHARACTER SET utf8;
COMMIT; COMMIT;

View File

@ -1,109 +1,42 @@
:VERSION 1 # ------------ :VERSION 7 # ------------
BEGIN; BEGIN;
CREATE TABLE `inventoryfolders` ( CREATE TABLE IF NOT EXISTS `inventoryitems` (
`folderID` varchar(36) NOT NULL default '', `assetID` varchar(36) DEFAULT NULL,
`agentID` varchar(36) default NULL, `assetType` int(11) DEFAULT NULL,
`parentFolderID` varchar(36) default NULL, `inventoryName` varchar(64) DEFAULT NULL,
`folderName` varchar(64) default NULL, `inventoryDescription` varchar(128) DEFAULT NULL,
`type` smallint NOT NULL default 0, `inventoryNextPermissions` int(10) unsigned DEFAULT NULL,
`version` int NOT NULL default 0, `inventoryCurrentPermissions` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`folderID`), `invType` int(11) DEFAULT NULL,
KEY `owner` (`agentID`), `creatorID` varchar(255) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
KEY `parent` (`parentFolderID`) `inventoryBasePermissions` int(10) unsigned NOT NULL DEFAULT '0',
`inventoryEveryOnePermissions` int(10) unsigned NOT NULL DEFAULT '0',
`salePrice` int(11) NOT NULL DEFAULT '0',
`saleType` tinyint(4) NOT NULL DEFAULT '0',
`creationDate` int(11) NOT NULL DEFAULT '0',
`groupID` varchar(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
`groupOwned` tinyint(4) NOT NULL DEFAULT '0',
`flags` int(11) unsigned NOT NULL DEFAULT '0',
`inventoryID` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
`avatarID` char(36) DEFAULT NULL,
`parentFolderID` char(36) DEFAULT NULL,
`inventoryGroupPermissions` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`inventoryID`),
KEY `inventoryitems_avatarid` (`avatarID`),
KEY `inventoryitems_parentFolderid` (`parentFolderID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `inventoryitems` ( CREATE TABLE IF NOT EXISTS `inventoryfolders` (
`inventoryID` varchar(36) NOT NULL default '', `folderName` varchar(64) DEFAULT NULL,
`assetID` varchar(36) default NULL, `type` smallint(6) NOT NULL DEFAULT '0',
`assetType` int(11) default NULL, `version` int(11) NOT NULL DEFAULT '0',
`parentFolderID` varchar(36) default NULL, `folderID` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
`avatarID` varchar(36) default NULL, `agentID` char(36) DEFAULT NULL,
`inventoryName` varchar(64) default NULL, `parentFolderID` char(36) DEFAULT NULL,
`inventoryDescription` varchar(128) default NULL, PRIMARY KEY (`folderID`),
`inventoryNextPermissions` int(10) unsigned default NULL, KEY `inventoryfolders_agentid` (`agentID`),
`inventoryCurrentPermissions` int(10) unsigned default NULL, KEY `inventoryfolders_parentFolderid` (`parentFolderID`)
`invType` int(11) default NULL,
`creatorID` varchar(36) default NULL,
`inventoryBasePermissions` int(10) unsigned NOT NULL default 0,
`inventoryEveryOnePermissions` int(10) unsigned NOT NULL default 0,
`salePrice` int(11) NOT NULL default 0,
`saleType` tinyint(4) NOT NULL default 0,
`creationDate` int(11) NOT NULL default 0,
`groupID` varchar(36) NOT NULL default '00000000-0000-0000-0000-000000000000',
`groupOwned` tinyint(4) NOT NULL default 0,
`flags` int(11) unsigned NOT NULL default 0,
PRIMARY KEY (`inventoryID`),
KEY `owner` (`avatarID`),
KEY `folder` (`parentFolderID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
COMMIT; COMMIT;
:VERSION 2 # ------------
BEGIN;
ALTER TABLE inventoryfolders change folderID folderIDold varchar(36);
ALTER TABLE inventoryfolders change agentID agentIDold varchar(36);
ALTER TABLE inventoryfolders change parentFolderID parentFolderIDold varchar(36);
ALTER TABLE inventoryfolders add folderID char(36) not null default '00000000-0000-0000-0000-000000000000';
ALTER TABLE inventoryfolders add agentID char(36) default NULL;
ALTER TABLE inventoryfolders add parentFolderID char(36) default NULL;
UPDATE inventoryfolders set folderID = folderIDold, agentID = agentIDold, parentFolderID = parentFolderIDold;
ALTER TABLE inventoryfolders drop folderIDold;
ALTER TABLE inventoryfolders drop agentIDold;
ALTER TABLE inventoryfolders drop parentFolderIDold;
ALTER TABLE inventoryfolders add constraint primary key(folderID);
ALTER TABLE inventoryfolders add index inventoryfolders_agentid(agentID);
ALTER TABLE inventoryfolders add index inventoryfolders_parentFolderid(parentFolderID);
ALTER TABLE inventoryitems change inventoryID inventoryIDold varchar(36);
ALTER TABLE inventoryitems change avatarID avatarIDold varchar(36);
ALTER TABLE inventoryitems change parentFolderID parentFolderIDold varchar(36);
ALTER TABLE inventoryitems add inventoryID char(36) not null default '00000000-0000-0000-0000-000000000000';
ALTER TABLE inventoryitems add avatarID char(36) default NULL;
ALTER TABLE inventoryitems add parentFolderID char(36) default NULL;
UPDATE inventoryitems set inventoryID = inventoryIDold, avatarID = avatarIDold, parentFolderID = parentFolderIDold;
ALTER TABLE inventoryitems drop inventoryIDold;
ALTER TABLE inventoryitems drop avatarIDold;
ALTER TABLE inventoryitems drop parentFolderIDold;
ALTER TABLE inventoryitems add constraint primary key(inventoryID);
ALTER TABLE inventoryitems add index inventoryitems_avatarid(avatarID);
ALTER TABLE inventoryitems add index inventoryitems_parentFolderid(parentFolderID);
COMMIT;
:VERSION 3 # ------------
BEGIN;
alter table inventoryitems add column inventoryGroupPermissions integer unsigned not null default 0;
COMMIT;
:VERSION 4 # ------------
BEGIN;
update inventoryitems set creatorID = '00000000-0000-0000-0000-000000000000' where creatorID is NULL;
update inventoryitems set creatorID = '00000000-0000-0000-0000-000000000000' where creatorID = '';
alter table inventoryitems modify column creatorID varchar(36) not NULL default '00000000-0000-0000-0000-000000000000';
COMMIT;
:VERSION 5 # ------------
BEGIN;
alter table inventoryitems modify column creatorID varchar(128) not NULL default '00000000-0000-0000-0000-000000000000';
COMMIT;
:VERSION 6 # ------------
BEGIN;
alter table inventoryitems modify column creatorID varchar(255) not NULL default '00000000-0000-0000-0000-000000000000';
COMMIT;

View File

@ -1,31 +1,16 @@
:VERSION 1 # -------------------------- :VERSION 4 # --------------------------
BEGIN; BEGIN;
CREATE TABLE `Presence` ( CREATE TABLE IF NOT EXISTS `presence` (
`UserID` VARCHAR(255) NOT NULL, `UserID` varchar(255) NOT NULL,
`RegionID` CHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000', `RegionID` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
`SessionID` CHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000', `SessionID` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
`SecureSessionID` CHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000' `SecureSessionID` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
) ENGINE=InnoDB; `LastSeen` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
UNIQUE KEY `SessionID` (`SessionID`),
CREATE UNIQUE INDEX SessionID ON Presence(SessionID); KEY `UserID` (`UserID`),
CREATE INDEX UserID ON Presence(UserID); KEY `RegionID` (`RegionID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
COMMIT;
:VERSION 2 # --------------------------
BEGIN;
ALTER TABLE `Presence` ADD COLUMN LastSeen timestamp;
COMMIT;
:VERSION 3 # --------------------------
BEGIN;
CREATE INDEX RegionID ON Presence(RegionID);
COMMIT; COMMIT;

File diff suppressed because it is too large Load Diff

View File

@ -1,54 +1,24 @@
:VERSION 1 # ------------------------- :VERSION 5 # -------------------------
BEGIN; BEGIN;
CREATE TABLE `UserAccounts` ( CREATE TABLE IF NOT EXISTS `useraccounts` (
`PrincipalID` CHAR(36) NOT NULL, `PrincipalID` char(36) NOT NULL,
`ScopeID` CHAR(36) NOT NULL, `ScopeID` char(36) NOT NULL,
`FirstName` VARCHAR(64) NOT NULL, `FirstName` varchar(64) NOT NULL,
`LastName` VARCHAR(64) NOT NULL, `LastName` varchar(64) NOT NULL,
`Email` VARCHAR(64), `Email` varchar(64) DEFAULT NULL,
`ServiceURLs` TEXT, `ServiceURLs` text,
`Created` INT(11) `Created` int(11) DEFAULT NULL,
`UserLevel` int(11) NOT NULL DEFAULT '0',
`UserFlags` int(11) NOT NULL DEFAULT '0',
`UserTitle` varchar(64) NOT NULL DEFAULT '',
UNIQUE KEY `PrincipalID` (`PrincipalID`),
KEY `Email` (`Email`),
KEY `FirstName` (`FirstName`),
KEY `LastName` (`LastName`),
KEY `Name` (`FirstName`,`LastName`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
COMMIT; COMMIT;
:VERSION 2 # -------------------------
BEGIN;
INSERT INTO UserAccounts (PrincipalID, ScopeID, FirstName, LastName, Email, ServiceURLs, Created) SELECT `UUID` AS PrincipalID, '00000000-0000-0000-0000-000000000000' AS ScopeID, username AS FirstName, lastname AS LastName, email as Email, CONCAT('AssetServerURI=', userAssetURI, ' InventoryServerURI=', userInventoryURI, ' GatewayURI= HomeURI=') AS ServiceURLs, created as Created FROM users;
COMMIT;
:VERSION 3 # -------------------------
BEGIN;
CREATE UNIQUE INDEX PrincipalID ON UserAccounts(PrincipalID);
CREATE INDEX Email ON UserAccounts(Email);
CREATE INDEX FirstName ON UserAccounts(FirstName);
CREATE INDEX LastName ON UserAccounts(LastName);
CREATE INDEX Name ON UserAccounts(FirstName,LastName);
COMMIT;
:VERSION 4 # -------------------------
BEGIN;
ALTER TABLE UserAccounts ADD COLUMN UserLevel integer NOT NULL DEFAULT 0;
ALTER TABLE UserAccounts ADD COLUMN UserFlags integer NOT NULL DEFAULT 0;
ALTER TABLE UserAccounts ADD COLUMN UserTitle varchar(64) NOT NULL DEFAULT '';
COMMIT;
:VERSION 5 # -------------------------
BEGIN;
ALTER TABLE `UserAccounts` ADD `active` INT NOT NULL DEFAULT '1';
COMMIT;

View File

@ -1,4 +1,4 @@
:VERSION 1 # ------------------------------- :VERSION 5 # -------------------------------
begin; begin;
@ -44,6 +44,7 @@ CREATE TABLE IF NOT EXISTS `userpicks` (
`posglobal` varchar(255) NOT NULL, `posglobal` varchar(255) NOT NULL,
`sortorder` int(2) NOT NULL, `sortorder` int(2) NOT NULL,
`enabled` enum('true','false') NOT NULL, `enabled` enum('true','false') NOT NULL,
`gatekeeper` varchar(255),
PRIMARY KEY (`pickuuid`) PRIMARY KEY (`pickuuid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1; ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
@ -66,11 +67,6 @@ CREATE TABLE IF NOT EXISTS `userprofile` (
PRIMARY KEY (`useruuid`) PRIMARY KEY (`useruuid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1; ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
commit;
:VERSION 2 # -------------------------------
begin;
CREATE TABLE IF NOT EXISTS `userdata` ( CREATE TABLE IF NOT EXISTS `userdata` (
`UserId` char(36) NOT NULL, `UserId` char(36) NOT NULL,
`TagId` varchar(64) NOT NULL, `TagId` varchar(64) NOT NULL,
@ -79,10 +75,6 @@ CREATE TABLE IF NOT EXISTS `userdata` (
PRIMARY KEY (`UserId`,`TagId`) PRIMARY KEY (`UserId`,`TagId`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1; ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
commit;
:VERSION 3 # -------------------------------
begin;
CREATE TABLE IF NOT EXISTS `usersettings` ( CREATE TABLE IF NOT EXISTS `usersettings` (
`useruuid` varchar(36) NOT NULL, `useruuid` varchar(36) NOT NULL,
`imviaemail` enum('true','false') NOT NULL, `imviaemail` enum('true','false') NOT NULL,
@ -90,9 +82,5 @@ CREATE TABLE IF NOT EXISTS `usersettings` (
`email` varchar(254) NOT NULL, `email` varchar(254) NOT NULL,
PRIMARY KEY (`useruuid`) PRIMARY KEY (`useruuid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1; ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
commit;
:VERSION 4 # -------------------------------
begin;
ALTER TABLE userpicks ADD COLUMN gatekeeper varchar(255);
commit; commit;

View File

@ -1,168 +0,0 @@
:VERSION 1 # -----------------------------
BEGIN;
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for agents
-- ----------------------------
CREATE TABLE `agents` (
`UUID` varchar(36) NOT NULL,
`sessionID` varchar(36) NOT NULL,
`secureSessionID` varchar(36) NOT NULL,
`agentIP` varchar(16) NOT NULL,
`agentPort` int(11) NOT NULL,
`agentOnline` tinyint(4) NOT NULL,
`loginTime` int(11) NOT NULL,
`logoutTime` int(11) NOT NULL,
`currentRegion` varchar(36) NOT NULL,
`currentHandle` bigint(20) unsigned NOT NULL,
`currentPos` varchar(64) NOT NULL,
PRIMARY KEY (`UUID`),
UNIQUE KEY `session` (`sessionID`),
UNIQUE KEY `ssession` (`secureSessionID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Create schema avatar_appearance
--
CREATE TABLE `avatarappearance` (
Owner char(36) NOT NULL,
Serial int(10) unsigned NOT NULL,
Visual_Params blob NOT NULL,
Texture blob NOT NULL,
Avatar_Height float NOT NULL,
Body_Item char(36) NOT NULL,
Body_Asset char(36) NOT NULL,
Skin_Item char(36) NOT NULL,
Skin_Asset char(36) NOT NULL,
Hair_Item char(36) NOT NULL,
Hair_Asset char(36) NOT NULL,
Eyes_Item char(36) NOT NULL,
Eyes_Asset char(36) NOT NULL,
Shirt_Item char(36) NOT NULL,
Shirt_Asset char(36) NOT NULL,
Pants_Item char(36) NOT NULL,
Pants_Asset char(36) NOT NULL,
Shoes_Item char(36) NOT NULL,
Shoes_Asset char(36) NOT NULL,
Socks_Item char(36) NOT NULL,
Socks_Asset char(36) NOT NULL,
Jacket_Item char(36) NOT NULL,
Jacket_Asset char(36) NOT NULL,
Gloves_Item char(36) NOT NULL,
Gloves_Asset char(36) NOT NULL,
Undershirt_Item char(36) NOT NULL,
Undershirt_Asset char(36) NOT NULL,
Underpants_Item char(36) NOT NULL,
Underpants_Asset char(36) NOT NULL,
Skirt_Item char(36) NOT NULL,
Skirt_Asset char(36) NOT NULL,
PRIMARY KEY (`Owner`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for users
-- ----------------------------
CREATE TABLE `userfriends` (
`ownerID` VARCHAR(37) NOT NULL,
`friendID` VARCHAR(37) NOT NULL,
`friendPerms` INT NOT NULL,
`datetimestamp` INT NOT NULL,
UNIQUE KEY (`ownerID`, `friendID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for users
-- ----------------------------
CREATE TABLE `users` (
`UUID` varchar(36) NOT NULL default '',
`username` varchar(32) NOT NULL,
`lastname` varchar(32) NOT NULL,
`passwordHash` varchar(32) NOT NULL,
`passwordSalt` varchar(32) NOT NULL,
`homeRegion` bigint(20) unsigned default NULL,
`homeLocationX` float default NULL,
`homeLocationY` float default NULL,
`homeLocationZ` float default NULL,
`homeLookAtX` float default NULL,
`homeLookAtY` float default NULL,
`homeLookAtZ` float default NULL,
`created` int(11) NOT NULL,
`lastLogin` int(11) NOT NULL,
`userInventoryURI` varchar(255) default NULL,
`userAssetURI` varchar(255) default NULL,
`profileCanDoMask` int(10) unsigned default NULL,
`profileWantDoMask` int(10) unsigned default NULL,
`profileAboutText` text,
`profileFirstText` text,
`profileImage` varchar(36) default NULL,
`profileFirstImage` varchar(36) default NULL,
`webLoginKey` varchar(36) default NULL,
PRIMARY KEY (`UUID`),
UNIQUE KEY `usernames` (`username`,`lastname`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records
-- ----------------------------
COMMIT;
:VERSION 2 # -----------------------------
BEGIN;
ALTER TABLE users add homeRegionID char(36) NOT NULL default '00000000-0000-0000-0000-000000000000';
COMMIT;
:VERSION 3 # -----------------------------
BEGIN;
ALTER TABLE users add userFlags integer NOT NULL default 0;
ALTER TABLE users add godLevel integer NOT NULL default 0;
COMMIT;
:VERSION 4 # -----------------------------
BEGIN;
ALTER TABLE users add customType varchar(32) not null default '';
ALTER TABLE users add partner char(36) not null default '00000000-0000-0000-0000-000000000000';
COMMIT;
:VERSION 5 # -----------------------------
BEGIN;
CREATE TABLE `avatarattachments` (`UUID` char(36) NOT NULL, `attachpoint` int(11) NOT NULL, `item` char(36) NOT NULL, `asset` char(36) NOT NULL) ENGINE=InnoDB;
COMMIT;
:VERSION 6 # -----------------------------
BEGIN;
ALTER TABLE agents add currentLookAt varchar(36) not null default '';
COMMIT;
:VERSION 7 # -----------------------------
BEGIN;
ALTER TABLE users add email varchar(250);
COMMIT;
:VERSION 8 # -----------------------------
BEGIN;
ALTER TABLE users add scopeID char(36) not null default '00000000-0000-0000-0000-000000000000';
COMMIT;