Instructions for refreshing the SQL Alchemy database files.
- Install sqlacodegen if it is not already installed.
pip install sqlacodegen
- Run sqlacodegen against production or reporting, depending on the files you'd like to refresh. Replace
<postgresql_pw>with your relevant password and update<reporting_database>with the name of the appropriate reporting database.- Production:
sqlacodegen postgresql://ctabone:<postgresql_pw>@flysql19:5432/production_chado --outfile production.py - Reporting:
sqlacodegen postgresql://ctabone:<postgresql_pw>@flysql20:5432/<reporting_database> --outfile reporting.py
- Production:
- Move the output file into
harvdev_utils/productionorharvdev_utils/reportingas appropriate. This will overwrite the existing file. - In the
productionorreportingdirectory, run the scriptproduction_gene_init.pyorreporting_gen_init.pyas appropriate (e.g.python production_gene_init.py). This will regenerate the__init__.pyfile with up-to-date classes.