Fix mysql migrations. This is tested with an existing up to date schema,

and no schema.  It should also work with a non up to date schema as well.

Btw, meetings in which I can get code done are the right kind of meetings.
0.6.0-stable
Sean Dague 2008-06-12 18:44:58 +00:00
parent 7cdedcaf0e
commit 202a4bec13
7 changed files with 32 additions and 17 deletions

View File

@ -90,6 +90,7 @@ namespace OpenSim.Data.MySQL
m_log.Info("[REGION DB]: MySql - connecting: " + connectionstring); m_log.Info("[REGION DB]: MySql - connecting: " + connectionstring);
m_connection = new MySqlConnection(connectionstring); m_connection = new MySqlConnection(connectionstring);
m_connection.Open();
// This actually does the roll forward assembly stuff // This actually does the roll forward assembly stuff
Assembly assem = GetType().Assembly; Assembly assem = GetType().Assembly;

View File

@ -72,7 +72,7 @@ namespace OpenSim.Data.MySQL
// This actually does the roll forward assembly stuff // This actually does the roll forward assembly stuff
Assembly assem = GetType().Assembly; Assembly assem = GetType().Assembly;
Migration m = new Migration(database.Connection, assem, "AssetStore"); Migration m = new Migration(database.Connection, assem, "InventoryStore");
// TODO: After rev 6000, remove this. People should have // TODO: After rev 6000, remove this. People should have
// been rolled onto the new migration code by then. // been rolled onto the new migration code by then.

View File

@ -107,7 +107,7 @@ namespace OpenSim.Data.MySQL
// This actually does the roll forward assembly stuff // This actually does the roll forward assembly stuff
Assembly assem = GetType().Assembly; Assembly assem = GetType().Assembly;
Migration m = new Migration(database.Connection, assem, "AssetStore"); Migration m = new Migration(database.Connection, assem, "UserStore");
// TODO: After rev 6000, remove this. People should have // TODO: After rev 6000, remove this. People should have
// been rolled onto the new migration code by then. // been rolled onto the new migration code by then.

View File

@ -1,3 +1,5 @@
BEGIN;
CREATE TABLE `assets` ( CREATE TABLE `assets` (
`id` binary(16) NOT NULL, `id` binary(16) NOT NULL,
`name` varchar(64) NOT NULL, `name` varchar(64) NOT NULL,
@ -9,3 +11,5 @@ CREATE TABLE `assets` (
`data` longblob NOT NULL, `data` longblob NOT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 1'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 1';
COMMIT;

View File

@ -1,3 +1,5 @@
BEGIN;
CREATE TABLE `inventoryfolders` ( CREATE TABLE `inventoryfolders` (
`folderID` varchar(36) NOT NULL default '', `folderID` varchar(36) NOT NULL default '',
`agentID` varchar(36) default NULL, `agentID` varchar(36) default NULL,
@ -8,7 +10,8 @@ CREATE TABLE `inventoryfolders` (
PRIMARY KEY (`folderID`), PRIMARY KEY (`folderID`),
KEY `owner` (`agentID`), KEY `owner` (`agentID`),
KEY `parent` (`parentFolderID`) KEY `parent` (`parentFolderID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 2'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `inventoryitems` ( CREATE TABLE `inventoryitems` (
`inventoryID` varchar(36) NOT NULL default '', `inventoryID` varchar(36) NOT NULL default '',
`assetID` varchar(36) default NULL, `assetID` varchar(36) default NULL,
@ -32,4 +35,6 @@ CREATE TABLE `inventoryitems` (
PRIMARY KEY (`inventoryID`), PRIMARY KEY (`inventoryID`),
KEY `owner` (`avatarID`), KEY `owner` (`avatarID`),
KEY `folder` (`parentFolderID`) KEY `folder` (`parentFolderID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 3'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
COMMIT;

View File

@ -1,3 +1,5 @@
BEGIN;
CREATE TABLE `prims` ( CREATE TABLE `prims` (
`UUID` varchar(255) NOT NULL, `UUID` varchar(255) NOT NULL,
`RegionUUID` varchar(255) default NULL, `RegionUUID` varchar(255) default NULL,
@ -46,7 +48,7 @@ CREATE TABLE `prims` (
`SitTargetOrientY` float default NULL, `SitTargetOrientY` float default NULL,
`SitTargetOrientZ` float default NULL, `SitTargetOrientZ` float default NULL,
PRIMARY KEY (`UUID`) PRIMARY KEY (`UUID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `primshapes` ( CREATE TABLE `primshapes` (
`UUID` varchar(255) NOT NULL, `UUID` varchar(255) NOT NULL,
@ -77,7 +79,7 @@ CREATE TABLE `primshapes` (
`Texture` longblob, `Texture` longblob,
`ExtraParams` longblob, `ExtraParams` longblob,
PRIMARY KEY (`UUID`) PRIMARY KEY (`UUID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `primitems` ( CREATE TABLE `primitems` (
`itemID` varchar(255) NOT NULL, `itemID` varchar(255) NOT NULL,
@ -99,13 +101,13 @@ CREATE TABLE `primitems` (
`everyonePermissions` int(11) default NULL, `everyonePermissions` int(11) default NULL,
`groupPermissions` int(11) default NULL, `groupPermissions` int(11) default NULL,
PRIMARY KEY (`itemID`) PRIMARY KEY (`itemID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `terrain` ( CREATE TABLE `terrain` (
`RegionUUID` varchar(255) default NULL, `RegionUUID` varchar(255) default NULL,
`Revision` int(11) default NULL, `Revision` int(11) default NULL,
`Heightfield` longblob `Heightfield` longblob
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `land` ( CREATE TABLE `land` (
`UUID` varchar(255) NOT NULL, `UUID` varchar(255) NOT NULL,
@ -141,10 +143,12 @@ CREATE TABLE `land` (
`UserLookAtZ` float default NULL, `UserLookAtZ` float default NULL,
`AuthbuyerID` varchar(36) NOT NULL default '00000000-0000-0000-0000-000000000000', `AuthbuyerID` varchar(36) NOT NULL default '00000000-0000-0000-0000-000000000000',
PRIMARY KEY (`UUID`) PRIMARY KEY (`UUID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 2' ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `landaccesslist` ( CREATE TABLE `landaccesslist` (
`LandUUID` varchar(255) default NULL, `LandUUID` varchar(255) default NULL,
`AccessUUID` varchar(255) default NULL, `AccessUUID` varchar(255) default NULL,
`Flags` int(11) default NULL `Flags` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
COMMIT;

View File

@ -1,3 +1,5 @@
BEGIN;
SET FOREIGN_KEY_CHECKS=0; SET FOREIGN_KEY_CHECKS=0;
-- ---------------------------- -- ----------------------------
-- Table structure for agents -- Table structure for agents
@ -17,7 +19,7 @@ CREATE TABLE `agents` (
PRIMARY KEY (`UUID`), PRIMARY KEY (`UUID`),
UNIQUE KEY `session` (`sessionID`), UNIQUE KEY `session` (`sessionID`),
UNIQUE KEY `ssession` (`secureSessionID`) UNIQUE KEY `ssession` (`secureSessionID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 1'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Create schema avatar_appearance -- Create schema avatar_appearance
-- --
@ -54,10 +56,8 @@ CREATE TABLE `avatarappearance` (
Underpants_Asset char(36) NOT NULL, Underpants_Asset char(36) NOT NULL,
Skirt_Item char(36) NOT NULL, Skirt_Item char(36) NOT NULL,
Skirt_Asset char(36) NOT NULL, Skirt_Asset char(36) NOT NULL,
PRIMARY KEY (`Owner`) PRIMARY KEY (`Owner`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev.2'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
SET FOREIGN_KEY_CHECKS=0; SET FOREIGN_KEY_CHECKS=0;
-- ---------------------------- -- ----------------------------
@ -69,7 +69,7 @@ CREATE TABLE `userfriends` (
`friendPerms` INT NOT NULL, `friendPerms` INT NOT NULL,
`datetimestamp` INT NOT NULL, `datetimestamp` INT NOT NULL,
UNIQUE KEY (`ownerID`, `friendID`) UNIQUE KEY (`ownerID`, `friendID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev.1';SET FOREIGN_KEY_CHECKS=0; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ---------------------------- -- ----------------------------
-- Table structure for users -- Table structure for users
-- ---------------------------- -- ----------------------------
@ -99,8 +99,9 @@ CREATE TABLE `users` (
`webLoginKey` varchar(36) default NULL, `webLoginKey` varchar(36) default NULL,
PRIMARY KEY (`UUID`), PRIMARY KEY (`UUID`),
UNIQUE KEY `usernames` (`username`,`lastname`) UNIQUE KEY `usernames` (`username`,`lastname`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 2'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ---------------------------- -- ----------------------------
-- Records -- Records
-- ---------------------------- -- ----------------------------
COMMIT;