Skip to content

Database Information

The Image Pre-Processing Pipeline is built upon a database to store images, histograms, and fit parameter values.

Updating the Database

The original database is now quite different than the database needed to query and save calculated parameters. In order to generate the necessary updates to run the code, do the following:

  • 1.) install the python package Alembic in your python environment
    conda install -c conda-forge alembic
    • additional installation information can be found here
  • 2.) in the (CHD) project folder, run the script to update the database
    alembic upgrade head
    • this will run the latest updates to the database
  • 3.) to return to the original database, run the downgrade script
    alembic downgrade base
    • this will return the database to it's original form
  • 4.) to only run certain upgrades/downgrades
    • run a specific number of revisions (n is the number of revisions to either upgrade/downgrade)
      alembic upgrade +n
      alembic downgrade -n
    • run a specific upgrade/downgrade: scripts are found here
      alembic upgrade "revision"
      alembic downgrade "revision"
      • "revision" refers to the first 3+ identifying characters from the specific script
  • 5.) to create new update scripts
    alembic revision -m "revision name"
    • edit this script with the upgrade/downgrade necessary

Database Schema

Database Schema