diff options
author | Geir Nøklebye | 2017-05-13 17:43:59 +0100 |
---|---|---|
committer | UbitUmarov | 2017-05-13 17:15:47 +0100 |
commit | 7cf82a71d6db53fd3705ae65b4bc45d8f8488ada (patch) | |
tree | f3a7ab03d9b13ca0ff0921502f9475540a9171c3 /OpenSim/Data | |
parent | we can't allow abort to change only one dic (diff) | |
download | opensim-SC-7cf82a71d6db53fd3705ae65b4bc45d8f8488ada.zip opensim-SC-7cf82a71d6db53fd3705ae65b4bc45d8f8488ada.tar.gz opensim-SC-7cf82a71d6db53fd3705ae65b4bc45d8f8488ada.tar.bz2 opensim-SC-7cf82a71d6db53fd3705ae65b4bc45d8f8488ada.tar.xz |
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>
Diffstat (limited to 'OpenSim/Data')
-rwxr-xr-x | OpenSim/Data/PGSQL/PGSQLSimulationData.cs | 7 | ||||
-rw-r--r-- | OpenSim/Data/PGSQL/Resources/RegionStore.migrations | 14 |
2 files changed, 18 insertions, 3 deletions
diff --git a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs index 625120b..4d3ea96 100755 --- a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs +++ b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs | |||
@@ -1789,6 +1789,7 @@ namespace OpenSim.Data.PGSQL | |||
1789 | prim.CollisionSoundVolume = Convert.ToSingle(primRow["CollisionSoundVolume"]); | 1789 | prim.CollisionSoundVolume = Convert.ToSingle(primRow["CollisionSoundVolume"]); |
1790 | 1790 | ||
1791 | prim.PassTouches = (bool)primRow["PassTouches"]; | 1791 | prim.PassTouches = (bool)primRow["PassTouches"]; |
1792 | prim.PassCollisions = (bool)primRow["PassCollisions"]; | ||
1792 | 1793 | ||
1793 | if (!(primRow["MediaURL"] is System.DBNull)) | 1794 | if (!(primRow["MediaURL"] is System.DBNull)) |
1794 | prim.MediaUrl = (string)primRow["MediaURL"]; | 1795 | prim.MediaUrl = (string)primRow["MediaURL"]; |
@@ -2212,7 +2213,7 @@ namespace OpenSim.Data.PGSQL | |||
2212 | parameters.Add(_Database.CreateParameter("CollisionSoundVolume", prim.CollisionSoundVolume)); | 2213 | parameters.Add(_Database.CreateParameter("CollisionSoundVolume", prim.CollisionSoundVolume)); |
2213 | 2214 | ||
2214 | parameters.Add(_Database.CreateParameter("PassTouches", (bool)prim.PassTouches)); | 2215 | parameters.Add(_Database.CreateParameter("PassTouches", (bool)prim.PassTouches)); |
2215 | parameters.Add(_Database.CreateParameter("PassCollisions", prim.PassCollisions)); | 2216 | parameters.Add(_Database.CreateParameter("PassCollisions", (bool)prim.PassCollisions)); |
2216 | 2217 | ||
2217 | 2218 | ||
2218 | if (prim.PassTouches) | 2219 | if (prim.PassTouches) |
@@ -2221,9 +2222,9 @@ namespace OpenSim.Data.PGSQL | |||
2221 | parameters.Add(_Database.CreateParameter("PassTouches", false)); | 2222 | parameters.Add(_Database.CreateParameter("PassTouches", false)); |
2222 | 2223 | ||
2223 | if (prim.PassCollisions) | 2224 | if (prim.PassCollisions) |
2224 | parameters.Add(_Database.CreateParameter("PassCollisions", 1)); | 2225 | parameters.Add(_Database.CreateParameter("PassCollisions", false)); |
2225 | else | 2226 | else |
2226 | parameters.Add(_Database.CreateParameter("PassCollisions", 0)); | 2227 | parameters.Add(_Database.CreateParameter("PassCollisions", true)); |
2227 | 2228 | ||
2228 | parameters.Add(_Database.CreateParameter("LinkNumber", prim.LinkNum)); | 2229 | parameters.Add(_Database.CreateParameter("LinkNumber", prim.LinkNum)); |
2229 | parameters.Add(_Database.CreateParameter("MediaURL", prim.MediaUrl)); | 2230 | parameters.Add(_Database.CreateParameter("MediaURL", prim.MediaUrl)); |
diff --git a/OpenSim/Data/PGSQL/Resources/RegionStore.migrations b/OpenSim/Data/PGSQL/Resources/RegionStore.migrations index 948d177..fcefb6b 100644 --- a/OpenSim/Data/PGSQL/Resources/RegionStore.migrations +++ b/OpenSim/Data/PGSQL/Resources/RegionStore.migrations | |||
@@ -1211,3 +1211,17 @@ BEGIN TRANSACTION; | |||
1211 | ALTER TABLE prims ADD "PhysInertia" TEXT; | 1211 | ALTER TABLE prims ADD "PhysInertia" TEXT; |
1212 | 1212 | ||
1213 | COMMIT; | 1213 | COMMIT; |
1214 | |||
1215 | |||
1216 | :VERSION 47 #---- Convert field PassCollisions in table prims to BOOLEAN | ||
1217 | |||
1218 | BEGIN TRANSACTION; | ||
1219 | |||
1220 | ALTER TABLE "public"."prims" ALTER COLUMN "PassCollisions" DROP DEFAULT; | ||
1221 | ALTER TABLE "public"."prims" | ||
1222 | ALTER COLUMN "PassCollisions" TYPE BOOLEAN | ||
1223 | USING CASE WHEN "PassCollisions" = 0 THEN FALSE | ||
1224 | WHEN "PassCollisions" = 1 THEN TRUE | ||
1225 | ELSE NULL | ||
1226 | END; | ||
1227 | COMMIT; | ||