aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/SQLite
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/SQLite')
-rw-r--r--OpenSim/Data/SQLite/Resources/EstateStore.migrations88
-rw-r--r--OpenSim/Data/SQLite/Resources/RegionStore.migrations25
-rw-r--r--OpenSim/Data/SQLite/Tests/SQLiteAssetTest.cs64
-rw-r--r--OpenSim/Data/SQLite/Tests/SQLiteEstateTest.cs65
-rw-r--r--OpenSim/Data/SQLite/Tests/SQLiteInventoryTest.cs66
-rw-r--r--OpenSim/Data/SQLite/Tests/SQLiteRegionTest.cs64
6 files changed, 88 insertions, 284 deletions
diff --git a/OpenSim/Data/SQLite/Resources/EstateStore.migrations b/OpenSim/Data/SQLite/Resources/EstateStore.migrations
new file mode 100644
index 0000000..62f6464
--- /dev/null
+++ b/OpenSim/Data/SQLite/Resources/EstateStore.migrations
@@ -0,0 +1,88 @@
1:VERSION 6
2
3BEGIN TRANSACTION;
4
5CREATE TABLE estate_groups (
6 EstateID int(10) NOT NULL,
7 uuid char(36) NOT NULL
8);
9
10CREATE TABLE estate_managers (
11 EstateID int(10) NOT NULL,
12 uuid char(36) NOT NULL
13);
14
15CREATE TABLE estate_map (
16 RegionID char(36) NOT NULL default '00000000-0000-0000-0000-000000000000',
17 EstateID int(11) NOT NULL
18);
19
20CREATE TABLE estate_settings (
21 EstateID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
22 EstateName varchar(64) default NULL,
23 AbuseEmailToEstateOwner tinyint(4) NOT NULL,
24 DenyAnonymous tinyint(4) NOT NULL,
25 ResetHomeOnTeleport tinyint(4) NOT NULL,
26 FixedSun tinyint(4) NOT NULL,
27 DenyTransacted tinyint(4) NOT NULL,
28 BlockDwell tinyint(4) NOT NULL,
29 DenyIdentified tinyint(4) NOT NULL,
30 AllowVoice tinyint(4) NOT NULL,
31 UseGlobalTime tinyint(4) NOT NULL,
32 PricePerMeter int(11) NOT NULL,
33 TaxFree tinyint(4) NOT NULL,
34 AllowDirectTeleport tinyint(4) NOT NULL,
35 RedirectGridX int(11) NOT NULL,
36 RedirectGridY int(11) NOT NULL,
37 ParentEstateID int(10) NOT NULL,
38 SunPosition double NOT NULL,
39 EstateSkipScripts tinyint(4) NOT NULL,
40 BillableFactor float NOT NULL,
41 PublicAccess tinyint(4) NOT NULL
42);
43
44insert into estate_settings (
45 EstateID,EstateName,AbuseEmailToEstateOwner,DenyAnonymous,ResetHomeOnTeleport,FixedSun,DenyTransacted,BlockDwell,DenyIdentified,AllowVoice,UseGlobalTime,PricePerMeter,TaxFree,AllowDirectTeleport,RedirectGridX,RedirectGridY,ParentEstateID,SunPosition,PublicAccess,EstateSkipScripts,BillableFactor)
46 values ( 99, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '');
47delete from estate_settings;
48
49CREATE TABLE estate_users (
50 EstateID int(10) NOT NULL,
51 uuid char(36) NOT NULL
52);
53
54CREATE TABLE estateban (
55 EstateID int(10) NOT NULL,
56 bannedUUID varchar(36) NOT NULL,
57 bannedIp varchar(16) NOT NULL,
58 bannedIpHostMask varchar(16) NOT NULL,
59 bannedNameMask varchar(64) default NULL
60);
61
62CREATE INDEX estate_ban_estate_id on estateban(EstateID);
63CREATE INDEX estate_groups_estate_id on estate_groups(EstateID);
64CREATE INDEX estate_managers_estate_id on estate_managers(EstateID);
65CREATE INDEX estate_map_estate_id on estate_map(EstateID);
66CREATE UNIQUE INDEX estate_map_region_id on estate_map(RegionID);
67CREATE INDEX estate_users_estate_id on estate_users(EstateID);
68
69COMMIT;
70
71
72:VERSION 7
73
74begin;
75
76alter table estate_settings add column AbuseEmail varchar(255) not null default '';
77
78alter table estate_settings add column EstateOwner varchar(36) not null default '';
79
80commit;
81
82:VERSION 8
83
84begin;
85
86alter table estate_settings add column DenyMinors tinyint not null default 0;
87
88commit;
diff --git a/OpenSim/Data/SQLite/Resources/RegionStore.migrations b/OpenSim/Data/SQLite/Resources/RegionStore.migrations
index 7b27378..c47a85d 100644
--- a/OpenSim/Data/SQLite/Resources/RegionStore.migrations
+++ b/OpenSim/Data/SQLite/Resources/RegionStore.migrations
@@ -311,33 +311,8 @@ CREATE TABLE regionsettings (
311 PRIMARY KEY (regionUUID) 311 PRIMARY KEY (regionUUID)
312); 312);
313 313
314CREATE INDEX estate_ban_estate_id on estateban(EstateID);
315CREATE INDEX estate_groups_estate_id on estate_groups(EstateID);
316CREATE INDEX estate_managers_estate_id on estate_managers(EstateID);
317CREATE INDEX estate_map_estate_id on estate_map(EstateID);
318CREATE UNIQUE INDEX estate_map_region_id on estate_map(RegionID);
319CREATE INDEX estate_users_estate_id on estate_users(EstateID);
320
321COMMIT; 314COMMIT;
322 315
323:VERSION 7
324
325begin;
326
327alter table estate_settings add column AbuseEmail varchar(255) not null default '';
328
329alter table estate_settings add column EstateOwner varchar(36) not null default '';
330
331commit;
332
333:VERSION 8
334
335begin;
336
337alter table estate_settings add column DenyMinors tinyint not null default 0;
338
339commit;
340
341:VERSION 9 316:VERSION 9
342 317
343BEGIN; 318BEGIN;
diff --git a/OpenSim/Data/SQLite/Tests/SQLiteAssetTest.cs b/OpenSim/Data/SQLite/Tests/SQLiteAssetTest.cs
deleted file mode 100644
index 0c2f5df..0000000
--- a/OpenSim/Data/SQLite/Tests/SQLiteAssetTest.cs
+++ /dev/null
@@ -1,64 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System.IO;
29using NUnit.Framework;
30using OpenSim.Data.Tests;
31using OpenSim.Tests.Common;
32
33namespace OpenSim.Data.SQLite.Tests
34{
35 [TestFixture, DatabaseTest]
36 public class SQLiteAssetTest : BasicAssetTest
37 {
38 public string file;
39 public string connect;
40
41 [TestFixtureSetUp]
42 public void Init()
43 {
44 // SQLite doesn't work on power or z linux
45 if (Directory.Exists("/proc/ppc64") || Directory.Exists("/proc/dasd"))
46 {
47 Assert.Ignore();
48 }
49
50 SuperInit();
51 file = Path.GetTempFileName() + ".db";
52 connect = "URI=file:" + file + ",version=3";
53 db = new SQLiteAssetData();
54 db.Initialise(connect);
55 }
56
57 [TestFixtureTearDown]
58 public void Cleanup()
59 {
60 db.Dispose();
61 File.Delete(file);
62 }
63 }
64}
diff --git a/OpenSim/Data/SQLite/Tests/SQLiteEstateTest.cs b/OpenSim/Data/SQLite/Tests/SQLiteEstateTest.cs
deleted file mode 100644
index 30f6641..0000000
--- a/OpenSim/Data/SQLite/Tests/SQLiteEstateTest.cs
+++ /dev/null
@@ -1,65 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System.IO;
29using NUnit.Framework;
30using OpenSim.Data.Tests;
31using OpenSim.Tests.Common;
32
33namespace OpenSim.Data.SQLite.Tests
34{
35 [TestFixture, DatabaseTest]
36 public class SQLiteEstateTest : BasicEstateTest
37 {
38 public string file = "regiontest.db";
39 public string connect;
40
41 [TestFixtureSetUp]
42 public void Init()
43 {
44 // SQLite doesn't work on power or z linux
45 if (Directory.Exists("/proc/ppc64") || Directory.Exists("/proc/dasd"))
46 {
47 Assert.Ignore();
48 }
49
50 SuperInit();
51 file = Path.GetTempFileName() + ".db";
52 connect = "URI=file:" + file + ",version=3";
53 db = new SQLiteEstateStore();
54 db.Initialise(connect);
55 regionDb = new SQLiteRegionData();
56 regionDb.Initialise(connect);
57 }
58
59 [TestFixtureTearDown]
60 public void Cleanup()
61 {
62 regionDb.Dispose();
63 }
64 }
65}
diff --git a/OpenSim/Data/SQLite/Tests/SQLiteInventoryTest.cs b/OpenSim/Data/SQLite/Tests/SQLiteInventoryTest.cs
deleted file mode 100644
index 98458a3..0000000
--- a/OpenSim/Data/SQLite/Tests/SQLiteInventoryTest.cs
+++ /dev/null
@@ -1,66 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System.IO;
29using NUnit.Framework;
30using OpenSim.Data.Tests;
31using OpenSim.Tests.Common;
32
33namespace OpenSim.Data.SQLite.Tests
34{
35 [TestFixture, DatabaseTest]
36 public class SQLiteInventoryTest : BasicInventoryTest
37 {
38 public string file;
39 public string connect;
40
41 [TestFixtureSetUp]
42 public void Init()
43 {
44 // SQLite doesn't work on power or z linux
45 if (Directory.Exists("/proc/ppc64") || Directory.Exists("/proc/dasd"))
46 {
47 Assert.Ignore();
48 }
49
50 SuperInit();
51
52 file = Path.GetTempFileName() + ".db";
53 connect = "URI=file:" + file + ",version=3";
54
55 db = new SQLiteInventoryStore();
56 db.Initialise(connect);
57 }
58
59 [TestFixtureTearDown]
60 public void Cleanup()
61 {
62 db.Dispose();
63 File.Delete(file);
64 }
65 }
66}
diff --git a/OpenSim/Data/SQLite/Tests/SQLiteRegionTest.cs b/OpenSim/Data/SQLite/Tests/SQLiteRegionTest.cs
deleted file mode 100644
index abb97cf..0000000
--- a/OpenSim/Data/SQLite/Tests/SQLiteRegionTest.cs
+++ /dev/null
@@ -1,64 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System.IO;
29using NUnit.Framework;
30using OpenSim.Data.Tests;
31using OpenSim.Tests.Common;
32
33namespace OpenSim.Data.SQLite.Tests
34{
35 [TestFixture, DatabaseTest]
36 public class SQLiteRegionTest : BasicRegionTest
37 {
38 public string file = "regiontest.db";
39 public string connect;
40
41 [TestFixtureSetUp]
42 public void Init()
43 {
44 // SQLite doesn't work on power or z linux
45 if (Directory.Exists("/proc/ppc64") || Directory.Exists("/proc/dasd"))
46 {
47 Assert.Ignore();
48 }
49
50 SuperInit();
51 file = Path.GetTempFileName() + ".db";
52 connect = "URI=file:" + file + ",version=3";
53 db = new SQLiteRegionData();
54 db.Initialise(connect);
55 }
56
57 [TestFixtureTearDown]
58 public void Cleanup()
59 {
60 db.Dispose();
61 File.Delete(file);
62 }
63 }
64}