/sync_calendars

Primary LanguageHTMLMIT LicenseMIT

sync_calendars

  • start rabbitmq: docker-compose up rabbitmq
  • start celery worker: celery -A sync_calendars.app:celery worker -l info -f celery.log
  • build static files: npm run start
  • start webapp: flask run --cert=certs/localhost.pem --key=certs/localhost-key.pem

Database Initialization (locally)

Once you have installed your DBMS, run the following to create your app's database tables and perform the initial migration

flask db init
flask db migrate
flask db upgrade

Migrations

Whenever a database migration needs to be made. Run the following commands

docker-compose run --rm manage db migrate
flask db migrate # If running locally without Docker

This will generate a new migration script. Then run

docker-compose run --rm manage db upgrade
flask db upgrade # If running locally without Docker

To apply the migration.

For a full migration command reference, run docker-compose run --rm manage db --help.

If you will deploy your application remotely (e.g on Heroku) you should add the migrations folder to version control. You can do this after flask db migrate by running the following commands

git add migrations/*
git commit -m "Add migrations"

Make sure folder migrations/versions is not empty.