# distro-4707-claim-osr-isrcs

Some `OrchardSoundRecording` nodes in neo4j do not have `isrc` or `primaryTrackId` properties set due to the unique constraint applied to `OrchardSoundRecording.isrc`. Previous database pull-requests for DISTRO-4707 copied over data from `Track` nodes, but in some cases conflicts cannot be resolved and new ISRCs must be generated.

# Setup

1. Copy shadow env

	```
    $ cp .env.shadow .env
    ```
    
1. Fill in details in `.env` for art_relations

	:warning: Be sure to change `$` to `\$` in passwords if needed
    
    :no_entry: Write access to art_relations is required!

1. Create venv and install packages

	```
    $ python -m venv env
    $ source env/bin/activate
    $ pip install -r requirements.txt
    ```

# Running

1. Activate venv and shell variables

	```
    $ source env/bin/activate
    $ source .env
    ```

1. Run script, ARGV[1] is number of ISRCs to claim (in batches of 100).

	```
    $ python claim_isrcs.py $NUM_ISRCS > output.txt
    ```
