docs: record name column widening in database change log (#22030)

This commit is contained in:
jay77721 authored and GitHub committed 2026-11-05 18:04:41 +08:00
1 parent 5fa1879de0
commit 4d20ef45f6
1 file changed
+10 -1
@@ -24,7 +24,7 @@ A record of the schema and data changes the Go backend applies to a RAGFlow data
Startup order in `InitDB` for `ragflow_server --migrate` ([database.go](https://github.com/infiniflow/ragflow/blob/main/internal/dao/database.go)):
1. `RunMigrations` — manual, idempotent steps plus the two versioned tenant model steps. Runs *before* `AutoMigrate` because it has to observe the legacy schema.
1. `RunMigrations` — manual, idempotent steps plus the two versioned tenant model steps. This includes `migrateNameColumnWidths`, which widens `pipeline_operation_log.pipeline_title` and `tenant.name` only when the existing column is narrower. Runs *before* `AutoMigrate` because it has to observe the legacy schema.
2. `migrateIngestionLogRunIdentity` — ingestion log columns and indexes.
3. `migrateUserTenantDuplicates` — deduplicates memberships before `AutoMigrate` creates their unique index.
4. `AutoMigrate` — converges every ORM model, including the compilation queue tables.
@@ -335,6 +335,8 @@ These steps are not gated by the version marker. They use schema or data checks
| `knowledgebase` | Adds the `VIRTUAL` generated column `name_ci` (`LOWER(name)` for `status='1'` rows, `NULL` otherwise) and the unique index `idx_kb_tenant_name_ci (tenant_id, name_ci)`, so soft-deleted rows never block name reuse. |
| `user_canvas` | Unique index `(user_id, canvas_category, title)`. |
| `pipeline_operation_log` | Adds `run_count int NULL`, `pipeline_version_id varchar(32) NULL` (the concrete dataflow canvas version a run executed), and the index `idx_pipeline_operation_log_document_run`. |
| `pipeline_operation_log` | Widens `pipeline_title` from `varchar(32)` to `varchar(255)` so it can store the `user_canvas.title` snapshot. Only a narrower column is altered, so rerunning `--migrate` is a no-op. |
| `tenant` | Widens `name` from `varchar(100)` to `varchar(128)` to match the shared short-name limit. Only a narrower column is altered, so rerunning `--migrate` is a no-op. |
| `ingestion_task` | Adds `pipeline_log_id varchar(32) NULL`. |
| `ingestion_task_log` | Adds `pipeline_log_id varchar(32) NULL`, `event_type tinyint NOT NULL DEFAULT 4`, and the index `idx_ingestion_task_log_pipeline_id`. |
| `dialog`, `tenant_llm`, `api_token`, `canvas_template`, `system_settings`, `knowledgebase` | Column types converged to the Peewee models, for example `dialog.top_k int NOT NULL DEFAULT 1024`, `tenant_llm.api_key text`, `api_token.dialog_id varchar(32)`, `canvas_template.title` / `description` nullable longtext, `system_settings.value text NOT NULL`, `knowledgebase.raptor_task_finish_at` / `mindmap_task_finish_at` datetime. |
@@ -343,6 +345,13 @@ These steps are not gated by the version marker. They use schema or data checks
| `document` | Adds `pipeline_version_id varchar(32) NULL` (inherits the dataset pinned version at upload; design section 5). |
| `user_canvas_version` | Adds `alias varchar(255) NULL` (free-text version alias for the version list filter; design A2/F1). |
`migrateNameColumnWidths` performs the two width changes above. It reads
`ColumnTypes().Length()` and only issues `ALTER COLUMN` when the current width is
below the target. On MySQL with `utf8mb4`, widening `pipeline_title` from
`varchar(32)` to `varchar(255)` changes the VARCHAR length prefix and can rebuild
`pipeline_operation_log`; run `ragflow_server --migrate` in a maintenance window
and confirm free disk space. The existing `pipeline_title` index is preserved.
### Data changes
| Table | Change |