| Previous · Next | |
| User | Message |
|
knowmad
|
Date: 8/4/2010 7:01 pm · Subject: Purging invalid asset · Rating: 0
I have an error in my asset table due to an invalid asset class (WebGUI::Asset::Ticket). No idea where it came from but I'd like to eliminate it. I've found the offending record in the 'asset' table. However, I'm concerned about only deleting that row and leaving other collateral lying around in my database. Is there a programmatic way to eliminate this invalid asset? Perhaps via the wgd?
Thanks, ---- |
| Back to Top |
Rate [ | ]
|
|
perlDreamer
|
Date: 8/4/2010 9:21 pm · Subject: Re: Purging invalid asset · Rating: 0
On 08/04/2010 05:01 PM, dev@webgui.org wrote:> knowmad wrote: > > I have an error in my asset table due to an invalid asset class > (WebGUI::Asset::Ticket). No idea where it came from but I'd like to > eliminate it. > > I've found the offending record in the 'asset' table. However, I'm > concerned about only deleting that row and leaving other collateral > lying around in my database. Is there a programmatic way to eliminate > this invalid asset? Perhaps via the wgd? Assets have entries in at least 3 tables. asset, for invariant information (state, lineage, creationDate, etc) assetData, for per-version asset information Asset specific tables like wobject, Artice, MapPoint, etc. Recent versions of WebGUI have a script called findBrokenAssets, which will: 1) Tell you about broken assets 2) Offer to fix them (if it can) 3) Offer to delete them Since the specific asset class isn't available (WebGUI::Asset::Ticket), I don't know think that findBrokenAssets will work, but you can try. Here's how I would do it: MAKE BACKUPS, VERY GOOD BACKUPS FIRST! See if the Ticket table exists. If it does, then do this: delete from assetData where assetId in (select distinct(assetId) from Ticket); delete from asset where assetId in (select distinct(assetId) from Ticket); drop table ticket. If it doesn't exist, then: delete from assetData where assetId in (select assetId from asset where className='WebGUI::Asset::Ticket'); delete from asset where className='WebGUI::Asset::Ticket'; |
| Back to Top |
Rate [ | ]
|
|
martink
|
Date: 8/5/2010 3:01 am · Subject: Re: Purging invalid asset · Rating: 0
Hi William,On 08/05/2010 02:01 AM, dev@webgui.org wrote: knowmad wrote: I'd guess that that asset belongs to the Helpdesk system. See http://github.com/plainblack/helpdesk/blob/master/lib/WebGUI/Asset/Ticket.pm To safely remove the asset, you could try the following: + Clone the repo. + Add the lib dir of the repo to preload.custom + You might need to run the install script. Maybe not (since you apparently already installed the Helpdesk) + I don't think you need the WG::A::Ticket asset to be added to you config file though. + Restart mod_perl Now you should be able to find all WG::A::Ticket assets through the asset manager's search option. Purging should also be possible. Note that the Ticket assets need to instanciate correctly, so do a 'tail -f /data/wre/var/logs/*' while trying to edit/delete the assets. If this doesn't work, you can probably find out which tables you need to clean from the code. That would be at the very least asset and assetData, but there might be more. Best place to look for those is in the purge method of the Ticket asset (if it has one at all). Martin |
| Back to Top |
Rate [ | ]
|
|
knowmad
|
Date: 8/5/2010 6:55 am · Subject: Re: Purging invalid asset · Rating: 0
Excellent! Thanks for the advice guys. Martin, I think you hit on exactly how that asset got into the system. I found another invalid asset in my logs last night for the HelpSystem so I've a couple of these to clean out. I'll test your ideas on a dev server and write-up a wiki entry for future reference.
William ---- |
| Back to Top |
Rate [ | ]
|