From 2f9c235b41a205fbb6ff4192a91ec98e35b5e765 Mon Sep 17 00:00:00 2001 From: RockChinQ Date: Tue, 14 Apr 2026 10:08:02 +0800 Subject: [PATCH] docs: update database migration instructions in AGENTS.md --- AGENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index c9c2e2b8..10e59ca9 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -70,7 +70,7 @@ Plugin Runtime automatically starts each installed plugin and interacts through - type: must be a specific type, such as feat (new feature), fix (bug fix), docs (documentation), style (code style), refactor (refactoring), perf (performance optimization), etc. - scope: the scope of the commit, such as the package name, the file name, the function name, the class name, the module name, etc. - subject: the subject of the commit, such as the description of the commit, the reason for the commit, the impact of the commit, etc. -- If you changed the definition of database entities, please update the migration file in `src/langbot/pkg/persistence/migrations/` and update the constants.py file in `src/langbot/pkg/utils/constants.py` with the new migration number. +- LangBot uses [Alembic](https://alembic.sqlalchemy.org/) to manage database migrations, supporting both SQLite and PostgreSQL. Migration files are located in `src/langbot/pkg/persistence/alembic/versions/`. If you changed the definition of database entities (ORM models), generate a new migration script by running `uv run python -m langbot.pkg.persistence.alembic_runner autogenerate "description of your change"` in the project root (requires `data/config.yaml` to exist). Review and edit the generated script before committing. Migrations are executed automatically on LangBot startup. For data migrations (e.g. modifying JSON field content), you need to manually add the migration code in the generated script. ## Some Principles