smurfpandey / sync_calendars

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

License:MIT License


Languages

Language:HTML 42.6%Language:Python 35.2%Language:Jinja 12.4%Language:JavaScript 7.2%Language:Dockerfile 1.1%Language:Shell 0.7%Language:Mako 0.4%Language:CSS 0.4%