You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
1.1 KiB

11 months ago
  1. -- AlterTable
  2. ALTER TABLE "workspace_documents" ADD COLUMN "watched" BOOLEAN DEFAULT false;
  3. -- CreateTable
  4. CREATE TABLE "document_sync_queues" (
  5. "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
  6. "staleAfterMs" INTEGER NOT NULL DEFAULT 604800000,
  7. "nextSyncAt" DATETIME NOT NULL,
  8. "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  9. "lastSyncedAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  10. "workspaceDocId" INTEGER NOT NULL,
  11. CONSTRAINT "document_sync_queues_workspaceDocId_fkey" FOREIGN KEY ("workspaceDocId") REFERENCES "workspace_documents" ("id") ON DELETE CASCADE ON UPDATE CASCADE
  12. );
  13. -- CreateTable
  14. CREATE TABLE "document_sync_executions" (
  15. "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
  16. "queueId" INTEGER NOT NULL,
  17. "status" TEXT NOT NULL DEFAULT 'unknown',
  18. "result" TEXT,
  19. "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  20. CONSTRAINT "document_sync_executions_queueId_fkey" FOREIGN KEY ("queueId") REFERENCES "document_sync_queues" ("id") ON DELETE CASCADE ON UPDATE CASCADE
  21. );
  22. -- CreateIndex
  23. CREATE UNIQUE INDEX "document_sync_queues_workspaceDocId_key" ON "document_sync_queues"("workspaceDocId");