diff --git a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs index 625120b841..4d3ea96969 100755 --- a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs +++ b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs @@ -1789,6 +1789,7 @@ namespace OpenSim.Data.PGSQL prim.CollisionSoundVolume = Convert.ToSingle(primRow["CollisionSoundVolume"]); prim.PassTouches = (bool)primRow["PassTouches"]; + prim.PassCollisions = (bool)primRow["PassCollisions"]; if (!(primRow["MediaURL"] is System.DBNull)) prim.MediaUrl = (string)primRow["MediaURL"]; @@ -2212,7 +2213,7 @@ namespace OpenSim.Data.PGSQL parameters.Add(_Database.CreateParameter("CollisionSoundVolume", prim.CollisionSoundVolume)); parameters.Add(_Database.CreateParameter("PassTouches", (bool)prim.PassTouches)); - parameters.Add(_Database.CreateParameter("PassCollisions", prim.PassCollisions)); + parameters.Add(_Database.CreateParameter("PassCollisions", (bool)prim.PassCollisions)); if (prim.PassTouches) @@ -2221,9 +2222,9 @@ namespace OpenSim.Data.PGSQL parameters.Add(_Database.CreateParameter("PassTouches", false)); if (prim.PassCollisions) - parameters.Add(_Database.CreateParameter("PassCollisions", 1)); + parameters.Add(_Database.CreateParameter("PassCollisions", false)); else - parameters.Add(_Database.CreateParameter("PassCollisions", 0)); + parameters.Add(_Database.CreateParameter("PassCollisions", true)); parameters.Add(_Database.CreateParameter("LinkNumber", prim.LinkNum)); parameters.Add(_Database.CreateParameter("MediaURL", prim.MediaUrl)); diff --git a/OpenSim/Data/PGSQL/Resources/RegionStore.migrations b/OpenSim/Data/PGSQL/Resources/RegionStore.migrations index 948d17714e..fcefb6baa3 100644 --- a/OpenSim/Data/PGSQL/Resources/RegionStore.migrations +++ b/OpenSim/Data/PGSQL/Resources/RegionStore.migrations @@ -1211,3 +1211,17 @@ BEGIN TRANSACTION; ALTER TABLE prims ADD "PhysInertia" TEXT; COMMIT; + + +:VERSION 47 #---- Convert field PassCollisions in table prims to BOOLEAN + +BEGIN TRANSACTION; + +ALTER TABLE "public"."prims" ALTER COLUMN "PassCollisions" DROP DEFAULT; +ALTER TABLE "public"."prims" + ALTER COLUMN "PassCollisions" TYPE BOOLEAN + USING CASE WHEN "PassCollisions" = 0 THEN FALSE + WHEN "PassCollisions" = 1 THEN TRUE + ELSE NULL + END; +COMMIT;