Browse Source

fix: class schema

Tienson Qin 1 year ago
parent
commit
f7d418c376
1 changed files with 8 additions and 6 deletions
  1. 8 6
      deps/db/src/logseq/db/frontend/malli_schema.cljs

+ 8 - 6
deps/db/src/logseq/db/frontend/malli_schema.cljs

@@ -92,8 +92,7 @@
    [:block/journal? :boolean]
    [:block/journal? :boolean]
    [:block/alias {:optional true} [:set :int]]
    [:block/alias {:optional true} [:set :int]]
     ;; TODO: Should this be here or in common?
     ;; TODO: Should this be here or in common?
-   [:block/path-refs {:optional true} [:set :int]]
-   [:class/schema.properties {:optional true} [:set :int]]])
+   [:block/path-refs {:optional true} [:set :int]]])
 
 
 (def normal-page
 (def normal-page
   (vec
   (vec
@@ -107,17 +106,20 @@
     page-attrs
     page-attrs
     page-or-block-attrs)))
     page-or-block-attrs)))
 
 
+(def class-attrs
+  [[:db/ident {:optional true} :keyword]
+   [:class/schema.properties {:optional true} [:set :int]]])
+
 (def class-page
 (def class-page
   (vec
   (vec
    (concat
    (concat
     [:map
     [:map
      [:block/namespace {:optional true} :int]
      [:block/namespace {:optional true} :int]
-     [:db/ident {:optional true} :keyword]
-     [:class/schema.properties {:optional true} [:set :int]]
      [:block/schema
      [:block/schema
       {:optional true}
       {:optional true}
       [:map
       [:map
-       [:properties {:optional true} [:vector :int]]]]]
+       [:properties {:optional true} [:vector :uuid]]]]]
+    class-attrs
     page-attrs
     page-attrs
     page-or-block-attrs)))
     page-or-block-attrs)))
 
 
@@ -311,7 +313,7 @@
 
 
 ;; Keep malli schema in sync with db schema
 ;; Keep malli schema in sync with db schema
 ;; ========================================
 ;; ========================================
-(let [malli-many-ref-attrs (->> (concat page-attrs block-attrs page-or-block-attrs)
+(let [malli-many-ref-attrs (->> (concat class-attrs page-attrs block-attrs page-or-block-attrs)
                                 (filter #(= (last %) [:set :int]))
                                 (filter #(= (last %) [:set :int]))
                                 (map first)
                                 (map first)
                                 set)]
                                 set)]