mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-12 14:40:22 +08:00
feat: migrate to database v3 (#3528)
This commit is contained in:
@@ -52,12 +52,12 @@
|
||||
"rxjs": "^7.8.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blocksuite/blocks": "0.0.0-20230731152415-fdd3d9b0-nightly",
|
||||
"@blocksuite/editor": "0.0.0-20230731152415-fdd3d9b0-nightly",
|
||||
"@blocksuite/global": "0.0.0-20230731152415-fdd3d9b0-nightly",
|
||||
"@blocksuite/blocks": "0.0.0-20230802200139-381599c0-nightly",
|
||||
"@blocksuite/editor": "0.0.0-20230802200139-381599c0-nightly",
|
||||
"@blocksuite/global": "0.0.0-20230802200139-381599c0-nightly",
|
||||
"@blocksuite/icons": "^2.1.29",
|
||||
"@blocksuite/lit": "0.0.0-20230731152415-fdd3d9b0-nightly",
|
||||
"@blocksuite/store": "0.0.0-20230731152415-fdd3d9b0-nightly",
|
||||
"@blocksuite/lit": "0.0.0-20230802200139-381599c0-nightly",
|
||||
"@blocksuite/store": "0.0.0-20230802200139-381599c0-nightly",
|
||||
"@types/react": "^18.2.17",
|
||||
"@types/react-datepicker": "^4.15.0",
|
||||
"@types/react-dnd": "^3.0.2",
|
||||
|
||||
Vendored
+1
-1
@@ -6,7 +6,7 @@
|
||||
"module": "./src/index.ts",
|
||||
"types": "./src/global.ts",
|
||||
"devDependencies": {
|
||||
"@blocksuite/global": "0.0.0-20230731152415-fdd3d9b0-nightly",
|
||||
"@blocksuite/global": "0.0.0-20230802200139-381599c0-nightly",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"zod": "^3.21.4"
|
||||
|
||||
+12
@@ -239,3 +239,15 @@ export function migrateToSubdoc(doc: Y.Doc): Y.Doc {
|
||||
migrateBlocks(doc, output);
|
||||
return output;
|
||||
}
|
||||
|
||||
export async function migrateDatabaseBlockTo3(doc: Y.Doc) {
|
||||
const { migratePageBlock } = await import(
|
||||
'@blocksuite/store/workspace/migration/migrate-block'
|
||||
);
|
||||
migratePageBlock(doc, {
|
||||
'affine:database': 2,
|
||||
});
|
||||
const meta = doc.getMap('meta') as Y.Map<unknown>;
|
||||
const versions = meta.get('blockVersions') as Y.Map<number>;
|
||||
versions.set('affine:database', 3);
|
||||
}
|
||||
|
||||
Vendored
+1
@@ -11,6 +11,7 @@ import type { Collection } from './filter.js';
|
||||
|
||||
export enum WorkspaceVersion {
|
||||
SubDoc = 2,
|
||||
DatabaseV3 = 3,
|
||||
}
|
||||
|
||||
export enum WorkspaceSubPath {
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
"@toeverything/y-indexeddb": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blocksuite/block-std": "0.0.0-20230731152415-fdd3d9b0-nightly",
|
||||
"@blocksuite/blocks": "0.0.0-20230731152415-fdd3d9b0-nightly",
|
||||
"@blocksuite/editor": "0.0.0-20230731152415-fdd3d9b0-nightly",
|
||||
"@blocksuite/global": "0.0.0-20230731152415-fdd3d9b0-nightly",
|
||||
"@blocksuite/lit": "0.0.0-20230731152415-fdd3d9b0-nightly",
|
||||
"@blocksuite/store": "0.0.0-20230731152415-fdd3d9b0-nightly"
|
||||
"@blocksuite/block-std": "0.0.0-20230802200139-381599c0-nightly",
|
||||
"@blocksuite/blocks": "0.0.0-20230802200139-381599c0-nightly",
|
||||
"@blocksuite/editor": "0.0.0-20230802200139-381599c0-nightly",
|
||||
"@blocksuite/global": "0.0.0-20230802200139-381599c0-nightly",
|
||||
"@blocksuite/lit": "0.0.0-20230802200139-381599c0-nightly",
|
||||
"@blocksuite/store": "0.0.0-20230802200139-381599c0-nightly"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@blocksuite/block-std": "*",
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
"jotai": "^2.2.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blocksuite/block-std": "0.0.0-20230731152415-fdd3d9b0-nightly",
|
||||
"@blocksuite/blocks": "0.0.0-20230731152415-fdd3d9b0-nightly",
|
||||
"@blocksuite/editor": "0.0.0-20230731152415-fdd3d9b0-nightly",
|
||||
"@blocksuite/global": "0.0.0-20230731152415-fdd3d9b0-nightly",
|
||||
"@blocksuite/lit": "0.0.0-20230731152415-fdd3d9b0-nightly",
|
||||
"@blocksuite/store": "0.0.0-20230731152415-fdd3d9b0-nightly",
|
||||
"@blocksuite/block-std": "0.0.0-20230802200139-381599c0-nightly",
|
||||
"@blocksuite/blocks": "0.0.0-20230802200139-381599c0-nightly",
|
||||
"@blocksuite/editor": "0.0.0-20230802200139-381599c0-nightly",
|
||||
"@blocksuite/global": "0.0.0-20230802200139-381599c0-nightly",
|
||||
"@blocksuite/lit": "0.0.0-20230802200139-381599c0-nightly",
|
||||
"@blocksuite/store": "0.0.0-20230802200139-381599c0-nightly",
|
||||
"lottie-web": "^5.12.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
||||
@@ -36,15 +36,15 @@
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@blocksuite/global": "0.0.0-20230731152415-fdd3d9b0-nightly",
|
||||
"@blocksuite/store": "0.0.0-20230731152415-fdd3d9b0-nightly",
|
||||
"@blocksuite/global": "0.0.0-20230802200139-381599c0-nightly",
|
||||
"@blocksuite/store": "0.0.0-20230802200139-381599c0-nightly",
|
||||
"jotai": "^2.2.2",
|
||||
"zod": "^3.21.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blocksuite/blocks": "0.0.0-20230731152415-fdd3d9b0-nightly",
|
||||
"@blocksuite/editor": "0.0.0-20230731152415-fdd3d9b0-nightly",
|
||||
"@blocksuite/lit": "0.0.0-20230731152415-fdd3d9b0-nightly",
|
||||
"@blocksuite/blocks": "0.0.0-20230802200139-381599c0-nightly",
|
||||
"@blocksuite/editor": "0.0.0-20230802200139-381599c0-nightly",
|
||||
"@blocksuite/lit": "0.0.0-20230802200139-381599c0-nightly",
|
||||
"vite": "^4.4.7",
|
||||
"vite-plugin-dts": "3.3.1"
|
||||
},
|
||||
|
||||
@@ -139,7 +139,7 @@ const rootWorkspacesMetadataPromiseAtom = atom<
|
||||
...item.map(x => ({
|
||||
id: x.id,
|
||||
flavour: x.flavour,
|
||||
version: WorkspaceVersion.SubDoc,
|
||||
version: WorkspaceVersion.DatabaseV3,
|
||||
}))
|
||||
);
|
||||
} catch (e) {
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@affine/y-provider": "workspace:*",
|
||||
"@blocksuite/blocks": "0.0.0-20230731152415-fdd3d9b0-nightly",
|
||||
"@blocksuite/store": "0.0.0-20230731152415-fdd3d9b0-nightly",
|
||||
"@blocksuite/blocks": "0.0.0-20230802200139-381599c0-nightly",
|
||||
"@blocksuite/store": "0.0.0-20230802200139-381599c0-nightly",
|
||||
"vite": "^4.4.7",
|
||||
"vite-plugin-dts": "3.3.1",
|
||||
"y-indexeddb": "^9.0.11"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"description": "Yjs provider utilities for AFFiNE",
|
||||
"main": "./src/index.ts",
|
||||
"devDependencies": {
|
||||
"@blocksuite/store": "0.0.0-20230731152415-fdd3d9b0-nightly"
|
||||
"@blocksuite/store": "0.0.0-20230802200139-381599c0-nightly"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"yjs": "^13.5.51"
|
||||
|
||||
Reference in New Issue
Block a user