Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete management commands we no longer need #1179

Merged
merged 17 commits into from
Nov 30, 2023

Conversation

jacobdgm
Copy link
Contributor

@jacobdgm jacobdgm commented Nov 28, 2023

This PR deletes a number of commands in management/commands that are no longer needed. In doing so, it fixes #1168.

It renames and slightly reworks one command (populate_chant_fields has become touch_all_chants), deletes many commands, and retains just a few. For justification for deleting each of the deleted commands, see #1179 (comment) below. For justification for retaining each of the retained commands, see #1179 (comment) below.

@jacobdgm
Copy link
Contributor Author

jacobdgm commented Nov 28, 2023

Commands deleted:

  • update_differentia_new
    • we created a field, differentia_new (now differentiae_database), which hadn't been there when our chant model was initially set up. This command looked at chants' json_info field and took the relevant value from there to populate the new field.
    • this command only needed to be run once, and it has. It's done its job!
  • sync_sources
    • one of the scripts for syncing data from OldCantus to New. It's done its job!
  • sync_source_creation_date
    • we previously hadn't kept track of the time of creation of the sources in CantusDB. This script got this information from one of the APIs on OldCantus and added it to the existing sources on NewCantus. It's been run, and its job is complete.
  • sync_sequences
    • one of the scripts for syncing data from OldCantus to New. It's done its job!
  • sync_indexers
    • one of the scripts for syncing data from OldCantus to New. It's done its job!
  • sync_genres
    • one of the scripts for syncing data from OldCantus to New. It's done its job!
  • sync_feasts
    • one of the scripts for syncing data from OldCantus to New. It's done its job!
  • sync_chants
    • one of the scripts for syncing data from OldCantus to New. It's done its job!
  • replace_indexer_fields
    • this was a necessary step to merge indexers and users. This merger is complete; this command has done its job
  • populate_volpiano_new_fields
    • there are several volpiano-related fields (volpiano_notes, volpiano_intervals) that are used on the Melody Search page. These fields are now kept up-to-date by update_volpiano_fields in signals.py
  • populate_next_chant_fields
    • the next_chant field is used to optimize the calculation of feasts that follow a given feast. its value is kept up-to-date by signals.py, and this script no longer needs to be run.
  • populate_is_last_chant_in_feast
    • the is_last_chant_in_feast field is used to optimize the calculation of feasts that follow a given feast. its value is kept up-to-date by signals.py, and this script no longer needs to be run.
  • populate_chant_fields
    • this PR renames this command from populate_chant_fields to touch_all_chants. The command goes through every chant and saves it, triggering on_chant_save in signals.py. It was meant to update an existing copy of the database while adding new behavior to signals.py. Since this behavior may still be useful in the future as we make further changes to signals.py, it has been retained, and renamed to reflect its purpose.
  • populate_chant_and_melody_counts
    • this populates the number of chants and number of chants with melodies for each source in the database. These values are now kept up to date in signals.py, and this command should never need to be run again.
  • merge_indexer_user
    • The indexer-user merger is now complete. This command has done its job!
  • add_unknown_source
    • it used to be that some chants/sequences had no source, but Source is now a required field for those models. This command created two "Unknown Source" sources, one for chants and one for sequences, and assigned sourceless chants/sequences to these sources. This command has already run to completion on Production, and running it would both cause problems (creating duplicate "Unknown Source" sources) and pointless (since all chants/sequences already have sources)
  • add_prefix
    • this command added feast codes and prefixes to each Feast in the database. The feast code functionality was added to the sync_feasts command, and the prefix field is kept up-to-date by a signal in signals.py. This command is now several levels of out-of-date.
  • add_all_users
    • one of the scripts for syncing data from OldCantus to New. It's done its job!
  • add_differentiae
    • This just ran to completion on Production, and seems to have worked. Its job is done!

@jacobdgm
Copy link
Contributor Author

jacobdgm commented Nov 28, 2023

Commands that I left:

@jacobdgm jacobdgm marked this pull request as ready for review November 30, 2023 16:42
Copy link
Contributor

@dchiller dchiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving...everything makes sense.

@jacobdgm jacobdgm merged commit 671c443 into DDMAL:develop Nov 30, 2023
@jacobdgm jacobdgm deleted the 1168-del-mgmt-commands branch November 30, 2023 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

we may want to delete/disable many of our management commands
2 participants