Skip to content
File

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

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