Removing unused Items from the database

For bug reports and fixes, installation issues, and new ideas for technical features.

Moderator: SEOW Developers

Post Reply
Zoi
Posts: 268
Joined: Fri 14 Jan 2011 3:20 pm

Removing unused Items from the database

Post by Zoi »

Is there an easy way to remove items not on the template from the database?
IV/JG7_4Shades
Posts: 2202
Joined: Mon 08 Jan 2007 11:10 pm
Location: Perth, Western Australia

Post by IV/JG7_4Shades »

You can do it via SQL, something like:

Code: Select all

UPDATE Object_Specifications SET Nationality='z' WHERE NOT EXISTS (SELECT DISTINCT Obj_Type FROM ObjMissionData WHERE Object_Specifications.Object_Type=ObjMissionData.Obj_Type);
This assumes that all campaign objects to be used are in the ObjMissionData table already.

Alternatively, disable all objects in Object_Specifications using

Code: Select all

UPDATE Object_Specifications SET Nationality='z'
and then re-enable the ones you want by changing Nationality back to 'r', 'g' or 'n' by hand.

Cheers,
4Shades
IV/JG7_4Shades
SEOW Developer

Image
Zoi
Posts: 268
Joined: Fri 14 Jan 2011 3:20 pm

Post by Zoi »

Thanks 4Shades I may try this. I'm finding this all kind of challenging :D
Post Reply