aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data
diff options
context:
space:
mode:
authorSean Dague2008-04-09 00:04:27 +0000
committerSean Dague2008-04-09 00:04:27 +0000
commit034255ac24da2ce3ff3f13bd3faea8ceadeeb780 (patch)
treee3439f158412dc581dd105dffe883aa0443e5ea1 /OpenSim/Data
parentfix up Inventory hbm definitions to work. Adding indexes in (diff)
downloadopensim-SC_OLD-034255ac24da2ce3ff3f13bd3faea8ceadeeb780.zip
opensim-SC_OLD-034255ac24da2ce3ff3f13bd3faea8ceadeeb780.tar.gz
opensim-SC_OLD-034255ac24da2ce3ff3f13bd3faea8ceadeeb780.tar.bz2
opensim-SC_OLD-034255ac24da2ce3ff3f13bd3faea8ceadeeb780.tar.xz
add a sample script for migrating from old inventory
Diffstat (limited to 'OpenSim/Data')
-rwxr-xr-xOpenSim/Data/NHibernate/Migration/SqliteInventory.pl39
1 files changed, 39 insertions, 0 deletions
diff --git a/OpenSim/Data/NHibernate/Migration/SqliteInventory.pl b/OpenSim/Data/NHibernate/Migration/SqliteInventory.pl
new file mode 100755
index 0000000..d8698f4
--- /dev/null
+++ b/OpenSim/Data/NHibernate/Migration/SqliteInventory.pl
@@ -0,0 +1,39 @@
1#!/usr/bin/perl
2
3# -- CREATE TABLE inventoryitems(UUID varchar(255) primary key,
4# -- assetID varchar(255),
5# -- assetType integer,
6# -- invType integer,
7# -- parentFolderID varchar(255),
8# -- avatarID varchar(255),
9# -- creatorsID varchar(255),
10# -- inventoryName varchar(255),
11# -- inventoryDescription varchar(255),
12# -- inventoryNextPermissions integer,
13# -- inventoryCurrentPermissions integer,
14# -- inventoryBasePermissions integer,
15# -- inventoryEveryOnePermissions integer);
16
17# -- CREATE TABLE inventoryfolders(UUID varchar(255) primary key,
18# -- name varchar(255),
19# -- agentID varchar(255),
20# -- parentID varchar(255),
21# -- type integer,
22# -- version integer);
23
24my $items = "INSERT INTO InventoryItems(ID, AssetID, AssetType, InvType, Folder, Owner, Creator, Name, Description, NextPermissions, CurrentPermissions, BasePermissions, EveryOnePermissions) ";
25my $folders = "INSERT INTO InventoryFolders(ID, Name, Owner, ParentID, Type, Version) ";
26
27open(SQLITE, "sqlite3 inventoryStore.db .dump |") or die "can't open the database for migration";
28
29while(my $line = <SQLITE>) {
30 $line =~ s/([0-9a-f]{8})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{12})/$1-$2-$3-$4-$5/g;
31 if($line =~ s/(INSERT INTO "inventoryitems")/$items/) {
32 print $line;
33 }
34 if($line =~ s/(INSERT INTO "inventoryfolders")/$folders/) {
35 print $line;
36 }
37
38}
39