Skip to content

Instantly share code, notes, and snippets.

@peterdietz
Created October 16, 2013 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterdietz/7009560 to your computer and use it in GitHub Desktop.
Save peterdietz/7009560 to your computer and use it in GitHub Desktop.
A SQL query to find bitstreams in a different assetstore than assetstore0. Hint: change bitstream.store_number to 0, 1, or something more to see bitstream in that assetstore. We were in the process of merging a DSpace assetstore, and this is how we found things to check from the different store.
SELECT
handle.handle,
item.item_id,
item.in_archive,
bitstream.bitstream_id,
bitstream.name,
bitstream.store_number
FROM
public.item,
public.item2bundle,
public.bundle2bitstream,
public.bitstream,
public.handle
WHERE
item2bundle.item_id = item.item_id AND
bundle2bitstream.bundle_id = item2bundle.bundle_id AND
bitstream.bitstream_id = bundle2bitstream.bitstream_id AND
handle.resource_id = item.item_id AND
handle.resource_type_id = 2 AND
bitstream.store_number = 1 AND
item.in_archive = true
limit 10;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment