Now before I do this, based on the information provided by everyone on this list. I want to clarify what I am about to do.
According to Geoff (correct me if I am quoting you wrong), Geoff has stated that the relationship between refObjects and dmArchive with a type of dmArchive is related by objected in both tables.
When I was asking the question I had looked at the code and found that the table refObjects table field objecteId is stored inside the dmArchive with the relationship to archiveId field inside that table.
Geoff has stated that this is not true, and that the objected in both tables is the relationship. If that is the case why does the code say this, from the code getArchives?
<cfscript>
sql = "select * from #application.dbowner#dmArchive where archiveID = '#arguments.objectID#' order by datetimecreated DESC";
</cfscript>
So I am guessing my intial assumption, is that I can delete any refObject with an objecteId that is stored in the dmArchive table where that objected is equal to archiveId.
Not sure why Geoff corrected me on this, but I am asking to make sure what I see and what I am told is in fact different.
Andrew Scott
Senior Coldfusion Developer
Aegeon Pty. Ltd.
www.aegeon.com.au
Phone: +613 8676 4223
Mobile: 0404 998 273
refObjects is a table that is used by farcry to determine where a
particular object is located based on it's objectid. In the case of
dmArchive, each entry in the dmArchive has it's own unique objectid.
However several dmArchive entries might have the same archiveid. The
archiveID represents the history of a particular content item, of
which there might be many, and is the foreign key to that unique
objects objectid.
e.g
In dmHTML (the tree) I have a page called test1 with an objectid of
24A9B18F-F395-4B4C-9999999999999999
In refobjects there is an entry with objectid: 24A9B18F-
F395-4B4C-9999999999999999 and typename: dmHTML
Everytime I make a new draft object or archive an item it wraps up all
the metadata of that object into a wddx packet and creates a new entry
in the dmArchive table. This new entry has it's own unique objectid
(let's say 24A9B18F-F395-4B4C-8888888888888888 and an archiveid of
24A9B18F-F395-4B4C-9999999999999999 (the live objects objectid).
So now we have in refobjects
24A9B18F-F395-4B4C-9999999999999999 dmHTML
24A9B18F-F395-4B4C-8888888888888888 dmArchive
In in dmArchive
24A9B18F-F395-4B4C-8888888888888888 with an archiveid of 24A9B18F-
F395-4B4C-9999999999999999
So if for example you wanted to remove all test1 history from the
archive
delete from dmArchive where archiveid = 24A9B18F-
F395-4B4C-8888888888888888
You will have removed all of test1's archive history. But if you then
tried to delete everything from refObjects based on the archiveid (not
the objectid)
delete from refObjects where objectid = 24A9B18F-
F395-4B4C-8888888888888888
You will have now broken the current live object of test1 and orphaned
it in dmHTML. Remember just because it is in dmArchive does not mean
it still does not still have a live version.
Not sure if this clears it up or if we are all still misinterpreting
each other.
Regards,
Jason.
> <http://www.aegeon.com.au>www.aegeon.com.au
Thank you so much, that is precisely what I have been looking for. But the
one question I will ask though, is there a way to do this without breaking
the live version?
Sorry but even though you cleared it up, I do not know enough about the
tables to make an informed decision on the best way to do what I require.
Andrew Scott
Senior Coldfusion Developer
Aegeon Pty. Ltd.
In fact fixrefobjects should also insert any items missing from
refobjects that exist in a content type.
I was just thinking that I could purge the data from dmArchive older than
lastdatetimeupdated >= date and then run the code to fixrefobjects and this
should do what I need in one hit?
By doing this in a template, then putting this into the scheduled tasks to
run nightly I should be safe with this.
Andrew Scott
Senior Coldfusion Developer
Aegeon Pty. Ltd.
www.aegeon.com.au
Phone: +613 8676 4223
Mobile: 0404 998 273
On Jun 1, 12:44 pm, Andrew Scott <andrew.sc...@aegeon.com.au> wrote:
> Cheers Jason,
>
> I was just thinking that I could purge the data from dmArchive older than
> lastdatetimeupdated >= date and then run the code to fixrefobjects and this
> should do what I need in one hit?
>
> By doing this in a template, then putting this into the scheduled tasks to
> run nightly I should be safe with this.
>
> Andrew Scott
> Senior Coldfusion Developer