This project uses UV as the package manager. You have to install it first, if you don't have it already.
# Linux / MacOS
curl -LsSf https://astral.sh/uv/install.sh | sh
# Or Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
uv sync
uv run task dev # development
uv run task serve # production
在开发的过程中,我们可能会多次修改数据库 model,这个时候我们需要生成 migration 文件。并对数据库进行迁移。
修改模型后先运行:
uv run alembic revision --autogenerate -m "your message"
alembic/versions
下面生成的文件和模型修改一起 commit 上去
然后运行一次迁移命令,如果是拉取了最新的代码,也要运行一次迁移命令:
uv run alembic upgrade head