mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-22 03:33:06 +08:00
feat(server): auto index all workspaces to indexer (#12205)
close CLOUD-207 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced automated periodic indexing of workspaces with a new job type and a scheduled cron job running every 30 seconds. - Added a unique sequential identifier (`sid`) and an "indexed" flag to workspaces to track indexing status. - **Improvements** - Enhanced workspace indexing to handle missing workspaces and snapshots distinctly and selectively index documents. - Added ability to query workspaces after a given identifier with result limits. - **Bug Fixes** - Improved error handling and logging during workspace indexing operations. - **Tests** - Expanded test coverage for workspace indexing and auto-indexing, including scheduling and edge cases. - **Chores** - Updated data models and schema to support new workspace fields and indexing features. - Enhanced mock data utilities to allow custom timestamps. - Improved type safety and flexibility in document snapshot retrieval. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- A unique constraint covering the columns `[sid]` on the table `workspaces` will be added. If there are existing duplicate values, this will fail.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE "workspaces" ADD COLUMN "sid" INT GENERATED BY DEFAULT AS IDENTITY;
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "workspaces_sid_key" ON "workspaces"("sid");
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "workspaces" ADD COLUMN "indexed" BOOLEAN NOT NULL DEFAULT false;
|
||||
Reference in New Issue
Block a user