SQLite db migration update

avinationmerge
UbitUmarov 2015-09-21 12:07:17 +01:00
parent 33b4077c2c
commit f272a023e2
3 changed files with 57 additions and 6 deletions

View File

@ -612,3 +612,17 @@ ALTER TABLE primshapes ADD COLUMN LastAttachPoint int not null default '0';
COMMIT;
:VERSION 31 #---- avination fields plus a few others
BEGIN;
ALTER TABLE `prims` ADD COLUMN `PassTouches` BOOLEAN NOT NULL DEFAULT FALSE;
ALTER TABLE `prims` ADD COLUMN `PassCollisions`BOOLEAN NOT NULL DEFAULT FALSE;
ALTER TABLE `prims` ADD COLUMN `Vehicle` TEXT default NULL;
ALTER TABLE `regionsettings` ADD COLUMN `block_search` BOOLEAN NOT NULL DEFAULT FALSE;;
ALTER TABLE `regionsettings` ADD COLUMN `casino` BOOLEAN NOT NULL DEFAULT FALSE;;
ALTER TABLE `land` ADD COLUMN `SeeAVs` BOOLEAN NOT NULL DEFAULT TRUE;
ALTER TABLE `land` ADD COLUMN `AnyAVSounds` BOOLEAN NOT NULL DEFAULT TRUE;
ALTER TABLE `land` ADD COLUMN `GroupAVSounds` BOOLEAN NOT NULL DEFAULT TRUE;
COMMIT;

View File

@ -25,3 +25,11 @@ BEGIN TRANSACTION;
INSERT INTO UserAccounts (PrincipalID, ScopeID, FirstName, LastName, Email, ServiceURLs, Created) SELECT `UUID` AS PrincipalID, '00000000-0000-0000-0000-000000000000' AS ScopeID, username AS FirstName, surname AS LastName, '' as Email, '' AS ServiceURLs, created as Created FROM users;
COMMIT;
:VERSION 3 # -------------------------
BEGIN;
ALTER TABLE `UserAccounts` ADD `active` BOOLEAN NOT NULL DEFAULT TRUE;
COMMIT;

View File

@ -1246,6 +1246,7 @@ namespace OpenSim.Data.SQLite
createCol(prims, "Restitution", typeof(Double));
createCol(prims, "KeyframeMotion", typeof(Byte[]));
// Add in contraints
prims.PrimaryKey = new DataColumn[] { prims.Columns["UUID"] };
@ -1760,7 +1761,17 @@ namespace OpenSim.Data.SQLite
{
prim.KeyframeMotion = null;
}
prim.PassCollisions = Convert.ToBoolean(row["PassCollisions"]);
prim.PassTouches = Convert.ToBoolean(row["PassTouches"]);
SOPVehicle vehicle = null;
if (!(row["Vehicle"] is DBNull) && row["Vehicle"].ToString() != String.Empty)
{
vehicle = SOPVehicle.FromXml2(row["Vehicle"].ToString());
if (vehicle != null)
prim.VehicleParams = vehicle;
}
return prim;
}
@ -1845,6 +1856,10 @@ namespace OpenSim.Data.SQLite
newData.MediaLoop = Convert.ToBoolean(row["MediaLoop"]);
newData.ObscureMedia = Convert.ToBoolean(row["ObscureMedia"]);
newData.ObscureMusic = Convert.ToBoolean(row["ObscureMusic"]);
newData.SeeAVs = Convert.ToBoolean(row["SeeAVs"]);
newData.AnyAVSounds = Convert.ToBoolean(row["AnyAVSounds"]);
newData.GroupAVSounds = Convert.ToBoolean(row["GroupAVSounds"]);
try
{
newData.UserLocation =
@ -1918,7 +1933,8 @@ namespace OpenSim.Data.SQLite
newSettings.TerrainImageID = new UUID((String)row["map_tile_ID"]);
newSettings.TelehubObject = new UUID((String)row["TelehubObject"]);
newSettings.ParcelImageID = new UUID((String)row["parcel_tile_ID"]);
newSettings.GodBlockSearch = Convert.ToBoolean(row["block_search"]);
newSettings.Casino = Convert.ToBoolean(row["casino"]);
return newSettings;
}
@ -2013,7 +2029,7 @@ namespace OpenSim.Data.SQLite
return entry;
}
/// <summary>
///
/// </summary>
@ -2138,7 +2154,6 @@ namespace OpenSim.Data.SQLite
// click action
row["ClickAction"] = prim.ClickAction;
row["SalePrice"] = prim.SalePrice;
row["Material"] = prim.Material;
row["CollisionSound"] = prim.CollisionSound.ToString();
@ -2169,8 +2184,16 @@ namespace OpenSim.Data.SQLite
row["KeyframeMotion"] = prim.KeyframeMotion.Serialize();
else
row["KeyframeMotion"] = new Byte[0];
row["PassTouches"] = prim.PassTouches;
row["PassCollisions"] = prim.PassCollisions;
if (prim.VehicleParams != null)
row["Vehicle"] = prim.VehicleParams.ToXml2();
else
row["Vehicle"] = String.Empty;
}
/// <summary>
@ -2254,6 +2277,10 @@ namespace OpenSim.Data.SQLite
row["MediaLoop"] = land.MediaLoop;
row["ObscureMusic"] = land.ObscureMusic;
row["ObscureMedia"] = land.ObscureMedia;
row["SeeAVs"] = land.SeeAVs;
row["AnyAVSounds"] = land.AnyAVSounds;
row["GroupAVSounds"] = land.GroupAVSounds;
}
/// <summary>
@ -2312,6 +2339,8 @@ namespace OpenSim.Data.SQLite
row["map_tile_ID"] = settings.TerrainImageID.ToString();
row["TelehubObject"] = settings.TelehubObject.ToString();
row["parcel_tile_ID"] = settings.ParcelImageID.ToString();
row["block_search"] = settings.GodBlockSearch;
row["casino"] = settings.Casino;
}
/// <summary>