Skip to content

Commit 8bd927e

Browse files
committed
feat: reaction schemas
One thing to note here is that we are changing the emoji shortcode to unique. This required the attribute to be indexed before hand. I'm not sure if we should remove the unique check or add the index in production db.
1 parent a204f1a commit 8bd927e

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

src/clojurians_log/db/schema.clj

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,28 @@
140140
(def emoji-schema
141141
[{:db/ident :emoji/shortcode
142142
:db/valueType :db.type/string
143-
:db/cardinality :db.cardinality/one}
143+
:db/cardinality :db.cardinality/one
144+
:db/unique :db.unique/identity}
144145
{:db/ident :emoji/url
145146
:db/valueType :db.type/string
146147
:db/cardinality :db.cardinality/one}])
147148

148149
(def reaction-schema
149-
[#_{:db/ident :reaction/reaction
150-
,,,}])
150+
[{:db/ident :reaction/type
151+
:db/valueType :db.type/string
152+
:db/cardinality :db.cardinality/one}
153+
{:db/ident :reaction/emoji
154+
:db/valueType :db.type/ref
155+
:db/cardinality :db.cardinality/one}
156+
{:db/ident :reaction/ts
157+
:db/valueType :db.type/string
158+
:db/cardinality :db.cardinality/one}
159+
{:db/ident :reaction/user
160+
:db/valueType :db.type/ref
161+
:db/cardinality :db.cardinality/one}
162+
{:db/ident :reaction/message
163+
:db/valueType :db.type/ref
164+
:db/cardinality :db.cardinality/one}])
151165

152166
(def full-schema
153167
(concat message-schema

0 commit comments

Comments
 (0)