feat(storage): persist the per-group route order

Routes used to load in id order, so the order saved from the console
was lost on the next read. Migration 0012 adds `d1_routes.position`:
saving writes each route's index within its own group (saving one group
never shifts another), and routes load by `group_id, position, id`.

A database without the column keeps working: only a "no such column" /
"has no column named" error falls back to the legacy statements, and
nothing is cached, so a later migration is picked up on the next call.
This commit is contained in:
翅膀 committed 2026-10-16 23:24:09 +08:00
1 parent 24d85fd2e6
commit d57e5c29c4
6 files changed
+181 -29

No files matched your search

+1
View File
@@ -88,6 +88,7 @@ bunx wrangler d1 execute webhooker --remote --file ./migrations/0007_send_logs_i
bunx wrangler d1 execute webhooker --remote --file ./migrations/0008_storage_d1.sql
bunx wrangler d1 execute webhooker --remote --file ./migrations/0010_fragments.sql
bunx wrangler d1 execute webhooker --remote --file ./migrations/0011_feishu_links.sql
bunx wrangler d1 execute webhooker --remote --file ./migrations/0012_route_position.sql
```
:::