Skip to content

LCBRU/lbrc_services

Repository files navigation

LBRC Services

Site for BRC staff to make requests for BRC central services, such as comms, PPI and IT.

Installation and Running

  1. Download the code from github
git clone git@github.com:LCBRU/lbrc_services.git
  1. Install the requirements

Go to the lbrc_services directory and type the command:

pip install -r requirements.txt
  1. Create the database using

Staying in the lbrc_services directory and type the command:

python create_test_db.py
  1. Run the application

Staying in the lbrc_services directory and type the command:

./app.py

Development

Installation

To test the application, run the following command from the project folder:

pip install -r requirements-dev.txt

Testing

To test the application, run the following command from the project folder:

pytest

Database Schema Amendments

Create Migration

To create a migration run the command

./manage.py script "{Description of change}"

You will then need to change the newly-created script created in the migrations directory to make the necessary upgrade and downgrade changes.

Apply Migrations to Database

After amending the models, run the following command to create the migrations and apply them to the database:

./manage.py upgrade

Deployment

Database

The database upgrades are handled by SQLAlchemy-migrate and are run using the manage.py program once the configuration has been copied into place and the database created.

First create an empty database in the database server, then initialise the migrations by running the command:

manage.py version_control
manage.py upgrade

Upgrade

To upgrade the database to the current version, run the command:

manage.py upgrade

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published