Set up alembic, and more

- Setup alembic and generate the initial migration
- Add poethepoet to dev dependencies in order to put hard-to-remember
  commands beneath the poetry namespace
- Add psycopg2-binary dependency, for use with postgresql
- Remove dotenv dependency, as it is no longer required
- Add `config.toml` to gitignore. This is because alembic has no
  argument parser that will let you specify the config file to use.
  Developers are encouraged to use `config.toml`, which will be
  automatically recognized, unless they want to implement the argument
  parser functionality for alembic.
This commit is contained in:
2023-05-06 17:48:27 +02:00
parent 8dda521f7e
commit 78fa3076b9
7 changed files with 495 additions and 11 deletions
+18 -1
View File
@@ -14,16 +14,33 @@ flask-admin = "^1.6.1"
flask-sqlalchemy = "^3.0.3"
isbnlib = "^3.10.14"
python = "^3.11"
python-dotenv = "^1.0.0"
sqlalchemy = "^2.0.8"
psycopg2-binary = "^2.9.6"
[tool.poetry.group.dev.dependencies]
werkzeug = "^2.3.3"
poethepoet = "^0.20.0"
[tool.poetry.scripts]
cli = "worblehat.cli.main:main"
dev = "worblehat.flaskapp.wsgi_dev:main"
[tool.poe.tasks]
clean = """
rm -rf
./**/__pycache__
./**/worblehat.sqlite
"""
# Migration related
genmigration = "alembic revision --autogenerate -m"
migrate = "alembic upgrade head"
downmigrate = "alembic downgrade -1"
# Be careful with cleanmigrations. If you run migrate a database and then
# delete the migration file with this, there will be no easy way of downgrading
cleanmigrations = "git clean -f worblehat/models/migrations/versions"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"