Skip to content
File

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

json766 lines
1{
2 "version": "6",
3 "dialect": "sqlite",
4 "id": "14b234b7-283c-4e52-8623-dd9c89797303",
5 "prevId": "a04a2098-8e10-4234-9a68-54d23273439a",
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 "title": {
374 "name": "title",
375 "type": "text",
376 "primaryKey": false,
377 "notNull": true,
378 "autoincrement": false,
379 "default": "'Untitled'"
380 },
381 "icon": {
382 "name": "icon",
383 "type": "text",
384 "primaryKey": false,
385 "notNull": false,
386 "autoincrement": false
387 },
388 "cover_url": {
389 "name": "cover_url",
390 "type": "text",
391 "primaryKey": false,
392 "notNull": false,
393 "autoincrement": false
394 },
395 "position": {
396 "name": "position",
397 "type": "real",
398 "primaryKey": false,
399 "notNull": true,
400 "autoincrement": false
401 },
402 "created_by": {
403 "name": "created_by",
404 "type": "text",
405 "primaryKey": false,
406 "notNull": true,
407 "autoincrement": false
408 },
409 "created_at": {
410 "name": "created_at",
411 "type": "text",
412 "primaryKey": false,
413 "notNull": true,
414 "autoincrement": false,
415 "default": "(datetime('now'))"
416 },
417 "updated_at": {
418 "name": "updated_at",
419 "type": "text",
420 "primaryKey": false,
421 "notNull": true,
422 "autoincrement": false,
423 "default": "(datetime('now'))"
424 },
425 "archived_at": {
426 "name": "archived_at",
427 "type": "text",
428 "primaryKey": false,
429 "notNull": false,
430 "autoincrement": false
431 }
432 },
433 "indexes": {
434 "idx_pages_parent": {
435 "name": "idx_pages_parent",
436 "columns": [
437 "workspace_id",
438 "parent_id",
439 "position"
440 ],
441 "isUnique": false
442 },
443 "idx_pages_workspace": {
444 "name": "idx_pages_workspace",
445 "columns": [
446 "workspace_id",
447 "archived_at"
448 ],
449 "isUnique": false
450 }
451 },
452 "foreignKeys": {
453 "pages_workspace_id_workspaces_id_fk": {
454 "name": "pages_workspace_id_workspaces_id_fk",
455 "tableFrom": "pages",
456 "tableTo": "workspaces",
457 "columnsFrom": [
458 "workspace_id"
459 ],
460 "columnsTo": [
461 "id"
462 ],
463 "onDelete": "no action",
464 "onUpdate": "no action"
465 },
466 "pages_parent_id_pages_id_fk": {
467 "name": "pages_parent_id_pages_id_fk",
468 "tableFrom": "pages",
469 "tableTo": "pages",
470 "columnsFrom": [
471 "parent_id"
472 ],
473 "columnsTo": [
474 "id"
475 ],
476 "onDelete": "set null",
477 "onUpdate": "no action"
478 },
479 "pages_created_by_users_id_fk": {
480 "name": "pages_created_by_users_id_fk",
481 "tableFrom": "pages",
482 "tableTo": "users",
483 "columnsFrom": [
484 "created_by"
485 ],
486 "columnsTo": [
487 "id"
488 ],
489 "onDelete": "no action",
490 "onUpdate": "no action"
491 }
492 },
493 "compositePrimaryKeys": {},
494 "uniqueConstraints": {},
495 "checkConstraints": {}
496 },
497 "uploads": {
498 "name": "uploads",
499 "columns": {
500 "id": {
501 "name": "id",
502 "type": "text",
503 "primaryKey": true,
504 "notNull": true,
505 "autoincrement": false
506 },
507 "workspace_id": {
508 "name": "workspace_id",
509 "type": "text",
510 "primaryKey": false,
511 "notNull": true,
512 "autoincrement": false
513 },
514 "page_id": {
515 "name": "page_id",
516 "type": "text",
517 "primaryKey": false,
518 "notNull": false,
519 "autoincrement": false
520 },
521 "uploaded_by": {
522 "name": "uploaded_by",
523 "type": "text",
524 "primaryKey": false,
525 "notNull": true,
526 "autoincrement": false
527 },
528 "filename": {
529 "name": "filename",
530 "type": "text",
531 "primaryKey": false,
532 "notNull": true,
533 "autoincrement": false
534 },
535 "content_type": {
536 "name": "content_type",
537 "type": "text",
538 "primaryKey": false,
539 "notNull": true,
540 "autoincrement": false
541 },
542 "size_bytes": {
543 "name": "size_bytes",
544 "type": "integer",
545 "primaryKey": false,
546 "notNull": true,
547 "autoincrement": false
548 },
549 "r2_key": {
550 "name": "r2_key",
551 "type": "text",
552 "primaryKey": false,
553 "notNull": true,
554 "autoincrement": false
555 },
556 "created_at": {
557 "name": "created_at",
558 "type": "text",
559 "primaryKey": false,
560 "notNull": true,
561 "autoincrement": false,
562 "default": "(datetime('now'))"
563 }
564 },
565 "indexes": {},
566 "foreignKeys": {
567 "uploads_workspace_id_workspaces_id_fk": {
568 "name": "uploads_workspace_id_workspaces_id_fk",
569 "tableFrom": "uploads",
570 "tableTo": "workspaces",
571 "columnsFrom": [
572 "workspace_id"
573 ],
574 "columnsTo": [
575 "id"
576 ],
577 "onDelete": "no action",
578 "onUpdate": "no action"
579 },
580 "uploads_page_id_pages_id_fk": {
581 "name": "uploads_page_id_pages_id_fk",
582 "tableFrom": "uploads",
583 "tableTo": "pages",
584 "columnsFrom": [
585 "page_id"
586 ],
587 "columnsTo": [
588 "id"
589 ],
590 "onDelete": "no action",
591 "onUpdate": "no action"
592 },
593 "uploads_uploaded_by_users_id_fk": {
594 "name": "uploads_uploaded_by_users_id_fk",
595 "tableFrom": "uploads",
596 "tableTo": "users",
597 "columnsFrom": [
598 "uploaded_by"
599 ],
600 "columnsTo": [
601 "id"
602 ],
603 "onDelete": "no action",
604 "onUpdate": "no action"
605 }
606 },
607 "compositePrimaryKeys": {},
608 "uniqueConstraints": {},
609 "checkConstraints": {}
610 },
611 "users": {
612 "name": "users",
613 "columns": {
614 "id": {
615 "name": "id",
616 "type": "text",
617 "primaryKey": true,
618 "notNull": true,
619 "autoincrement": false
620 },
621 "email": {
622 "name": "email",
623 "type": "text",
624 "primaryKey": false,
625 "notNull": true,
626 "autoincrement": false
627 },
628 "password_hash": {
629 "name": "password_hash",
630 "type": "text",
631 "primaryKey": false,
632 "notNull": true,
633 "autoincrement": false
634 },
635 "name": {
636 "name": "name",
637 "type": "text",
638 "primaryKey": false,
639 "notNull": true,
640 "autoincrement": false
641 },
642 "avatar_url": {
643 "name": "avatar_url",
644 "type": "text",
645 "primaryKey": false,
646 "notNull": false,
647 "autoincrement": false
648 },
649 "created_at": {
650 "name": "created_at",
651 "type": "text",
652 "primaryKey": false,
653 "notNull": true,
654 "autoincrement": false,
655 "default": "(datetime('now'))"
656 },
657 "updated_at": {
658 "name": "updated_at",
659 "type": "text",
660 "primaryKey": false,
661 "notNull": true,
662 "autoincrement": false,
663 "default": "(datetime('now'))"
664 }
665 },
666 "indexes": {
667 "users_email_unique": {
668 "name": "users_email_unique",
669 "columns": [
670 "email"
671 ],
672 "isUnique": true
673 }
674 },
675 "foreignKeys": {},
676 "compositePrimaryKeys": {},
677 "uniqueConstraints": {},
678 "checkConstraints": {}
679 },
680 "workspaces": {
681 "name": "workspaces",
682 "columns": {
683 "id": {
684 "name": "id",
685 "type": "text",
686 "primaryKey": true,
687 "notNull": true,
688 "autoincrement": false
689 },
690 "name": {
691 "name": "name",
692 "type": "text",
693 "primaryKey": false,
694 "notNull": true,
695 "autoincrement": false
696 },
697 "slug": {
698 "name": "slug",
699 "type": "text",
700 "primaryKey": false,
701 "notNull": true,
702 "autoincrement": false
703 },
704 "icon": {
705 "name": "icon",
706 "type": "text",
707 "primaryKey": false,
708 "notNull": false,
709 "autoincrement": false
710 },
711 "owner_id": {
712 "name": "owner_id",
713 "type": "text",
714 "primaryKey": false,
715 "notNull": true,
716 "autoincrement": false
717 },
718 "created_at": {
719 "name": "created_at",
720 "type": "text",
721 "primaryKey": false,
722 "notNull": true,
723 "autoincrement": false,
724 "default": "(datetime('now'))"
725 }
726 },
727 "indexes": {
728 "workspaces_slug_unique": {
729 "name": "workspaces_slug_unique",
730 "columns": [
731 "slug"
732 ],
733 "isUnique": true
734 }
735 },
736 "foreignKeys": {
737 "workspaces_owner_id_users_id_fk": {
738 "name": "workspaces_owner_id_users_id_fk",
739 "tableFrom": "workspaces",
740 "tableTo": "users",
741 "columnsFrom": [
742 "owner_id"
743 ],
744 "columnsTo": [
745 "id"
746 ],
747 "onDelete": "no action",
748 "onUpdate": "no action"
749 }
750 },
751 "compositePrimaryKeys": {},
752 "uniqueConstraints": {},
753 "checkConstraints": {}
754 }
755 },
756 "views": {},
757 "enums": {},
758 "_meta": {
759 "schemas": {},
760 "tables": {},
761 "columns": {}
762 },
763 "internal": {
764 "indexes": {}
765 }
766}