Skip to content
File

Blob: drizzle/d1/meta/0002_snapshot.json

json774 lines
1{
2 "version": "6",
3 "dialect": "sqlite",
4 "id": "5180bbfb-0ebe-468f-b3fc-970cded96315",
5 "prevId": "14b234b7-283c-4e52-8623-dd9c89797303",
6 "tables": {
7 "invites": {
8 "name": "invites",
9 "columns": {
10 "id": {
11 "name": "id",
12 "type": "text",
13 "primaryKey": true,
14 "notNull": true,
15 "autoincrement": false
16 },
17 "email": {
18 "name": "email",
19 "type": "text",
20 "primaryKey": false,
21 "notNull": false,
22 "autoincrement": false
23 },
24 "workspace_id": {
25 "name": "workspace_id",
26 "type": "text",
27 "primaryKey": false,
28 "notNull": true,
29 "autoincrement": false
30 },
31 "invited_by": {
32 "name": "invited_by",
33 "type": "text",
34 "primaryKey": false,
35 "notNull": true,
36 "autoincrement": false
37 },
38 "role": {
39 "name": "role",
40 "type": "text",
41 "primaryKey": false,
42 "notNull": true,
43 "autoincrement": false,
44 "default": "'member'"
45 },
46 "token": {
47 "name": "token",
48 "type": "text",
49 "primaryKey": false,
50 "notNull": true,
51 "autoincrement": false
52 },
53 "accepted_at": {
54 "name": "accepted_at",
55 "type": "text",
56 "primaryKey": false,
57 "notNull": false,
58 "autoincrement": false
59 },
60 "accepted_by": {
61 "name": "accepted_by",
62 "type": "text",
63 "primaryKey": false,
64 "notNull": false,
65 "autoincrement": false
66 },
67 "revoked_at": {
68 "name": "revoked_at",
69 "type": "text",
70 "primaryKey": false,
71 "notNull": false,
72 "autoincrement": false
73 },
74 "expires_at": {
75 "name": "expires_at",
76 "type": "text",
77 "primaryKey": false,
78 "notNull": true,
79 "autoincrement": false
80 },
81 "created_at": {
82 "name": "created_at",
83 "type": "text",
84 "primaryKey": false,
85 "notNull": true,
86 "autoincrement": false,
87 "default": "(datetime('now'))"
88 }
89 },
90 "indexes": {
91 "invites_token_unique": {
92 "name": "invites_token_unique",
93 "columns": [
94 "token"
95 ],
96 "isUnique": true
97 },
98 "idx_invites_token": {
99 "name": "idx_invites_token",
100 "columns": [
101 "token"
102 ],
103 "isUnique": false
104 },
105 "idx_invites_email": {
106 "name": "idx_invites_email",
107 "columns": [
108 "email"
109 ],
110 "isUnique": false
111 }
112 },
113 "foreignKeys": {
114 "invites_workspace_id_workspaces_id_fk": {
115 "name": "invites_workspace_id_workspaces_id_fk",
116 "tableFrom": "invites",
117 "tableTo": "workspaces",
118 "columnsFrom": [
119 "workspace_id"
120 ],
121 "columnsTo": [
122 "id"
123 ],
124 "onDelete": "no action",
125 "onUpdate": "no action"
126 },
127 "invites_invited_by_users_id_fk": {
128 "name": "invites_invited_by_users_id_fk",
129 "tableFrom": "invites",
130 "tableTo": "users",
131 "columnsFrom": [
132 "invited_by"
133 ],
134 "columnsTo": [
135 "id"
136 ],
137 "onDelete": "no action",
138 "onUpdate": "no action"
139 },
140 "invites_accepted_by_users_id_fk": {
141 "name": "invites_accepted_by_users_id_fk",
142 "tableFrom": "invites",
143 "tableTo": "users",
144 "columnsFrom": [
145 "accepted_by"
146 ],
147 "columnsTo": [
148 "id"
149 ],
150 "onDelete": "no action",
151 "onUpdate": "no action"
152 }
153 },
154 "compositePrimaryKeys": {},
155 "uniqueConstraints": {},
156 "checkConstraints": {}
157 },
158 "memberships": {
159 "name": "memberships",
160 "columns": {
161 "user_id": {
162 "name": "user_id",
163 "type": "text",
164 "primaryKey": false,
165 "notNull": true,
166 "autoincrement": false
167 },
168 "workspace_id": {
169 "name": "workspace_id",
170 "type": "text",
171 "primaryKey": false,
172 "notNull": true,
173 "autoincrement": false
174 },
175 "role": {
176 "name": "role",
177 "type": "text",
178 "primaryKey": false,
179 "notNull": true,
180 "autoincrement": false
181 },
182 "joined_at": {
183 "name": "joined_at",
184 "type": "text",
185 "primaryKey": false,
186 "notNull": true,
187 "autoincrement": false,
188 "default": "(datetime('now'))"
189 }
190 },
191 "indexes": {},
192 "foreignKeys": {
193 "memberships_user_id_users_id_fk": {
194 "name": "memberships_user_id_users_id_fk",
195 "tableFrom": "memberships",
196 "tableTo": "users",
197 "columnsFrom": [
198 "user_id"
199 ],
200 "columnsTo": [
201 "id"
202 ],
203 "onDelete": "no action",
204 "onUpdate": "no action"
205 },
206 "memberships_workspace_id_workspaces_id_fk": {
207 "name": "memberships_workspace_id_workspaces_id_fk",
208 "tableFrom": "memberships",
209 "tableTo": "workspaces",
210 "columnsFrom": [
211 "workspace_id"
212 ],
213 "columnsTo": [
214 "id"
215 ],
216 "onDelete": "no action",
217 "onUpdate": "no action"
218 }
219 },
220 "compositePrimaryKeys": {
221 "memberships_user_id_workspace_id_pk": {
222 "columns": [
223 "user_id",
224 "workspace_id"
225 ],
226 "name": "memberships_user_id_workspace_id_pk"
227 }
228 },
229 "uniqueConstraints": {},
230 "checkConstraints": {}
231 },
232 "page_shares": {
233 "name": "page_shares",
234 "columns": {
235 "id": {
236 "name": "id",
237 "type": "text",
238 "primaryKey": true,
239 "notNull": true,
240 "autoincrement": false
241 },
242 "page_id": {
243 "name": "page_id",
244 "type": "text",
245 "primaryKey": false,
246 "notNull": true,
247 "autoincrement": false
248 },
249 "grantee_type": {
250 "name": "grantee_type",
251 "type": "text",
252 "primaryKey": false,
253 "notNull": true,
254 "autoincrement": false
255 },
256 "grantee_id": {
257 "name": "grantee_id",
258 "type": "text",
259 "primaryKey": false,
260 "notNull": false,
261 "autoincrement": false
262 },
263 "permission": {
264 "name": "permission",
265 "type": "text",
266 "primaryKey": false,
267 "notNull": true,
268 "autoincrement": false
269 },
270 "link_token": {
271 "name": "link_token",
272 "type": "text",
273 "primaryKey": false,
274 "notNull": false,
275 "autoincrement": false
276 },
277 "created_by": {
278 "name": "created_by",
279 "type": "text",
280 "primaryKey": false,
281 "notNull": true,
282 "autoincrement": false
283 },
284 "created_at": {
285 "name": "created_at",
286 "type": "text",
287 "primaryKey": false,
288 "notNull": true,
289 "autoincrement": false,
290 "default": "(datetime('now'))"
291 }
292 },
293 "indexes": {
294 "page_shares_link_token_unique": {
295 "name": "page_shares_link_token_unique",
296 "columns": [
297 "link_token"
298 ],
299 "isUnique": true
300 },
301 "idx_page_shares_page": {
302 "name": "idx_page_shares_page",
303 "columns": [
304 "page_id"
305 ],
306 "isUnique": false
307 },
308 "idx_page_shares_grantee": {
309 "name": "idx_page_shares_grantee",
310 "columns": [
311 "grantee_type",
312 "grantee_id"
313 ],
314 "isUnique": false
315 }
316 },
317 "foreignKeys": {
318 "page_shares_page_id_pages_id_fk": {
319 "name": "page_shares_page_id_pages_id_fk",
320 "tableFrom": "page_shares",
321 "tableTo": "pages",
322 "columnsFrom": [
323 "page_id"
324 ],
325 "columnsTo": [
326 "id"
327 ],
328 "onDelete": "no action",
329 "onUpdate": "no action"
330 },
331 "page_shares_created_by_users_id_fk": {
332 "name": "page_shares_created_by_users_id_fk",
333 "tableFrom": "page_shares",
334 "tableTo": "users",
335 "columnsFrom": [
336 "created_by"
337 ],
338 "columnsTo": [
339 "id"
340 ],
341 "onDelete": "no action",
342 "onUpdate": "no action"
343 }
344 },
345 "compositePrimaryKeys": {},
346 "uniqueConstraints": {},
347 "checkConstraints": {}
348 },
349 "pages": {
350 "name": "pages",
351 "columns": {
352 "id": {
353 "name": "id",
354 "type": "text",
355 "primaryKey": true,
356 "notNull": true,
357 "autoincrement": false
358 },
359 "workspace_id": {
360 "name": "workspace_id",
361 "type": "text",
362 "primaryKey": false,
363 "notNull": true,
364 "autoincrement": false
365 },
366 "parent_id": {
367 "name": "parent_id",
368 "type": "text",
369 "primaryKey": false,
370 "notNull": false,
371 "autoincrement": false
372 },
373 "kind": {
374 "name": "kind",
375 "type": "text",
376 "primaryKey": false,
377 "notNull": true,
378 "autoincrement": false,
379 "default": "'doc'"
380 },
381 "title": {
382 "name": "title",
383 "type": "text",
384 "primaryKey": false,
385 "notNull": true,
386 "autoincrement": false,
387 "default": "'Untitled'"
388 },
389 "icon": {
390 "name": "icon",
391 "type": "text",
392 "primaryKey": false,
393 "notNull": false,
394 "autoincrement": false
395 },
396 "cover_url": {
397 "name": "cover_url",
398 "type": "text",
399 "primaryKey": false,
400 "notNull": false,
401 "autoincrement": false
402 },
403 "position": {
404 "name": "position",
405 "type": "real",
406 "primaryKey": false,
407 "notNull": true,
408 "autoincrement": false
409 },
410 "created_by": {
411 "name": "created_by",
412 "type": "text",
413 "primaryKey": false,
414 "notNull": true,
415 "autoincrement": false
416 },
417 "created_at": {
418 "name": "created_at",
419 "type": "text",
420 "primaryKey": false,
421 "notNull": true,
422 "autoincrement": false,
423 "default": "(datetime('now'))"
424 },
425 "updated_at": {
426 "name": "updated_at",
427 "type": "text",
428 "primaryKey": false,
429 "notNull": true,
430 "autoincrement": false,
431 "default": "(datetime('now'))"
432 },
433 "archived_at": {
434 "name": "archived_at",
435 "type": "text",
436 "primaryKey": false,
437 "notNull": false,
438 "autoincrement": false
439 }
440 },
441 "indexes": {
442 "idx_pages_parent": {
443 "name": "idx_pages_parent",
444 "columns": [
445 "workspace_id",
446 "parent_id",
447 "position"
448 ],
449 "isUnique": false
450 },
451 "idx_pages_workspace": {
452 "name": "idx_pages_workspace",
453 "columns": [
454 "workspace_id",
455 "archived_at"
456 ],
457 "isUnique": false
458 }
459 },
460 "foreignKeys": {
461 "pages_workspace_id_workspaces_id_fk": {
462 "name": "pages_workspace_id_workspaces_id_fk",
463 "tableFrom": "pages",
464 "tableTo": "workspaces",
465 "columnsFrom": [
466 "workspace_id"
467 ],
468 "columnsTo": [
469 "id"
470 ],
471 "onDelete": "no action",
472 "onUpdate": "no action"
473 },
474 "pages_parent_id_pages_id_fk": {
475 "name": "pages_parent_id_pages_id_fk",
476 "tableFrom": "pages",
477 "tableTo": "pages",
478 "columnsFrom": [
479 "parent_id"
480 ],
481 "columnsTo": [
482 "id"
483 ],
484 "onDelete": "set null",
485 "onUpdate": "no action"
486 },
487 "pages_created_by_users_id_fk": {
488 "name": "pages_created_by_users_id_fk",
489 "tableFrom": "pages",
490 "tableTo": "users",
491 "columnsFrom": [
492 "created_by"
493 ],
494 "columnsTo": [
495 "id"
496 ],
497 "onDelete": "no action",
498 "onUpdate": "no action"
499 }
500 },
501 "compositePrimaryKeys": {},
502 "uniqueConstraints": {},
503 "checkConstraints": {}
504 },
505 "uploads": {
506 "name": "uploads",
507 "columns": {
508 "id": {
509 "name": "id",
510 "type": "text",
511 "primaryKey": true,
512 "notNull": true,
513 "autoincrement": false
514 },
515 "workspace_id": {
516 "name": "workspace_id",
517 "type": "text",
518 "primaryKey": false,
519 "notNull": true,
520 "autoincrement": false
521 },
522 "page_id": {
523 "name": "page_id",
524 "type": "text",
525 "primaryKey": false,
526 "notNull": false,
527 "autoincrement": false
528 },
529 "uploaded_by": {
530 "name": "uploaded_by",
531 "type": "text",
532 "primaryKey": false,
533 "notNull": true,
534 "autoincrement": false
535 },
536 "filename": {
537 "name": "filename",
538 "type": "text",
539 "primaryKey": false,
540 "notNull": true,
541 "autoincrement": false
542 },
543 "content_type": {
544 "name": "content_type",
545 "type": "text",
546 "primaryKey": false,
547 "notNull": true,
548 "autoincrement": false
549 },
550 "size_bytes": {
551 "name": "size_bytes",
552 "type": "integer",
553 "primaryKey": false,
554 "notNull": true,
555 "autoincrement": false
556 },
557 "r2_key": {
558 "name": "r2_key",
559 "type": "text",
560 "primaryKey": false,
561 "notNull": true,
562 "autoincrement": false
563 },
564 "created_at": {
565 "name": "created_at",
566 "type": "text",
567 "primaryKey": false,
568 "notNull": true,
569 "autoincrement": false,
570 "default": "(datetime('now'))"
571 }
572 },
573 "indexes": {},
574 "foreignKeys": {
575 "uploads_workspace_id_workspaces_id_fk": {
576 "name": "uploads_workspace_id_workspaces_id_fk",
577 "tableFrom": "uploads",
578 "tableTo": "workspaces",
579 "columnsFrom": [
580 "workspace_id"
581 ],
582 "columnsTo": [
583 "id"
584 ],
585 "onDelete": "no action",
586 "onUpdate": "no action"
587 },
588 "uploads_page_id_pages_id_fk": {
589 "name": "uploads_page_id_pages_id_fk",
590 "tableFrom": "uploads",
591 "tableTo": "pages",
592 "columnsFrom": [
593 "page_id"
594 ],
595 "columnsTo": [
596 "id"
597 ],
598 "onDelete": "no action",
599 "onUpdate": "no action"
600 },
601 "uploads_uploaded_by_users_id_fk": {
602 "name": "uploads_uploaded_by_users_id_fk",
603 "tableFrom": "uploads",
604 "tableTo": "users",
605 "columnsFrom": [
606 "uploaded_by"
607 ],
608 "columnsTo": [
609 "id"
610 ],
611 "onDelete": "no action",
612 "onUpdate": "no action"
613 }
614 },
615 "compositePrimaryKeys": {},
616 "uniqueConstraints": {},
617 "checkConstraints": {}
618 },
619 "users": {
620 "name": "users",
621 "columns": {
622 "id": {
623 "name": "id",
624 "type": "text",
625 "primaryKey": true,
626 "notNull": true,
627 "autoincrement": false
628 },
629 "email": {
630 "name": "email",
631 "type": "text",
632 "primaryKey": false,
633 "notNull": true,
634 "autoincrement": false
635 },
636 "password_hash": {
637 "name": "password_hash",
638 "type": "text",
639 "primaryKey": false,
640 "notNull": true,
641 "autoincrement": false
642 },
643 "name": {
644 "name": "name",
645 "type": "text",
646 "primaryKey": false,
647 "notNull": true,
648 "autoincrement": false
649 },
650 "avatar_url": {
651 "name": "avatar_url",
652 "type": "text",
653 "primaryKey": false,
654 "notNull": false,
655 "autoincrement": false
656 },
657 "created_at": {
658 "name": "created_at",
659 "type": "text",
660 "primaryKey": false,
661 "notNull": true,
662 "autoincrement": false,
663 "default": "(datetime('now'))"
664 },
665 "updated_at": {
666 "name": "updated_at",
667 "type": "text",
668 "primaryKey": false,
669 "notNull": true,
670 "autoincrement": false,
671 "default": "(datetime('now'))"
672 }
673 },
674 "indexes": {
675 "users_email_unique": {
676 "name": "users_email_unique",
677 "columns": [
678 "email"
679 ],
680 "isUnique": true
681 }
682 },
683 "foreignKeys": {},
684 "compositePrimaryKeys": {},
685 "uniqueConstraints": {},
686 "checkConstraints": {}
687 },
688 "workspaces": {
689 "name": "workspaces",
690 "columns": {
691 "id": {
692 "name": "id",
693 "type": "text",
694 "primaryKey": true,
695 "notNull": true,
696 "autoincrement": false
697 },
698 "name": {
699 "name": "name",
700 "type": "text",
701 "primaryKey": false,
702 "notNull": true,
703 "autoincrement": false
704 },
705 "slug": {
706 "name": "slug",
707 "type": "text",
708 "primaryKey": false,
709 "notNull": true,
710 "autoincrement": false
711 },
712 "icon": {
713 "name": "icon",
714 "type": "text",
715 "primaryKey": false,
716 "notNull": false,
717 "autoincrement": false
718 },
719 "owner_id": {
720 "name": "owner_id",
721 "type": "text",
722 "primaryKey": false,
723 "notNull": true,
724 "autoincrement": false
725 },
726 "created_at": {
727 "name": "created_at",
728 "type": "text",
729 "primaryKey": false,
730 "notNull": true,
731 "autoincrement": false,
732 "default": "(datetime('now'))"
733 }
734 },
735 "indexes": {
736 "workspaces_slug_unique": {
737 "name": "workspaces_slug_unique",
738 "columns": [
739 "slug"
740 ],
741 "isUnique": true
742 }
743 },
744 "foreignKeys": {
745 "workspaces_owner_id_users_id_fk": {
746 "name": "workspaces_owner_id_users_id_fk",
747 "tableFrom": "workspaces",
748 "tableTo": "users",
749 "columnsFrom": [
750 "owner_id"
751 ],
752 "columnsTo": [
753 "id"
754 ],
755 "onDelete": "no action",
756 "onUpdate": "no action"
757 }
758 },
759 "compositePrimaryKeys": {},
760 "uniqueConstraints": {},
761 "checkConstraints": {}
762 }
763 },
764 "views": {},
765 "enums": {},
766 "_meta": {
767 "schemas": {},
768 "tables": {},
769 "columns": {}
770 },
771 "internal": {
772 "indexes": {}
773 }
774}