PGSQL: Convert PassCollision in table prims to bool to avoid a hopeless cast that fails with newer versions of NPGSQL.
Signed-off-by: UbitUmarov <ajlduarte@sapo.pt>0.9.0-post-fixes
parent
16f02cb6fd
commit
7cf82a71d6
|
@ -1789,6 +1789,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
prim.CollisionSoundVolume = Convert.ToSingle(primRow["CollisionSoundVolume"]);
|
prim.CollisionSoundVolume = Convert.ToSingle(primRow["CollisionSoundVolume"]);
|
||||||
|
|
||||||
prim.PassTouches = (bool)primRow["PassTouches"];
|
prim.PassTouches = (bool)primRow["PassTouches"];
|
||||||
|
prim.PassCollisions = (bool)primRow["PassCollisions"];
|
||||||
|
|
||||||
if (!(primRow["MediaURL"] is System.DBNull))
|
if (!(primRow["MediaURL"] is System.DBNull))
|
||||||
prim.MediaUrl = (string)primRow["MediaURL"];
|
prim.MediaUrl = (string)primRow["MediaURL"];
|
||||||
|
@ -2212,7 +2213,7 @@ namespace OpenSim.Data.PGSQL
|
||||||
parameters.Add(_Database.CreateParameter("CollisionSoundVolume", prim.CollisionSoundVolume));
|
parameters.Add(_Database.CreateParameter("CollisionSoundVolume", prim.CollisionSoundVolume));
|
||||||
|
|
||||||
parameters.Add(_Database.CreateParameter("PassTouches", (bool)prim.PassTouches));
|
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)
|
if (prim.PassTouches)
|
||||||
|
@ -2221,9 +2222,9 @@ namespace OpenSim.Data.PGSQL
|
||||||
parameters.Add(_Database.CreateParameter("PassTouches", false));
|
parameters.Add(_Database.CreateParameter("PassTouches", false));
|
||||||
|
|
||||||
if (prim.PassCollisions)
|
if (prim.PassCollisions)
|
||||||
parameters.Add(_Database.CreateParameter("PassCollisions", 1));
|
parameters.Add(_Database.CreateParameter("PassCollisions", false));
|
||||||
else
|
else
|
||||||
parameters.Add(_Database.CreateParameter("PassCollisions", 0));
|
parameters.Add(_Database.CreateParameter("PassCollisions", true));
|
||||||
|
|
||||||
parameters.Add(_Database.CreateParameter("LinkNumber", prim.LinkNum));
|
parameters.Add(_Database.CreateParameter("LinkNumber", prim.LinkNum));
|
||||||
parameters.Add(_Database.CreateParameter("MediaURL", prim.MediaUrl));
|
parameters.Add(_Database.CreateParameter("MediaURL", prim.MediaUrl));
|
||||||
|
|
|
@ -1211,3 +1211,17 @@ BEGIN TRANSACTION;
|
||||||
ALTER TABLE prims ADD "PhysInertia" TEXT;
|
ALTER TABLE prims ADD "PhysInertia" TEXT;
|
||||||
|
|
||||||
COMMIT;
|
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;
|
||||||
|
|
Loading…
Reference in New Issue