Skip to content
File

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

json958 lines
1{
2 "version": "6",
3 "dialect": "sqlite",
4 "id": "a0b97f2d-90dc-4b36-8c58-b34dcca0a6e7",
5 "prevId": "5180bbfb-0ebe-468f-b3fc-970cded96315",
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 "published_pages": {
506 "name": "published_pages",
507 "columns": {
508 "workspace_id": {
509 "name": "workspace_id",
510 "type": "text",
511 "primaryKey": false,
512 "notNull": true,
513 "autoincrement": false
514 },
515 "page_id": {
516 "name": "page_id",
517 "type": "text",
518 "primaryKey": false,
519 "notNull": true,
520 "autoincrement": false
521 },
522 "published_by": {
523 "name": "published_by",
524 "type": "text",
525 "primaryKey": false,
526 "notNull": true,
527 "autoincrement": false
528 },
529 "published_at": {
530 "name": "published_at",
531 "type": "text",
532 "primaryKey": false,
533 "notNull": true,
534 "autoincrement": false,
535 "default": "(datetime('now'))"
536 }
537 },
538 "indexes": {
539 "idx_published_pages_page": {
540 "name": "idx_published_pages_page",
541 "columns": [
542 "page_id"
543 ],
544 "isUnique": false
545 }
546 },
547 "foreignKeys": {
548 "published_pages_workspace_id_workspaces_id_fk": {
549 "name": "published_pages_workspace_id_workspaces_id_fk",
550 "tableFrom": "published_pages",
551 "tableTo": "workspaces",
552 "columnsFrom": [
553 "workspace_id"
554 ],
555 "columnsTo": [
556 "id"
557 ],
558 "onDelete": "cascade",
559 "onUpdate": "no action"
560 },
561 "published_pages_page_id_pages_id_fk": {
562 "name": "published_pages_page_id_pages_id_fk",
563 "tableFrom": "published_pages",
564 "tableTo": "pages",
565 "columnsFrom": [
566 "page_id"
567 ],
568 "columnsTo": [
569 "id"
570 ],
571 "onDelete": "cascade",
572 "onUpdate": "no action"
573 },
574 "published_pages_published_by_users_id_fk": {
575 "name": "published_pages_published_by_users_id_fk",
576 "tableFrom": "published_pages",
577 "tableTo": "users",
578 "columnsFrom": [
579 "published_by"
580 ],
581 "columnsTo": [
582 "id"
583 ],
584 "onDelete": "no action",
585 "onUpdate": "no action"
586 }
587 },
588 "compositePrimaryKeys": {
589 "published_pages_workspace_id_page_id_pk": {
590 "columns": [
591 "workspace_id",
592 "page_id"
593 ],
594 "name": "published_pages_workspace_id_page_id_pk"
595 }
596 },
597 "uniqueConstraints": {},
598 "checkConstraints": {}
599 },
600 "uploads": {
601 "name": "uploads",
602 "columns": {
603 "id": {
604 "name": "id",
605 "type": "text",
606 "primaryKey": true,
607 "notNull": true,
608 "autoincrement": false
609 },
610 "workspace_id": {
611 "name": "workspace_id",
612 "type": "text",
613 "primaryKey": false,
614 "notNull": true,
615 "autoincrement": false
616 },
617 "page_id": {
618 "name": "page_id",
619 "type": "text",
620 "primaryKey": false,
621 "notNull": false,
622 "autoincrement": false
623 },
624 "uploaded_by": {
625 "name": "uploaded_by",
626 "type": "text",
627 "primaryKey": false,
628 "notNull": true,
629 "autoincrement": false
630 },
631 "filename": {
632 "name": "filename",
633 "type": "text",
634 "primaryKey": false,
635 "notNull": true,
636 "autoincrement": false
637 },
638 "content_type": {
639 "name": "content_type",
640 "type": "text",
641 "primaryKey": false,
642 "notNull": true,
643 "autoincrement": false
644 },
645 "size_bytes": {
646 "name": "size_bytes",
647 "type": "integer",
648 "primaryKey": false,
649 "notNull": true,
650 "autoincrement": false
651 },
652 "r2_key": {
653 "name": "r2_key",
654 "type": "text",
655 "primaryKey": false,
656 "notNull": true,
657 "autoincrement": false
658 },
659 "created_at": {
660 "name": "created_at",
661 "type": "text",
662 "primaryKey": false,
663 "notNull": true,
664 "autoincrement": false,
665 "default": "(datetime('now'))"
666 }
667 },
668 "indexes": {},
669 "foreignKeys": {
670 "uploads_workspace_id_workspaces_id_fk": {
671 "name": "uploads_workspace_id_workspaces_id_fk",
672 "tableFrom": "uploads",
673 "tableTo": "workspaces",
674 "columnsFrom": [
675 "workspace_id"
676 ],
677 "columnsTo": [
678 "id"
679 ],
680 "onDelete": "no action",
681 "onUpdate": "no action"
682 },
683 "uploads_page_id_pages_id_fk": {
684 "name": "uploads_page_id_pages_id_fk",
685 "tableFrom": "uploads",
686 "tableTo": "pages",
687 "columnsFrom": [
688 "page_id"
689 ],
690 "columnsTo": [
691 "id"
692 ],
693 "onDelete": "no action",
694 "onUpdate": "no action"
695 },
696 "uploads_uploaded_by_users_id_fk": {
697 "name": "uploads_uploaded_by_users_id_fk",
698 "tableFrom": "uploads",
699 "tableTo": "users",
700 "columnsFrom": [
701 "uploaded_by"
702 ],
703 "columnsTo": [
704 "id"
705 ],
706 "onDelete": "no action",
707 "onUpdate": "no action"
708 }
709 },
710 "compositePrimaryKeys": {},
711 "uniqueConstraints": {},
712 "checkConstraints": {}
713 },
714 "users": {
715 "name": "users",
716 "columns": {
717 "id": {
718 "name": "id",
719 "type": "text",
720 "primaryKey": true,
721 "notNull": true,
722 "autoincrement": false
723 },
724 "email": {
725 "name": "email",
726 "type": "text",
727 "primaryKey": false,
728 "notNull": true,
729 "autoincrement": false
730 },
731 "password_hash": {
732 "name": "password_hash",
733 "type": "text",
734 "primaryKey": false,
735 "notNull": true,
736 "autoincrement": false
737 },
738 "name": {
739 "name": "name",
740 "type": "text",
741 "primaryKey": false,
742 "notNull": true,
743 "autoincrement": false
744 },
745 "avatar_url": {
746 "name": "avatar_url",
747 "type": "text",
748 "primaryKey": false,
749 "notNull": false,
750 "autoincrement": false
751 },
752 "created_at": {
753 "name": "created_at",
754 "type": "text",
755 "primaryKey": false,
756 "notNull": true,
757 "autoincrement": false,
758 "default": "(datetime('now'))"
759 },
760 "updated_at": {
761 "name": "updated_at",
762 "type": "text",
763 "primaryKey": false,
764 "notNull": true,
765 "autoincrement": false,
766 "default": "(datetime('now'))"
767 }
768 },
769 "indexes": {
770 "users_email_unique": {
771 "name": "users_email_unique",
772 "columns": [
773 "email"
774 ],
775 "isUnique": true
776 }
777 },
778 "foreignKeys": {},
779 "compositePrimaryKeys": {},
780 "uniqueConstraints": {},
781 "checkConstraints": {}
782 },
783 "workspace_sites": {
784 "name": "workspace_sites",
785 "columns": {
786 "workspace_id": {
787 "name": "workspace_id",
788 "type": "text",
789 "primaryKey": true,
790 "notNull": true,
791 "autoincrement": false
792 },
793 "slug": {
794 "name": "slug",
795 "type": "text",
796 "primaryKey": false,
797 "notNull": true,
798 "autoincrement": false
799 },
800 "home_page_id": {
801 "name": "home_page_id",
802 "type": "text",
803 "primaryKey": false,
804 "notNull": false,
805 "autoincrement": false
806 },
807 "published_at": {
808 "name": "published_at",
809 "type": "text",
810 "primaryKey": false,
811 "notNull": false,
812 "autoincrement": false
813 },
814 "created_at": {
815 "name": "created_at",
816 "type": "text",
817 "primaryKey": false,
818 "notNull": true,
819 "autoincrement": false,
820 "default": "(datetime('now'))"
821 },
822 "updated_at": {
823 "name": "updated_at",
824 "type": "text",
825 "primaryKey": false,
826 "notNull": true,
827 "autoincrement": false,
828 "default": "(datetime('now'))"
829 }
830 },
831 "indexes": {
832 "workspace_sites_slug_unique": {
833 "name": "workspace_sites_slug_unique",
834 "columns": [
835 "slug"
836 ],
837 "isUnique": true
838 }
839 },
840 "foreignKeys": {
841 "workspace_sites_workspace_id_workspaces_id_fk": {
842 "name": "workspace_sites_workspace_id_workspaces_id_fk",
843 "tableFrom": "workspace_sites",
844 "tableTo": "workspaces",
845 "columnsFrom": [
846 "workspace_id"
847 ],
848 "columnsTo": [
849 "id"
850 ],
851 "onDelete": "cascade",
852 "onUpdate": "no action"
853 },
854 "workspace_sites_home_page_id_pages_id_fk": {
855 "name": "workspace_sites_home_page_id_pages_id_fk",
856 "tableFrom": "workspace_sites",
857 "tableTo": "pages",
858 "columnsFrom": [
859 "home_page_id"
860 ],
861 "columnsTo": [
862 "id"
863 ],
864 "onDelete": "set null",
865 "onUpdate": "no action"
866 }
867 },
868 "compositePrimaryKeys": {},
869 "uniqueConstraints": {},
870 "checkConstraints": {}
871 },
872 "workspaces": {
873 "name": "workspaces",
874 "columns": {
875 "id": {
876 "name": "id",
877 "type": "text",
878 "primaryKey": true,
879 "notNull": true,
880 "autoincrement": false
881 },
882 "name": {
883 "name": "name",
884 "type": "text",
885 "primaryKey": false,
886 "notNull": true,
887 "autoincrement": false
888 },
889 "slug": {
890 "name": "slug",
891 "type": "text",
892 "primaryKey": false,
893 "notNull": true,
894 "autoincrement": false
895 },
896 "icon": {
897 "name": "icon",
898 "type": "text",
899 "primaryKey": false,
900 "notNull": false,
901 "autoincrement": false
902 },
903 "owner_id": {
904 "name": "owner_id",
905 "type": "text",
906 "primaryKey": false,
907 "notNull": true,
908 "autoincrement": false
909 },
910 "created_at": {
911 "name": "created_at",
912 "type": "text",
913 "primaryKey": false,
914 "notNull": true,
915 "autoincrement": false,
916 "default": "(datetime('now'))"
917 }
918 },
919 "indexes": {
920 "workspaces_slug_unique": {
921 "name": "workspaces_slug_unique",
922 "columns": [
923 "slug"
924 ],
925 "isUnique": true
926 }
927 },
928 "foreignKeys": {
929 "workspaces_owner_id_users_id_fk": {
930 "name": "workspaces_owner_id_users_id_fk",
931 "tableFrom": "workspaces",
932 "tableTo": "users",
933 "columnsFrom": [
934 "owner_id"
935 ],
936 "columnsTo": [
937 "id"
938 ],
939 "onDelete": "no action",
940 "onUpdate": "no action"
941 }
942 },
943 "compositePrimaryKeys": {},
944 "uniqueConstraints": {},
945 "checkConstraints": {}
946 }
947 },
948 "views": {},
949 "enums": {},
950 "_meta": {
951 "schemas": {},
952 "tables": {},
953 "columns": {}
954 },
955 "internal": {
956 "indexes": {}
957 }
958}