talk@lists.collectionspace.org

WE HAVE SUNSET THIS LISTSERV - Join us at collectionspace@lyrasislists.org

View all threads

Clear test records for people entries

JK
James Keeline
Tue, Jun 14, 2016 6:35 PM

As I test against my local install, I have some duplicate data.  How can I do the CSpace equivalent of an SQL truncate table on the Local Persons list?
I suppose there is a web service method for doing this but have not spotted that in the documentation.
However, it is heartening to have progress on this. James D. Keeline

As I test against my local install, I have some duplicate data.  How can I do the CSpace equivalent of an SQL truncate table on the Local Persons list? I suppose there is a web service method for doing this but have not spotted that in the documentation. However, it is heartening to have progress on this. James D. Keeline
AR
Aron Roberts
Tue, Jun 14, 2016 7:37 PM

Glad to see more progress, James!

As I test against my local install, I have some duplicate data.  How can

I do the CSpace equivalent of an SQL truncate table on the Local Persons
list?  I suppose there is a web service method for doing this but have not
spotted that in the documentation.

That'd be a real nice-to-have! On spotting this old issue, I'm thinking
that functionality might not (yet) have been implemented?

https://issues.collectionspace.org/browse/CSPACE-2948

If you know the CSIDs of the duplicate records, it's conceivable -
speculating here - that you may be able to cascade delete those records
and all of their associated artifacts across various Nuxeo-related tables
via statements similar to the following (when executed within the relevant
database, such as 'nuxeo_default', or your 'tenantnamehere_default'
database):

DELETE FROM hierarchy WHERE name='d6515434-abae-4674-a413-39438ca62ff1';

(The 'name' column in Nuxeo's hierarchy table is where CollectionSpace
stores CSIDs.)

You might even be able to delete all Person records (albeit across all
vocabularies, not just Local Persons) via a statement like:

DELETE FROM hierarchy WHERE primarytype='Person';

I'm hoping others with more knowledge of this can chime in, to correct or
clarify as needed ...

On Tue, Jun 14, 2016 at 11:35 AM, James Keeline james@keeline.com wrote:

As I test against my local install, I have some duplicate data.  How can I
do the CSpace equivalent of an SQL truncate table on the Local Persons
list?

I suppose there is a web service method for doing this but have not
spotted that in the documentation.

However, it is heartening to have progress on this.

James D. Keeline


Talk mailing list
Talk@lists.collectionspace.org

http://lists.collectionspace.org/mailman/listinfo/talk_lists.collectionspace.org

Glad to see more progress, James! > As I test against my local install, I have some duplicate data. How can I do the CSpace equivalent of an SQL truncate table on the Local Persons list? I suppose there is a web service method for doing this but have not spotted that in the documentation. That'd be a real nice-to-have! On spotting this old issue, I'm thinking that functionality might not (yet) have been implemented? https://issues.collectionspace.org/browse/CSPACE-2948 If you know the CSIDs of the duplicate records, it's conceivable - speculating here - that you *may* be able to cascade delete those records and all of their associated artifacts across various Nuxeo-related tables via statements similar to the following (when executed within the relevant database, such as 'nuxeo_default', or your 'tenantnamehere_default' database): DELETE FROM hierarchy WHERE name='d6515434-abae-4674-a413-39438ca62ff1'; (The 'name' column in Nuxeo's hierarchy table is where CollectionSpace stores CSIDs.) You might even be able to delete all Person records (albeit across all vocabularies, not just Local Persons) via a statement like: DELETE FROM hierarchy WHERE primarytype='Person'; I'm hoping others with more knowledge of this can chime in, to correct or clarify as needed ... On Tue, Jun 14, 2016 at 11:35 AM, James Keeline <james@keeline.com> wrote: > As I test against my local install, I have some duplicate data. How can I > do the CSpace equivalent of an SQL *truncate table* on the Local Persons > list? > > I suppose there is a web service method for doing this but have not > spotted that in the documentation. > > However, it is heartening to have progress on this. > > James D. Keeline > > > _______________________________________________ > Talk mailing list > Talk@lists.collectionspace.org > > http://lists.collectionspace.org/mailman/listinfo/talk_lists.collectionspace.org > >