Add alembic to manage data migrations
This commit is contained in:
parent
8c73123862
commit
e69b80b52c
6 changed files with 466 additions and 0 deletions
|
|
@ -43,6 +43,7 @@ dependencies = [
|
|||
"uvicorn>=0.38.0",
|
||||
"python-dotenv>=1.2.1",
|
||||
"psycopg2>=2.9.11",
|
||||
"alembic>=1.17.2",
|
||||
]
|
||||
classifiers = [
|
||||
"Programming Language :: Python :: 3",
|
||||
|
|
@ -98,3 +99,19 @@ dev = [
|
|||
"ipython>=8.18.1",
|
||||
"pytest>=9.0.2",
|
||||
]
|
||||
|
||||
[tool.alembic]
|
||||
script_location = "%(here)s/alembic"
|
||||
# file_template = "%%(year)d_%%(month).2d_%%(day).2d_%%(hour).2d%%(minute).2d-%%(rev)s_%%(slug)s"
|
||||
|
||||
prepend_sys_path = [
|
||||
"."
|
||||
]
|
||||
|
||||
[[tool.alembic.post_write_hooks]]
|
||||
name = "ruff"
|
||||
type = "module"
|
||||
module = "ruff"
|
||||
options = "check --fix REVISION_SCRIPT_FILENAME"
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue