diff options
Diffstat (limited to 'OpenSim/Framework/Data.MySQL/Resources')
-rw-r--r-- | OpenSim/Framework/Data.MySQL/Resources/CreateRegionsTable.sql | 3 | ||||
-rw-r--r-- | OpenSim/Framework/Data.MySQL/Resources/UpgradeRegionsTableToVersion3.sql | 18 |
2 files changed, 20 insertions, 1 deletions
diff --git a/OpenSim/Framework/Data.MySQL/Resources/CreateRegionsTable.sql b/OpenSim/Framework/Data.MySQL/Resources/CreateRegionsTable.sql index 23535af..cb0f9bd 100644 --- a/OpenSim/Framework/Data.MySQL/Resources/CreateRegionsTable.sql +++ b/OpenSim/Framework/Data.MySQL/Resources/CreateRegionsTable.sql | |||
@@ -23,9 +23,10 @@ CREATE TABLE `regions` ( | |||
23 | `regionUserRecvKey` varchar(128) default NULL, | 23 | `regionUserRecvKey` varchar(128) default NULL, |
24 | `regionUserSendKey` varchar(128) default NULL, `regionMapTexture` varchar(36) default NULL, | 24 | `regionUserSendKey` varchar(128) default NULL, `regionMapTexture` varchar(36) default NULL, |
25 | `serverHttpPort` int(10) default NULL, `serverRemotingPort` int(10) 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, | ||
26 | `originUUID` varchar(36), | 27 | `originUUID` varchar(36), |
27 | PRIMARY KEY (`uuid`), | 28 | PRIMARY KEY (`uuid`), |
28 | KEY `regionName` (`regionName`), | 29 | KEY `regionName` (`regionName`), |
29 | KEY `regionHandle` (`regionHandle`), | 30 | KEY `regionHandle` (`regionHandle`), |
30 | KEY `overrideHandles` (`eastOverrideHandle`,`westOverrideHandle`,`southOverrideHandle`,`northOverrideHandle`) | 31 | KEY `overrideHandles` (`eastOverrideHandle`,`westOverrideHandle`,`southOverrideHandle`,`northOverrideHandle`) |
31 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Rev. 2'; | 32 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Rev. 3'; |
diff --git a/OpenSim/Framework/Data.MySQL/Resources/UpgradeRegionsTableToVersion3.sql b/OpenSim/Framework/Data.MySQL/Resources/UpgradeRegionsTableToVersion3.sql new file mode 100644 index 0000000..b48afec --- /dev/null +++ b/OpenSim/Framework/Data.MySQL/Resources/UpgradeRegionsTableToVersion3.sql | |||
@@ -0,0 +1,18 @@ | |||
1 | DROP PROCEDURE IF EXISTS upgraderegions3; | ||
2 | |||
3 | create procedure upgraderegions3() | ||
4 | BEGIN | ||
5 | DECLARE db_name varchar(64); | ||
6 | select database() into db_name; | ||
7 | IF ((select count(*) from information_schema.columns where table_name='regions' and column_name='owner_uuid' and table_schema=db_name) > 0) | ||
8 | THEN | ||
9 | ALTER TABLE `regions`, COMMENT='Rev. 3'; | ||
10 | ELSE | ||
11 | ALTER TABLE `regions` | ||
12 | ADD COLUMN `owner_uuid` varchar(36) default '00000000-0000-0000-0000-000000000000' not null after serverRemotingPort, COMMENT='Rev. 3'; | ||
13 | END IF; | ||
14 | END; | ||
15 | |||
16 | call upgraderegions3(); | ||
17 | |||
18 | |||