spb/note-spboucher-ai
Public
1{2 "id": "3a5f835e-6b18-4c3b-b562-8dded8643c79",3 "prevId": "00000000-0000-0000-0000-000000000000",4 "version": "7",5 "dialect": "postgresql",6 "tables": {7 "public.ai_comparisons": {8 "name": "ai_comparisons",9 "schema": "",10 "columns": {11 "id": {12 "name": "id",13 "type": "uuid",14 "primaryKey": true,15 "notNull": true,16 "default": "gen_random_uuid()"17 },18 "workspace_id": {19 "name": "workspace_id",20 "type": "uuid",21 "primaryKey": false,22 "notNull": true23 },24 "prompt": {25 "name": "prompt",26 "type": "text",27 "primaryKey": false,28 "notNull": true29 },30 "models": {31 "name": "models",32 "type": "jsonb",33 "primaryKey": false,34 "notNull": true35 },36 "results": {37 "name": "results",38 "type": "jsonb",39 "primaryKey": false,40 "notNull": true,41 "default": "'[]'::jsonb"42 },43 "created_at": {44 "name": "created_at",45 "type": "timestamp with time zone",46 "primaryKey": false,47 "notNull": true,48 "default": "now()"49 }50 },51 "indexes": {},52 "foreignKeys": {53 "ai_comparisons_workspace_id_workspaces_id_fk": {54 "name": "ai_comparisons_workspace_id_workspaces_id_fk",55 "tableFrom": "ai_comparisons",56 "tableTo": "workspaces",57 "columnsFrom": [58 "workspace_id"59 ],60 "columnsTo": [61 "id"62 ],63 "onDelete": "cascade",64 "onUpdate": "no action"65 }66 },67 "compositePrimaryKeys": {},68 "uniqueConstraints": {},69 "policies": {},70 "checkConstraints": {},71 "isRLSEnabled": false72 },73 "public.ai_conversations": {74 "name": "ai_conversations",75 "schema": "",76 "columns": {77 "id": {78 "name": "id",79 "type": "uuid",80 "primaryKey": true,81 "notNull": true,82 "default": "gen_random_uuid()"83 },84 "workspace_id": {85 "name": "workspace_id",86 "type": "uuid",87 "primaryKey": false,88 "notNull": true89 },90 "title": {91 "name": "title",92 "type": "text",93 "primaryKey": false,94 "notNull": true,95 "default": "'New conversation'"96 },97 "page_id": {98 "name": "page_id",99 "type": "uuid",100 "primaryKey": false,101 "notNull": false102 },103 "model": {104 "name": "model",105 "type": "text",106 "primaryKey": false,107 "notNull": false108 },109 "routing": {110 "name": "routing",111 "type": "text",112 "primaryKey": false,113 "notNull": false,114 "default": "'auto'"115 },116 "pinned": {117 "name": "pinned",118 "type": "boolean",119 "primaryKey": false,120 "notNull": true,121 "default": false122 },123 "created_at": {124 "name": "created_at",125 "type": "timestamp with time zone",126 "primaryKey": false,127 "notNull": true,128 "default": "now()"129 },130 "updated_at": {131 "name": "updated_at",132 "type": "timestamp with time zone",133 "primaryKey": false,134 "notNull": true,135 "default": "now()"136 },137 "deleted_at": {138 "name": "deleted_at",139 "type": "timestamp with time zone",140 "primaryKey": false,141 "notNull": false142 }143 },144 "indexes": {145 "ai_conv_ws_idx": {146 "name": "ai_conv_ws_idx",147 "columns": [148 {149 "expression": "workspace_id",150 "isExpression": false,151 "asc": true,152 "nulls": "last"153 },154 {155 "expression": "updated_at",156 "isExpression": false,157 "asc": true,158 "nulls": "last"159 }160 ],161 "isUnique": false,162 "concurrently": false,163 "method": "btree",164 "with": {}165 }166 },167 "foreignKeys": {168 "ai_conversations_workspace_id_workspaces_id_fk": {169 "name": "ai_conversations_workspace_id_workspaces_id_fk",170 "tableFrom": "ai_conversations",171 "tableTo": "workspaces",172 "columnsFrom": [173 "workspace_id"174 ],175 "columnsTo": [176 "id"177 ],178 "onDelete": "cascade",179 "onUpdate": "no action"180 },181 "ai_conversations_page_id_pages_id_fk": {182 "name": "ai_conversations_page_id_pages_id_fk",183 "tableFrom": "ai_conversations",184 "tableTo": "pages",185 "columnsFrom": [186 "page_id"187 ],188 "columnsTo": [189 "id"190 ],191 "onDelete": "set null",192 "onUpdate": "no action"193 }194 },195 "compositePrimaryKeys": {},196 "uniqueConstraints": {},197 "policies": {},198 "checkConstraints": {},199 "isRLSEnabled": false200 },201 "public.ai_executions": {202 "name": "ai_executions",203 "schema": "",204 "columns": {205 "id": {206 "name": "id",207 "type": "uuid",208 "primaryKey": true,209 "notNull": true,210 "default": "gen_random_uuid()"211 },212 "workspace_id": {213 "name": "workspace_id",214 "type": "uuid",215 "primaryKey": false,216 "notNull": true217 },218 "agent": {219 "name": "agent",220 "type": "text",221 "primaryKey": false,222 "notNull": true223 },224 "task": {225 "name": "task",226 "type": "text",227 "primaryKey": false,228 "notNull": true229 },230 "model": {231 "name": "model",232 "type": "text",233 "primaryKey": false,234 "notNull": false235 },236 "status": {237 "name": "status",238 "type": "text",239 "primaryKey": false,240 "notNull": true,241 "default": "'pending'"242 },243 "scopes": {244 "name": "scopes",245 "type": "jsonb",246 "primaryKey": false,247 "notNull": true,248 "default": "'[]'::jsonb"249 },250 "tools_invoked": {251 "name": "tools_invoked",252 "type": "jsonb",253 "primaryKey": false,254 "notNull": false,255 "default": "'[]'::jsonb"256 },257 "documents_accessed": {258 "name": "documents_accessed",259 "type": "jsonb",260 "primaryKey": false,261 "notNull": false,262 "default": "'[]'::jsonb"263 },264 "proposed_changes": {265 "name": "proposed_changes",266 "type": "jsonb",267 "primaryKey": false,268 "notNull": false,269 "default": "'[]'::jsonb"270 },271 "approvals": {272 "name": "approvals",273 "type": "jsonb",274 "primaryKey": false,275 "notNull": false,276 "default": "'[]'::jsonb"277 },278 "outcome": {279 "name": "outcome",280 "type": "text",281 "primaryKey": false,282 "notNull": false283 },284 "result": {285 "name": "result",286 "type": "text",287 "primaryKey": false,288 "notNull": false289 },290 "error": {291 "name": "error",292 "type": "text",293 "primaryKey": false,294 "notNull": false295 },296 "cost_usd": {297 "name": "cost_usd",298 "type": "double precision",299 "primaryKey": false,300 "notNull": false,301 "default": 0302 },303 "tokens_in": {304 "name": "tokens_in",305 "type": "integer",306 "primaryKey": false,307 "notNull": false,308 "default": 0309 },310 "tokens_out": {311 "name": "tokens_out",312 "type": "integer",313 "primaryKey": false,314 "notNull": false,315 "default": 0316 },317 "created_at": {318 "name": "created_at",319 "type": "timestamp with time zone",320 "primaryKey": false,321 "notNull": true,322 "default": "now()"323 },324 "started_at": {325 "name": "started_at",326 "type": "timestamp with time zone",327 "primaryKey": false,328 "notNull": false329 },330 "finished_at": {331 "name": "finished_at",332 "type": "timestamp with time zone",333 "primaryKey": false,334 "notNull": false335 }336 },337 "indexes": {338 "ai_exec_ws_idx": {339 "name": "ai_exec_ws_idx",340 "columns": [341 {342 "expression": "workspace_id",343 "isExpression": false,344 "asc": true,345 "nulls": "last"346 },347 {348 "expression": "created_at",349 "isExpression": false,350 "asc": true,351 "nulls": "last"352 }353 ],354 "isUnique": false,355 "concurrently": false,356 "method": "btree",357 "with": {}358 }359 },360 "foreignKeys": {361 "ai_executions_workspace_id_workspaces_id_fk": {362 "name": "ai_executions_workspace_id_workspaces_id_fk",363 "tableFrom": "ai_executions",364 "tableTo": "workspaces",365 "columnsFrom": [366 "workspace_id"367 ],368 "columnsTo": [369 "id"370 ],371 "onDelete": "cascade",372 "onUpdate": "no action"373 }374 },375 "compositePrimaryKeys": {},376 "uniqueConstraints": {},377 "policies": {},378 "checkConstraints": {},379 "isRLSEnabled": false380 },381 "public.ai_messages": {382 "name": "ai_messages",383 "schema": "",384 "columns": {385 "id": {386 "name": "id",387 "type": "uuid",388 "primaryKey": true,389 "notNull": true,390 "default": "gen_random_uuid()"391 },392 "conversation_id": {393 "name": "conversation_id",394 "type": "uuid",395 "primaryKey": false,396 "notNull": true397 },398 "role": {399 "name": "role",400 "type": "text",401 "primaryKey": false,402 "notNull": true403 },404 "content": {405 "name": "content",406 "type": "text",407 "primaryKey": false,408 "notNull": true409 },410 "model": {411 "name": "model",412 "type": "text",413 "primaryKey": false,414 "notNull": false415 },416 "provider": {417 "name": "provider",418 "type": "text",419 "primaryKey": false,420 "notNull": false421 },422 "sources": {423 "name": "sources",424 "type": "jsonb",425 "primaryKey": false,426 "notNull": false,427 "default": "'[]'::jsonb"428 },429 "usage": {430 "name": "usage",431 "type": "jsonb",432 "primaryKey": false,433 "notNull": false,434 "default": "'{}'::jsonb"435 },436 "cost_usd": {437 "name": "cost_usd",438 "type": "double precision",439 "primaryKey": false,440 "notNull": false441 },442 "latency_ms": {443 "name": "latency_ms",444 "type": "integer",445 "primaryKey": false,446 "notNull": false447 },448 "ttft_ms": {449 "name": "ttft_ms",450 "type": "integer",451 "primaryKey": false,452 "notNull": false453 },454 "meta": {455 "name": "meta",456 "type": "jsonb",457 "primaryKey": false,458 "notNull": false,459 "default": "'{}'::jsonb"460 },461 "created_at": {462 "name": "created_at",463 "type": "timestamp with time zone",464 "primaryKey": false,465 "notNull": true,466 "default": "now()"467 }468 },469 "indexes": {470 "ai_msgs_conv_idx": {471 "name": "ai_msgs_conv_idx",472 "columns": [473 {474 "expression": "conversation_id",475 "isExpression": false,476 "asc": true,477 "nulls": "last"478 },479 {480 "expression": "created_at",481 "isExpression": false,482 "asc": true,483 "nulls": "last"484 }485 ],486 "isUnique": false,487 "concurrently": false,488 "method": "btree",489 "with": {}490 }491 },492 "foreignKeys": {493 "ai_messages_conversation_id_ai_conversations_id_fk": {494 "name": "ai_messages_conversation_id_ai_conversations_id_fk",495 "tableFrom": "ai_messages",496 "tableTo": "ai_conversations",497 "columnsFrom": [498 "conversation_id"499 ],500 "columnsTo": [501 "id"502 ],503 "onDelete": "cascade",504 "onUpdate": "no action"505 }506 },507 "compositePrimaryKeys": {},508 "uniqueConstraints": {},509 "policies": {},510 "checkConstraints": {},511 "isRLSEnabled": false512 },513 "public.ai_models": {514 "name": "ai_models",515 "schema": "",516 "columns": {517 "id": {518 "name": "id",519 "type": "text",520 "primaryKey": true,521 "notNull": true522 },523 "provider": {524 "name": "provider",525 "type": "text",526 "primaryKey": false,527 "notNull": true528 },529 "display_name": {530 "name": "display_name",531 "type": "text",532 "primaryKey": false,533 "notNull": false534 },535 "category": {536 "name": "category",537 "type": "text",538 "primaryKey": false,539 "notNull": true,540 "default": "'text'"541 },542 "available": {543 "name": "available",544 "type": "boolean",545 "primaryKey": false,546 "notNull": true,547 "default": true548 },549 "enabled": {550 "name": "enabled",551 "type": "boolean",552 "primaryKey": false,553 "notNull": true,554 "default": true555 },556 "context_window": {557 "name": "context_window",558 "type": "integer",559 "primaryKey": false,560 "notNull": false561 },562 "max_output": {563 "name": "max_output",564 "type": "integer",565 "primaryKey": false,566 "notNull": false567 },568 "input_price": {569 "name": "input_price",570 "type": "double precision",571 "primaryKey": false,572 "notNull": false573 },574 "cached_price": {575 "name": "cached_price",576 "type": "double precision",577 "primaryKey": false,578 "notNull": false579 },580 "output_price": {581 "name": "output_price",582 "type": "double precision",583 "primaryKey": false,584 "notNull": false585 },586 "pricing_source": {587 "name": "pricing_source",588 "type": "text",589 "primaryKey": false,590 "notNull": false591 },592 "probes": {593 "name": "probes",594 "type": "jsonb",595 "primaryKey": false,596 "notNull": false,597 "default": "'{}'::jsonb"598 },599 "benchmark": {600 "name": "benchmark",601 "type": "jsonb",602 "primaryKey": false,603 "notNull": false,604 "default": "'{}'::jsonb"605 },606 "capabilities": {607 "name": "capabilities",608 "type": "jsonb",609 "primaryKey": false,610 "notNull": false,611 "default": "'{}'::jsonb"612 },613 "notes": {614 "name": "notes",615 "type": "jsonb",616 "primaryKey": false,617 "notNull": false,618 "default": "'[]'::jsonb"619 },620 "discovered_at": {621 "name": "discovered_at",622 "type": "timestamp with time zone",623 "primaryKey": false,624 "notNull": false625 },626 "probed_at": {627 "name": "probed_at",628 "type": "timestamp with time zone",629 "primaryKey": false,630 "notNull": false631 },632 "benchmarked_at": {633 "name": "benchmarked_at",634 "type": "timestamp with time zone",635 "primaryKey": false,636 "notNull": false637 },638 "created_at": {639 "name": "created_at",640 "type": "timestamp with time zone",641 "primaryKey": false,642 "notNull": true,643 "default": "now()"644 },645 "updated_at": {646 "name": "updated_at",647 "type": "timestamp with time zone",648 "primaryKey": false,649 "notNull": true,650 "default": "now()"651 }652 },653 "indexes": {},654 "foreignKeys": {655 "ai_models_provider_ai_providers_id_fk": {656 "name": "ai_models_provider_ai_providers_id_fk",657 "tableFrom": "ai_models",658 "tableTo": "ai_providers",659 "columnsFrom": [660 "provider"661 ],662 "columnsTo": [663 "id"664 ],665 "onDelete": "no action",666 "onUpdate": "no action"667 }668 },669 "compositePrimaryKeys": {},670 "uniqueConstraints": {},671 "policies": {},672 "checkConstraints": {},673 "isRLSEnabled": false674 },675 "public.ai_providers": {676 "name": "ai_providers",677 "schema": "",678 "columns": {679 "id": {680 "name": "id",681 "type": "text",682 "primaryKey": true,683 "notNull": true684 },685 "name": {686 "name": "name",687 "type": "text",688 "primaryKey": false,689 "notNull": true690 },691 "enabled": {692 "name": "enabled",693 "type": "boolean",694 "primaryKey": false,695 "notNull": true,696 "default": true697 },698 "last_discovery_at": {699 "name": "last_discovery_at",700 "type": "timestamp with time zone",701 "primaryKey": false,702 "notNull": false703 },704 "status": {705 "name": "status",706 "type": "text",707 "primaryKey": false,708 "notNull": false,709 "default": "'unknown'"710 },711 "status_detail": {712 "name": "status_detail",713 "type": "text",714 "primaryKey": false,715 "notNull": false716 }717 },718 "indexes": {},719 "foreignKeys": {},720 "compositePrimaryKeys": {},721 "uniqueConstraints": {},722 "policies": {},723 "checkConstraints": {},724 "isRLSEnabled": false725 },726 "public.ai_usage": {727 "name": "ai_usage",728 "schema": "",729 "columns": {730 "id": {731 "name": "id",732 "type": "uuid",733 "primaryKey": true,734 "notNull": true,735 "default": "gen_random_uuid()"736 },737 "workspace_id": {738 "name": "workspace_id",739 "type": "uuid",740 "primaryKey": false,741 "notNull": false742 },743 "provider": {744 "name": "provider",745 "type": "text",746 "primaryKey": false,747 "notNull": true748 },749 "model": {750 "name": "model",751 "type": "text",752 "primaryKey": false,753 "notNull": true754 },755 "task": {756 "name": "task",757 "type": "text",758 "primaryKey": false,759 "notNull": true760 },761 "input_tokens": {762 "name": "input_tokens",763 "type": "integer",764 "primaryKey": false,765 "notNull": true,766 "default": 0767 },768 "output_tokens": {769 "name": "output_tokens",770 "type": "integer",771 "primaryKey": false,772 "notNull": true,773 "default": 0774 },775 "cached_tokens": {776 "name": "cached_tokens",777 "type": "integer",778 "primaryKey": false,779 "notNull": false,780 "default": 0781 },782 "reasoning_tokens": {783 "name": "reasoning_tokens",784 "type": "integer",785 "primaryKey": false,786 "notNull": false,787 "default": 0788 },789 "cost_usd": {790 "name": "cost_usd",791 "type": "double precision",792 "primaryKey": false,793 "notNull": false794 },795 "latency_ms": {796 "name": "latency_ms",797 "type": "integer",798 "primaryKey": false,799 "notNull": false800 },801 "ttft_ms": {802 "name": "ttft_ms",803 "type": "integer",804 "primaryKey": false,805 "notNull": false806 },807 "ok": {808 "name": "ok",809 "type": "boolean",810 "primaryKey": false,811 "notNull": true,812 "default": true813 },814 "error": {815 "name": "error",816 "type": "text",817 "primaryKey": false,818 "notNull": false819 },820 "ref_id": {821 "name": "ref_id",822 "type": "uuid",823 "primaryKey": false,824 "notNull": false825 },826 "created_at": {827 "name": "created_at",828 "type": "timestamp with time zone",829 "primaryKey": false,830 "notNull": true,831 "default": "now()"832 }833 },834 "indexes": {835 "ai_usage_created_idx": {836 "name": "ai_usage_created_idx",837 "columns": [838 {839 "expression": "created_at",840 "isExpression": false,841 "asc": true,842 "nulls": "last"843 }844 ],845 "isUnique": false,846 "concurrently": false,847 "method": "btree",848 "with": {}849 }850 },851 "foreignKeys": {},852 "compositePrimaryKeys": {},853 "uniqueConstraints": {},854 "policies": {},855 "checkConstraints": {},856 "isRLSEnabled": false857 },858 "public.attachments": {859 "name": "attachments",860 "schema": "",861 "columns": {862 "id": {863 "name": "id",864 "type": "uuid",865 "primaryKey": true,866 "notNull": true,867 "default": "gen_random_uuid()"868 },869 "workspace_id": {870 "name": "workspace_id",871 "type": "uuid",872 "primaryKey": false,873 "notNull": true874 },875 "page_id": {876 "name": "page_id",877 "type": "uuid",878 "primaryKey": false,879 "notNull": false880 },881 "filename": {882 "name": "filename",883 "type": "text",884 "primaryKey": false,885 "notNull": true886 },887 "mime": {888 "name": "mime",889 "type": "text",890 "primaryKey": false,891 "notNull": true892 },893 "size": {894 "name": "size",895 "type": "bigint",896 "primaryKey": false,897 "notNull": true898 },899 "sha256": {900 "name": "sha256",901 "type": "text",902 "primaryKey": false,903 "notNull": true904 },905 "storage_path": {906 "name": "storage_path",907 "type": "text",908 "primaryKey": false,909 "notNull": true910 },911 "extracted_text": {912 "name": "extracted_text",913 "type": "text",914 "primaryKey": false,915 "notNull": false916 },917 "page_count": {918 "name": "page_count",919 "type": "integer",920 "primaryKey": false,921 "notNull": false922 },923 "meta": {924 "name": "meta",925 "type": "jsonb",926 "primaryKey": false,927 "notNull": false,928 "default": "'{}'::jsonb"929 },930 "created_at": {931 "name": "created_at",932 "type": "timestamp with time zone",933 "primaryKey": false,934 "notNull": true,935 "default": "now()"936 },937 "deleted_at": {938 "name": "deleted_at",939 "type": "timestamp with time zone",940 "primaryKey": false,941 "notNull": false942 }943 },944 "indexes": {945 "attachments_page_idx": {946 "name": "attachments_page_idx",947 "columns": [948 {949 "expression": "page_id",950 "isExpression": false,951 "asc": true,952 "nulls": "last"953 }954 ],955 "isUnique": false,956 "concurrently": false,957 "method": "btree",958 "with": {}959 },960 "attachments_sha_idx": {961 "name": "attachments_sha_idx",962 "columns": [963 {964 "expression": "sha256",965 "isExpression": false,966 "asc": true,967 "nulls": "last"968 }969 ],970 "isUnique": false,971 "concurrently": false,972 "method": "btree",973 "with": {}974 }975 },976 "foreignKeys": {977 "attachments_workspace_id_workspaces_id_fk": {978 "name": "attachments_workspace_id_workspaces_id_fk",979 "tableFrom": "attachments",980 "tableTo": "workspaces",981 "columnsFrom": [982 "workspace_id"983 ],984 "columnsTo": [985 "id"986 ],987 "onDelete": "cascade",988 "onUpdate": "no action"989 },990 "attachments_page_id_pages_id_fk": {991 "name": "attachments_page_id_pages_id_fk",992 "tableFrom": "attachments",993 "tableTo": "pages",994 "columnsFrom": [995 "page_id"996 ],997 "columnsTo": [998 "id"999 ],1000 "onDelete": "set null",1001 "onUpdate": "no action"1002 }1003 },1004 "compositePrimaryKeys": {},1005 "uniqueConstraints": {},1006 "policies": {},1007 "checkConstraints": {},1008 "isRLSEnabled": false1009 },1010 "public.audit_logs": {1011 "name": "audit_logs",1012 "schema": "",1013 "columns": {1014 "id": {1015 "name": "id",1016 "type": "uuid",1017 "primaryKey": true,1018 "notNull": true,1019 "default": "gen_random_uuid()"1020 },1021 "user_id": {1022 "name": "user_id",1023 "type": "uuid",1024 "primaryKey": false,1025 "notNull": false1026 },1027 "action": {1028 "name": "action",1029 "type": "text",1030 "primaryKey": false,1031 "notNull": true1032 },1033 "target_type": {1034 "name": "target_type",1035 "type": "text",1036 "primaryKey": false,1037 "notNull": false1038 },1039 "target_id": {1040 "name": "target_id",1041 "type": "text",1042 "primaryKey": false,1043 "notNull": false1044 },1045 "detail": {1046 "name": "detail",1047 "type": "jsonb",1048 "primaryKey": false,1049 "notNull": false,1050 "default": "'{}'::jsonb"1051 },1052 "ip": {1053 "name": "ip",1054 "type": "text",1055 "primaryKey": false,1056 "notNull": false1057 },1058 "created_at": {1059 "name": "created_at",1060 "type": "timestamp with time zone",1061 "primaryKey": false,1062 "notNull": true,1063 "default": "now()"1064 }1065 },1066 "indexes": {1067 "audit_created_idx": {1068 "name": "audit_created_idx",1069 "columns": [1070 {1071 "expression": "created_at",1072 "isExpression": false,1073 "asc": true,1074 "nulls": "last"1075 }1076 ],1077 "isUnique": false,1078 "concurrently": false,1079 "method": "btree",1080 "with": {}1081 }1082 },1083 "foreignKeys": {},1084 "compositePrimaryKeys": {},1085 "uniqueConstraints": {},1086 "policies": {},1087 "checkConstraints": {},1088 "isRLSEnabled": false1089 },1090 "public.backup_jobs": {1091 "name": "backup_jobs",1092 "schema": "",1093 "columns": {1094 "id": {1095 "name": "id",1096 "type": "uuid",1097 "primaryKey": true,1098 "notNull": true,1099 "default": "gen_random_uuid()"1100 },1101 "kind": {1102 "name": "kind",1103 "type": "text",1104 "primaryKey": false,1105 "notNull": true,1106 "default": "'full'"1107 },1108 "status": {1109 "name": "status",1110 "type": "text",1111 "primaryKey": false,1112 "notNull": true,1113 "default": "'running'"1114 },1115 "path": {1116 "name": "path",1117 "type": "text",1118 "primaryKey": false,1119 "notNull": false1120 },1121 "size_bytes": {1122 "name": "size_bytes",1123 "type": "bigint",1124 "primaryKey": false,1125 "notNull": false1126 },1127 "sha256": {1128 "name": "sha256",1129 "type": "text",1130 "primaryKey": false,1131 "notNull": false1132 },1133 "offsite": {1134 "name": "offsite",1135 "type": "boolean",1136 "primaryKey": false,1137 "notNull": false,1138 "default": false1139 },1140 "error": {1141 "name": "error",1142 "type": "text",1143 "primaryKey": false,1144 "notNull": false1145 },1146 "started_at": {1147 "name": "started_at",1148 "type": "timestamp with time zone",1149 "primaryKey": false,1150 "notNull": true,1151 "default": "now()"1152 },1153 "finished_at": {1154 "name": "finished_at",1155 "type": "timestamp with time zone",1156 "primaryKey": false,1157 "notNull": false1158 }1159 },1160 "indexes": {},1161 "foreignKeys": {},1162 "compositePrimaryKeys": {},1163 "uniqueConstraints": {},1164 "policies": {},1165 "checkConstraints": {},1166 "isRLSEnabled": false1167 },1168 "public.chunks": {1169 "name": "chunks",1170 "schema": "",1171 "columns": {1172 "id": {1173 "name": "id",1174 "type": "uuid",1175 "primaryKey": true,1176 "notNull": true,1177 "default": "gen_random_uuid()"1178 },1179 "workspace_id": {1180 "name": "workspace_id",1181 "type": "uuid",1182 "primaryKey": false,1183 "notNull": true1184 },1185 "source_type": {1186 "name": "source_type",1187 "type": "text",1188 "primaryKey": false,1189 "notNull": true1190 },1191 "source_id": {1192 "name": "source_id",1193 "type": "uuid",1194 "primaryKey": false,1195 "notNull": true1196 },1197 "page_id": {1198 "name": "page_id",1199 "type": "uuid",1200 "primaryKey": false,1201 "notNull": false1202 },1203 "ordinal": {1204 "name": "ordinal",1205 "type": "integer",1206 "primaryKey": false,1207 "notNull": true1208 },1209 "block_id": {1210 "name": "block_id",1211 "type": "text",1212 "primaryKey": false,1213 "notNull": false1214 },1215 "heading": {1216 "name": "heading",1217 "type": "text",1218 "primaryKey": false,1219 "notNull": false1220 },1221 "content": {1222 "name": "content",1223 "type": "text",1224 "primaryKey": false,1225 "notNull": true1226 },1227 "token_count": {1228 "name": "token_count",1229 "type": "integer",1230 "primaryKey": false,1231 "notNull": true,1232 "default": 01233 },1234 "content_hash": {1235 "name": "content_hash",1236 "type": "text",1237 "primaryKey": false,1238 "notNull": true1239 },1240 "tsv": {1241 "name": "tsv",1242 "type": "tsvector",1243 "primaryKey": false,1244 "notNull": false,1245 "generated": {1246 "as": "to_tsvector('simple', coalesce(heading,'') || ' ' || content)",1247 "type": "stored"1248 }1249 },1250 "created_at": {1251 "name": "created_at",1252 "type": "timestamp with time zone",1253 "primaryKey": false,1254 "notNull": true,1255 "default": "now()"1256 }1257 },1258 "indexes": {1259 "chunks_source_idx": {1260 "name": "chunks_source_idx",1261 "columns": [1262 {1263 "expression": "source_type",1264 "isExpression": false,1265 "asc": true,1266 "nulls": "last"1267 },1268 {1269 "expression": "source_id",1270 "isExpression": false,1271 "asc": true,1272 "nulls": "last"1273 }1274 ],1275 "isUnique": false,1276 "concurrently": false,1277 "method": "btree",1278 "with": {}1279 },1280 "chunks_tsv_idx": {1281 "name": "chunks_tsv_idx",1282 "columns": [1283 {1284 "expression": "tsv",1285 "isExpression": false,1286 "asc": true,1287 "nulls": "last"1288 }1289 ],1290 "isUnique": false,1291 "concurrently": false,1292 "method": "gin",1293 "with": {}1294 },1295 "chunks_unique": {1296 "name": "chunks_unique",1297 "columns": [1298 {1299 "expression": "source_type",1300 "isExpression": false,1301 "asc": true,1302 "nulls": "last"1303 },1304 {1305 "expression": "source_id",1306 "isExpression": false,1307 "asc": true,1308 "nulls": "last"1309 },1310 {1311 "expression": "ordinal",1312 "isExpression": false,1313 "asc": true,1314 "nulls": "last"1315 }1316 ],1317 "isUnique": true,1318 "concurrently": false,1319 "method": "btree",1320 "with": {}1321 }1322 },1323 "foreignKeys": {1324 "chunks_workspace_id_workspaces_id_fk": {1325 "name": "chunks_workspace_id_workspaces_id_fk",1326 "tableFrom": "chunks",1327 "tableTo": "workspaces",1328 "columnsFrom": [1329 "workspace_id"1330 ],1331 "columnsTo": [1332 "id"1333 ],1334 "onDelete": "cascade",1335 "onUpdate": "no action"1336 }1337 },1338 "compositePrimaryKeys": {},1339 "uniqueConstraints": {},1340 "policies": {},1341 "checkConstraints": {},1342 "isRLSEnabled": false1343 },1344 "public.dashboard_layouts": {1345 "name": "dashboard_layouts",1346 "schema": "",1347 "columns": {1348 "id": {1349 "name": "id",1350 "type": "uuid",1351 "primaryKey": true,1352 "notNull": true,1353 "default": "gen_random_uuid()"1354 },1355 "user_id": {1356 "name": "user_id",1357 "type": "uuid",1358 "primaryKey": false,1359 "notNull": true1360 },1361 "name": {1362 "name": "name",1363 "type": "text",1364 "primaryKey": false,1365 "notNull": true,1366 "default": "'Home'"1367 },1368 "widgets": {1369 "name": "widgets",1370 "type": "jsonb",1371 "primaryKey": false,1372 "notNull": true,1373 "default": "'[]'::jsonb"1374 },1375 "is_default": {1376 "name": "is_default",1377 "type": "boolean",1378 "primaryKey": false,1379 "notNull": true,1380 "default": true1381 },1382 "updated_at": {1383 "name": "updated_at",1384 "type": "timestamp with time zone",1385 "primaryKey": false,1386 "notNull": true,1387 "default": "now()"1388 }1389 },1390 "indexes": {},1391 "foreignKeys": {1392 "dashboard_layouts_user_id_users_id_fk": {1393 "name": "dashboard_layouts_user_id_users_id_fk",1394 "tableFrom": "dashboard_layouts",1395 "tableTo": "users",1396 "columnsFrom": [1397 "user_id"1398 ],1399 "columnsTo": [1400 "id"1401 ],1402 "onDelete": "cascade",1403 "onUpdate": "no action"1404 }1405 },1406 "compositePrimaryKeys": {},1407 "uniqueConstraints": {},1408 "policies": {},1409 "checkConstraints": {},1410 "isRLSEnabled": false1411 },1412 "public.database_properties": {1413 "name": "database_properties",1414 "schema": "",1415 "columns": {1416 "id": {1417 "name": "id",1418 "type": "uuid",1419 "primaryKey": true,1420 "notNull": true,1421 "default": "gen_random_uuid()"1422 },1423 "database_id": {1424 "name": "database_id",1425 "type": "uuid",1426 "primaryKey": false,1427 "notNull": true1428 },1429 "name": {1430 "name": "name",1431 "type": "text",1432 "primaryKey": false,1433 "notNull": true1434 },1435 "type": {1436 "name": "type",1437 "type": "text",1438 "primaryKey": false,1439 "notNull": true1440 },1441 "config": {1442 "name": "config",1443 "type": "jsonb",1444 "primaryKey": false,1445 "notNull": true,1446 "default": "'{}'::jsonb"1447 },1448 "position": {1449 "name": "position",1450 "type": "integer",1451 "primaryKey": false,1452 "notNull": true,1453 "default": 01454 },1455 "width": {1456 "name": "width",1457 "type": "integer",1458 "primaryKey": false,1459 "notNull": false,1460 "default": 1801461 },1462 "created_at": {1463 "name": "created_at",1464 "type": "timestamp with time zone",1465 "primaryKey": false,1466 "notNull": true,1467 "default": "now()"1468 }1469 },1470 "indexes": {1471 "db_props_db_idx": {1472 "name": "db_props_db_idx",1473 "columns": [1474 {1475 "expression": "database_id",1476 "isExpression": false,1477 "asc": true,1478 "nulls": "last"1479 }1480 ],1481 "isUnique": false,1482 "concurrently": false,1483 "method": "btree",1484 "with": {}1485 }1486 },1487 "foreignKeys": {1488 "database_properties_database_id_databases_id_fk": {1489 "name": "database_properties_database_id_databases_id_fk",1490 "tableFrom": "database_properties",1491 "tableTo": "databases",1492 "columnsFrom": [1493 "database_id"1494 ],1495 "columnsTo": [1496 "id"1497 ],1498 "onDelete": "cascade",1499 "onUpdate": "no action"1500 }1501 },1502 "compositePrimaryKeys": {},1503 "uniqueConstraints": {},1504 "policies": {},1505 "checkConstraints": {},1506 "isRLSEnabled": false1507 },1508 "public.database_rows": {1509 "name": "database_rows",1510 "schema": "",1511 "columns": {1512 "id": {1513 "name": "id",1514 "type": "uuid",1515 "primaryKey": true,1516 "notNull": true,1517 "default": "gen_random_uuid()"1518 },1519 "database_id": {1520 "name": "database_id",1521 "type": "uuid",1522 "primaryKey": false,1523 "notNull": true1524 },1525 "page_id": {1526 "name": "page_id",1527 "type": "uuid",1528 "primaryKey": false,1529 "notNull": true1530 },1531 "values": {1532 "name": "values",1533 "type": "jsonb",1534 "primaryKey": false,1535 "notNull": true,1536 "default": "'{}'::jsonb"1537 },1538 "position": {1539 "name": "position",1540 "type": "double precision",1541 "primaryKey": false,1542 "notNull": true,1543 "default": 01544 },1545 "created_at": {1546 "name": "created_at",1547 "type": "timestamp with time zone",1548 "primaryKey": false,1549 "notNull": true,1550 "default": "now()"1551 },1552 "updated_at": {1553 "name": "updated_at",1554 "type": "timestamp with time zone",1555 "primaryKey": false,1556 "notNull": true,1557 "default": "now()"1558 },1559 "deleted_at": {1560 "name": "deleted_at",1561 "type": "timestamp with time zone",1562 "primaryKey": false,1563 "notNull": false1564 }1565 },1566 "indexes": {1567 "db_rows_db_idx": {1568 "name": "db_rows_db_idx",1569 "columns": [1570 {1571 "expression": "database_id",1572 "isExpression": false,1573 "asc": true,1574 "nulls": "last"1575 }1576 ],1577 "isUnique": false,1578 "concurrently": false,1579 "method": "btree",1580 "with": {}1581 },1582 "db_rows_values_idx": {1583 "name": "db_rows_values_idx",1584 "columns": [1585 {1586 "expression": "values",1587 "isExpression": false,1588 "asc": true,1589 "nulls": "last"1590 }1591 ],1592 "isUnique": false,1593 "concurrently": false,1594 "method": "gin",1595 "with": {}1596 }1597 },1598 "foreignKeys": {1599 "database_rows_database_id_databases_id_fk": {1600 "name": "database_rows_database_id_databases_id_fk",1601 "tableFrom": "database_rows",1602 "tableTo": "databases",1603 "columnsFrom": [1604 "database_id"1605 ],1606 "columnsTo": [1607 "id"1608 ],1609 "onDelete": "cascade",1610 "onUpdate": "no action"1611 },1612 "database_rows_page_id_pages_id_fk": {1613 "name": "database_rows_page_id_pages_id_fk",1614 "tableFrom": "database_rows",1615 "tableTo": "pages",1616 "columnsFrom": [1617 "page_id"1618 ],1619 "columnsTo": [1620 "id"1621 ],1622 "onDelete": "cascade",1623 "onUpdate": "no action"1624 }1625 },1626 "compositePrimaryKeys": {},1627 "uniqueConstraints": {},1628 "policies": {},1629 "checkConstraints": {},1630 "isRLSEnabled": false1631 },1632 "public.database_views": {1633 "name": "database_views",1634 "schema": "",1635 "columns": {1636 "id": {1637 "name": "id",1638 "type": "uuid",1639 "primaryKey": true,1640 "notNull": true,1641 "default": "gen_random_uuid()"1642 },1643 "database_id": {1644 "name": "database_id",1645 "type": "uuid",1646 "primaryKey": false,1647 "notNull": true1648 },1649 "name": {1650 "name": "name",1651 "type": "text",1652 "primaryKey": false,1653 "notNull": true1654 },1655 "type": {1656 "name": "type",1657 "type": "text",1658 "primaryKey": false,1659 "notNull": true,1660 "default": "'table'"1661 },1662 "config": {1663 "name": "config",1664 "type": "jsonb",1665 "primaryKey": false,1666 "notNull": true,1667 "default": "'{}'::jsonb"1668 },1669 "position": {1670 "name": "position",1671 "type": "integer",1672 "primaryKey": false,1673 "notNull": true,1674 "default": 01675 },1676 "is_default": {1677 "name": "is_default",1678 "type": "boolean",1679 "primaryKey": false,1680 "notNull": true,1681 "default": false1682 },1683 "created_at": {1684 "name": "created_at",1685 "type": "timestamp with time zone",1686 "primaryKey": false,1687 "notNull": true,1688 "default": "now()"1689 }1690 },1691 "indexes": {},1692 "foreignKeys": {1693 "database_views_database_id_databases_id_fk": {1694 "name": "database_views_database_id_databases_id_fk",1695 "tableFrom": "database_views",1696 "tableTo": "databases",1697 "columnsFrom": [1698 "database_id"1699 ],1700 "columnsTo": [1701 "id"1702 ],1703 "onDelete": "cascade",1704 "onUpdate": "no action"1705 }1706 },1707 "compositePrimaryKeys": {},1708 "uniqueConstraints": {},1709 "policies": {},1710 "checkConstraints": {},1711 "isRLSEnabled": false1712 },1713 "public.databases": {1714 "name": "databases",1715 "schema": "",1716 "columns": {1717 "id": {1718 "name": "id",1719 "type": "uuid",1720 "primaryKey": true,1721 "notNull": true,1722 "default": "gen_random_uuid()"1723 },1724 "workspace_id": {1725 "name": "workspace_id",1726 "type": "uuid",1727 "primaryKey": false,1728 "notNull": true1729 },1730 "page_id": {1731 "name": "page_id",1732 "type": "uuid",1733 "primaryKey": false,1734 "notNull": true1735 },1736 "name": {1737 "name": "name",1738 "type": "text",1739 "primaryKey": false,1740 "notNull": true1741 },1742 "description": {1743 "name": "description",1744 "type": "text",1745 "primaryKey": false,1746 "notNull": false1747 },1748 "icon": {1749 "name": "icon",1750 "type": "text",1751 "primaryKey": false,1752 "notNull": false1753 },1754 "is_template": {1755 "name": "is_template",1756 "type": "boolean",1757 "primaryKey": false,1758 "notNull": true,1759 "default": false1760 },1761 "template_of": {1762 "name": "template_of",1763 "type": "uuid",1764 "primaryKey": false,1765 "notNull": false1766 },1767 "created_at": {1768 "name": "created_at",1769 "type": "timestamp with time zone",1770 "primaryKey": false,1771 "notNull": true,1772 "default": "now()"1773 },1774 "updated_at": {1775 "name": "updated_at",1776 "type": "timestamp with time zone",1777 "primaryKey": false,1778 "notNull": true,1779 "default": "now()"1780 },1781 "deleted_at": {1782 "name": "deleted_at",1783 "type": "timestamp with time zone",1784 "primaryKey": false,1785 "notNull": false1786 }1787 },1788 "indexes": {},1789 "foreignKeys": {1790 "databases_workspace_id_workspaces_id_fk": {1791 "name": "databases_workspace_id_workspaces_id_fk",1792 "tableFrom": "databases",1793 "tableTo": "workspaces",1794 "columnsFrom": [1795 "workspace_id"1796 ],1797 "columnsTo": [1798 "id"1799 ],1800 "onDelete": "cascade",1801 "onUpdate": "no action"1802 },1803 "databases_page_id_pages_id_fk": {1804 "name": "databases_page_id_pages_id_fk",1805 "tableFrom": "databases",1806 "tableTo": "pages",1807 "columnsFrom": [1808 "page_id"1809 ],1810 "columnsTo": [1811 "id"1812 ],1813 "onDelete": "cascade",1814 "onUpdate": "no action"1815 }1816 },1817 "compositePrimaryKeys": {},1818 "uniqueConstraints": {},1819 "policies": {},1820 "checkConstraints": {},1821 "isRLSEnabled": false1822 },1823 "public.embeddings": {1824 "name": "embeddings",1825 "schema": "",1826 "columns": {1827 "chunk_id": {1828 "name": "chunk_id",1829 "type": "uuid",1830 "primaryKey": true,1831 "notNull": true1832 },1833 "model": {1834 "name": "model",1835 "type": "text",1836 "primaryKey": false,1837 "notNull": true1838 },1839 "version": {1840 "name": "version",1841 "type": "integer",1842 "primaryKey": false,1843 "notNull": true,1844 "default": 11845 },1846 "embedding": {1847 "name": "embedding",1848 "type": "vector(1536)",1849 "primaryKey": false,1850 "notNull": true1851 },1852 "created_at": {1853 "name": "created_at",1854 "type": "timestamp with time zone",1855 "primaryKey": false,1856 "notNull": true,1857 "default": "now()"1858 }1859 },1860 "indexes": {1861 "embeddings_hnsw_idx": {1862 "name": "embeddings_hnsw_idx",1863 "columns": [1864 {1865 "expression": "\"embedding\" vector_cosine_ops",1866 "asc": true,1867 "isExpression": true,1868 "nulls": "last"1869 }1870 ],1871 "isUnique": false,1872 "concurrently": false,1873 "method": "hnsw",1874 "with": {}1875 }1876 },1877 "foreignKeys": {1878 "embeddings_chunk_id_chunks_id_fk": {1879 "name": "embeddings_chunk_id_chunks_id_fk",1880 "tableFrom": "embeddings",1881 "tableTo": "chunks",1882 "columnsFrom": [1883 "chunk_id"1884 ],1885 "columnsTo": [1886 "id"1887 ],1888 "onDelete": "cascade",1889 "onUpdate": "no action"1890 }1891 },1892 "compositePrimaryKeys": {},1893 "uniqueConstraints": {},1894 "policies": {},1895 "checkConstraints": {},1896 "isRLSEnabled": false1897 },1898 "public.experiments": {1899 "name": "experiments",1900 "schema": "",1901 "columns": {1902 "id": {1903 "name": "id",1904 "type": "uuid",1905 "primaryKey": true,1906 "notNull": true,1907 "default": "gen_random_uuid()"1908 },1909 "workspace_id": {1910 "name": "workspace_id",1911 "type": "uuid",1912 "primaryKey": false,1913 "notNull": true1914 },1915 "page_id": {1916 "name": "page_id",1917 "type": "uuid",1918 "primaryKey": false,1919 "notNull": false1920 },1921 "name": {1922 "name": "name",1923 "type": "text",1924 "primaryKey": false,1925 "notNull": true1926 },1927 "status": {1928 "name": "status",1929 "type": "text",1930 "primaryKey": false,1931 "notNull": true,1932 "default": "'planned'"1933 },1934 "params": {1935 "name": "params",1936 "type": "jsonb",1937 "primaryKey": false,1938 "notNull": false,1939 "default": "'{}'::jsonb"1940 },1941 "metrics": {1942 "name": "metrics",1943 "type": "jsonb",1944 "primaryKey": false,1945 "notNull": false,1946 "default": "'{}'::jsonb"1947 },1948 "dataset_ref": {1949 "name": "dataset_ref",1950 "type": "text",1951 "primaryKey": false,1952 "notNull": false1953 },1954 "repo_url": {1955 "name": "repo_url",1956 "type": "text",1957 "primaryKey": false,1958 "notNull": false1959 },1960 "notes": {1961 "name": "notes",1962 "type": "text",1963 "primaryKey": false,1964 "notNull": false1965 },1966 "started_at": {1967 "name": "started_at",1968 "type": "timestamp with time zone",1969 "primaryKey": false,1970 "notNull": false1971 },1972 "finished_at": {1973 "name": "finished_at",1974 "type": "timestamp with time zone",1975 "primaryKey": false,1976 "notNull": false1977 },1978 "created_at": {1979 "name": "created_at",1980 "type": "timestamp with time zone",1981 "primaryKey": false,1982 "notNull": true,1983 "default": "now()"1984 },1985 "updated_at": {1986 "name": "updated_at",1987 "type": "timestamp with time zone",1988 "primaryKey": false,1989 "notNull": true,1990 "default": "now()"1991 }1992 },1993 "indexes": {},1994 "foreignKeys": {1995 "experiments_workspace_id_workspaces_id_fk": {1996 "name": "experiments_workspace_id_workspaces_id_fk",1997 "tableFrom": "experiments",1998 "tableTo": "workspaces",1999 "columnsFrom": [2000 "workspace_id"2001 ],2002 "columnsTo": [2003 "id"2004 ],2005 "onDelete": "cascade",2006 "onUpdate": "no action"2007 },2008 "experiments_page_id_pages_id_fk": {2009 "name": "experiments_page_id_pages_id_fk",2010 "tableFrom": "experiments",2011 "tableTo": "pages",2012 "columnsFrom": [2013 "page_id"2014 ],2015 "columnsTo": [2016 "id"2017 ],2018 "onDelete": "set null",2019 "onUpdate": "no action"2020 }2021 },2022 "compositePrimaryKeys": {},2023 "uniqueConstraints": {},2024 "policies": {},2025 "checkConstraints": {},2026 "isRLSEnabled": false2027 },2028 "public.index_state": {2029 "name": "index_state",2030 "schema": "",2031 "columns": {2032 "source_type": {2033 "name": "source_type",2034 "type": "text",2035 "primaryKey": false,2036 "notNull": true2037 },2038 "source_id": {2039 "name": "source_id",2040 "type": "uuid",2041 "primaryKey": false,2042 "notNull": true2043 },2044 "content_hash": {2045 "name": "content_hash",2046 "type": "text",2047 "primaryKey": false,2048 "notNull": true2049 },2050 "model": {2051 "name": "model",2052 "type": "text",2053 "primaryKey": false,2054 "notNull": true2055 },2056 "version": {2057 "name": "version",2058 "type": "integer",2059 "primaryKey": false,2060 "notNull": true,2061 "default": 12062 },2063 "indexed_at": {2064 "name": "indexed_at",2065 "type": "timestamp with time zone",2066 "primaryKey": false,2067 "notNull": true,2068 "default": "now()"2069 }2070 },2071 "indexes": {},2072 "foreignKeys": {},2073 "compositePrimaryKeys": {2074 "index_state_source_type_source_id_pk": {2075 "name": "index_state_source_type_source_id_pk",2076 "columns": [2077 "source_type",2078 "source_id"2079 ]2080 }2081 },2082 "uniqueConstraints": {},2083 "policies": {},2084 "checkConstraints": {},2085 "isRLSEnabled": false2086 },2087 "public.knowledge_edges": {2088 "name": "knowledge_edges",2089 "schema": "",2090 "columns": {2091 "id": {2092 "name": "id",2093 "type": "uuid",2094 "primaryKey": true,2095 "notNull": true,2096 "default": "gen_random_uuid()"2097 },2098 "workspace_id": {2099 "name": "workspace_id",2100 "type": "uuid",2101 "primaryKey": false,2102 "notNull": true2103 },2104 "from_id": {2105 "name": "from_id",2106 "type": "uuid",2107 "primaryKey": false,2108 "notNull": true2109 },2110 "to_id": {2111 "name": "to_id",2112 "type": "uuid",2113 "primaryKey": false,2114 "notNull": true2115 },2116 "from_type": {2117 "name": "from_type",2118 "type": "text",2119 "primaryKey": false,2120 "notNull": true,2121 "default": "'page'"2122 },2123 "to_type": {2124 "name": "to_type",2125 "type": "text",2126 "primaryKey": false,2127 "notNull": true,2128 "default": "'page'"2129 },2130 "kind": {2131 "name": "kind",2132 "type": "text",2133 "primaryKey": false,2134 "notNull": true2135 },2136 "status": {2137 "name": "status",2138 "type": "text",2139 "primaryKey": false,2140 "notNull": true,2141 "default": "'accepted'"2142 },2143 "confidence": {2144 "name": "confidence",2145 "type": "double precision",2146 "primaryKey": false,2147 "notNull": false2148 },2149 "rationale": {2150 "name": "rationale",2151 "type": "text",2152 "primaryKey": false,2153 "notNull": false2154 },2155 "model": {2156 "name": "model",2157 "type": "text",2158 "primaryKey": false,2159 "notNull": false2160 },2161 "created_at": {2162 "name": "created_at",2163 "type": "timestamp with time zone",2164 "primaryKey": false,2165 "notNull": true,2166 "default": "now()"2167 },2168 "decided_at": {2169 "name": "decided_at",2170 "type": "timestamp with time zone",2171 "primaryKey": false,2172 "notNull": false2173 }2174 },2175 "indexes": {2176 "kedges_unique": {2177 "name": "kedges_unique",2178 "columns": [2179 {2180 "expression": "from_id",2181 "isExpression": false,2182 "asc": true,2183 "nulls": "last"2184 },2185 {2186 "expression": "to_id",2187 "isExpression": false,2188 "asc": true,2189 "nulls": "last"2190 },2191 {2192 "expression": "kind",2193 "isExpression": false,2194 "asc": true,2195 "nulls": "last"2196 }2197 ],2198 "isUnique": true,2199 "concurrently": false,2200 "method": "btree",2201 "with": {}2202 },2203 "kedges_ws_idx": {2204 "name": "kedges_ws_idx",2205 "columns": [2206 {2207 "expression": "workspace_id",2208 "isExpression": false,2209 "asc": true,2210 "nulls": "last"2211 },2212 {2213 "expression": "status",2214 "isExpression": false,2215 "asc": true,2216 "nulls": "last"2217 }2218 ],2219 "isUnique": false,2220 "concurrently": false,2221 "method": "btree",2222 "with": {}2223 }2224 },2225 "foreignKeys": {2226 "knowledge_edges_workspace_id_workspaces_id_fk": {2227 "name": "knowledge_edges_workspace_id_workspaces_id_fk",2228 "tableFrom": "knowledge_edges",2229 "tableTo": "workspaces",2230 "columnsFrom": [2231 "workspace_id"2232 ],2233 "columnsTo": [2234 "id"2235 ],2236 "onDelete": "cascade",2237 "onUpdate": "no action"2238 }2239 },2240 "compositePrimaryKeys": {},2241 "uniqueConstraints": {},2242 "policies": {},2243 "checkConstraints": {},2244 "isRLSEnabled": false2245 },2246 "public.links": {2247 "name": "links",2248 "schema": "",2249 "columns": {2250 "id": {2251 "name": "id",2252 "type": "uuid",2253 "primaryKey": true,2254 "notNull": true,2255 "default": "gen_random_uuid()"2256 },2257 "from_page_id": {2258 "name": "from_page_id",2259 "type": "uuid",2260 "primaryKey": false,2261 "notNull": true2262 },2263 "to_page_id": {2264 "name": "to_page_id",2265 "type": "uuid",2266 "primaryKey": false,2267 "notNull": true2268 },2269 "kind": {2270 "name": "kind",2271 "type": "text",2272 "primaryKey": false,2273 "notNull": true,2274 "default": "'link'"2275 },2276 "created_at": {2277 "name": "created_at",2278 "type": "timestamp with time zone",2279 "primaryKey": false,2280 "notNull": true,2281 "default": "now()"2282 }2283 },2284 "indexes": {2285 "links_unique": {2286 "name": "links_unique",2287 "columns": [2288 {2289 "expression": "from_page_id",2290 "isExpression": false,2291 "asc": true,2292 "nulls": "last"2293 },2294 {2295 "expression": "to_page_id",2296 "isExpression": false,2297 "asc": true,2298 "nulls": "last"2299 },2300 {2301 "expression": "kind",2302 "isExpression": false,2303 "asc": true,2304 "nulls": "last"2305 }2306 ],2307 "isUnique": true,2308 "concurrently": false,2309 "method": "btree",2310 "with": {}2311 },2312 "links_to_idx": {2313 "name": "links_to_idx",2314 "columns": [2315 {2316 "expression": "to_page_id",2317 "isExpression": false,2318 "asc": true,2319 "nulls": "last"2320 }2321 ],2322 "isUnique": false,2323 "concurrently": false,2324 "method": "btree",2325 "with": {}2326 }2327 },2328 "foreignKeys": {2329 "links_from_page_id_pages_id_fk": {2330 "name": "links_from_page_id_pages_id_fk",2331 "tableFrom": "links",2332 "tableTo": "pages",2333 "columnsFrom": [2334 "from_page_id"2335 ],2336 "columnsTo": [2337 "id"2338 ],2339 "onDelete": "cascade",2340 "onUpdate": "no action"2341 },2342 "links_to_page_id_pages_id_fk": {2343 "name": "links_to_page_id_pages_id_fk",2344 "tableFrom": "links",2345 "tableTo": "pages",2346 "columnsFrom": [2347 "to_page_id"2348 ],2349 "columnsTo": [2350 "id"2351 ],2352 "onDelete": "cascade",2353 "onUpdate": "no action"2354 }2355 },2356 "compositePrimaryKeys": {},2357 "uniqueConstraints": {},2358 "policies": {},2359 "checkConstraints": {},2360 "isRLSEnabled": false2361 },2362 "public.login_attempts": {2363 "name": "login_attempts",2364 "schema": "",2365 "columns": {2366 "id": {2367 "name": "id",2368 "type": "uuid",2369 "primaryKey": true,2370 "notNull": true,2371 "default": "gen_random_uuid()"2372 },2373 "ip": {2374 "name": "ip",2375 "type": "text",2376 "primaryKey": false,2377 "notNull": true2378 },2379 "username": {2380 "name": "username",2381 "type": "text",2382 "primaryKey": false,2383 "notNull": false2384 },2385 "success": {2386 "name": "success",2387 "type": "boolean",2388 "primaryKey": false,2389 "notNull": true2390 },2391 "created_at": {2392 "name": "created_at",2393 "type": "timestamp with time zone",2394 "primaryKey": false,2395 "notNull": true,2396 "default": "now()"2397 }2398 },2399 "indexes": {2400 "login_attempts_ip_idx": {2401 "name": "login_attempts_ip_idx",2402 "columns": [2403 {2404 "expression": "ip",2405 "isExpression": false,2406 "asc": true,2407 "nulls": "last"2408 },2409 {2410 "expression": "created_at",2411 "isExpression": false,2412 "asc": true,2413 "nulls": "last"2414 }2415 ],2416 "isUnique": false,2417 "concurrently": false,2418 "method": "btree",2419 "with": {}2420 }2421 },2422 "foreignKeys": {},2423 "compositePrimaryKeys": {},2424 "uniqueConstraints": {},2425 "policies": {},2426 "checkConstraints": {},2427 "isRLSEnabled": false2428 },2429 "public.page_tags": {2430 "name": "page_tags",2431 "schema": "",2432 "columns": {2433 "page_id": {2434 "name": "page_id",2435 "type": "uuid",2436 "primaryKey": false,2437 "notNull": true2438 },2439 "tag_id": {2440 "name": "tag_id",2441 "type": "uuid",2442 "primaryKey": false,2443 "notNull": true2444 }2445 },2446 "indexes": {},2447 "foreignKeys": {2448 "page_tags_page_id_pages_id_fk": {2449 "name": "page_tags_page_id_pages_id_fk",2450 "tableFrom": "page_tags",2451 "tableTo": "pages",2452 "columnsFrom": [2453 "page_id"2454 ],2455 "columnsTo": [2456 "id"2457 ],2458 "onDelete": "cascade",2459 "onUpdate": "no action"2460 },2461 "page_tags_tag_id_tags_id_fk": {2462 "name": "page_tags_tag_id_tags_id_fk",2463 "tableFrom": "page_tags",2464 "tableTo": "tags",2465 "columnsFrom": [2466 "tag_id"2467 ],2468 "columnsTo": [2469 "id"2470 ],2471 "onDelete": "cascade",2472 "onUpdate": "no action"2473 }2474 },2475 "compositePrimaryKeys": {2476 "page_tags_page_id_tag_id_pk": {2477 "name": "page_tags_page_id_tag_id_pk",2478 "columns": [2479 "page_id",2480 "tag_id"2481 ]2482 }2483 },2484 "uniqueConstraints": {},2485 "policies": {},2486 "checkConstraints": {},2487 "isRLSEnabled": false2488 },2489 "public.page_versions": {2490 "name": "page_versions",2491 "schema": "",2492 "columns": {2493 "id": {2494 "name": "id",2495 "type": "uuid",2496 "primaryKey": true,2497 "notNull": true,2498 "default": "gen_random_uuid()"2499 },2500 "page_id": {2501 "name": "page_id",2502 "type": "uuid",2503 "primaryKey": false,2504 "notNull": true2505 },2506 "version": {2507 "name": "version",2508 "type": "integer",2509 "primaryKey": false,2510 "notNull": true2511 },2512 "title": {2513 "name": "title",2514 "type": "text",2515 "primaryKey": false,2516 "notNull": true2517 },2518 "content": {2519 "name": "content",2520 "type": "jsonb",2521 "primaryKey": false,2522 "notNull": true2523 },2524 "properties": {2525 "name": "properties",2526 "type": "jsonb",2527 "primaryKey": false,2528 "notNull": false,2529 "default": "'{}'::jsonb"2530 },2531 "reason": {2532 "name": "reason",2533 "type": "text",2534 "primaryKey": false,2535 "notNull": true,2536 "default": "'autosave'"2537 },2538 "created_at": {2539 "name": "created_at",2540 "type": "timestamp with time zone",2541 "primaryKey": false,2542 "notNull": true,2543 "default": "now()"2544 },2545 "word_count": {2546 "name": "word_count",2547 "type": "integer",2548 "primaryKey": false,2549 "notNull": false,2550 "default": 02551 }2552 },2553 "indexes": {2554 "page_versions_unique": {2555 "name": "page_versions_unique",2556 "columns": [2557 {2558 "expression": "page_id",2559 "isExpression": false,2560 "asc": true,2561 "nulls": "last"2562 },2563 {2564 "expression": "version",2565 "isExpression": false,2566 "asc": true,2567 "nulls": "last"2568 }2569 ],2570 "isUnique": true,2571 "concurrently": false,2572 "method": "btree",2573 "with": {}2574 }2575 },2576 "foreignKeys": {2577 "page_versions_page_id_pages_id_fk": {2578 "name": "page_versions_page_id_pages_id_fk",2579 "tableFrom": "page_versions",2580 "tableTo": "pages",2581 "columnsFrom": [2582 "page_id"2583 ],2584 "columnsTo": [2585 "id"2586 ],2587 "onDelete": "cascade",2588 "onUpdate": "no action"2589 }2590 },2591 "compositePrimaryKeys": {},2592 "uniqueConstraints": {},2593 "policies": {},2594 "checkConstraints": {},2595 "isRLSEnabled": false2596 },2597 "public.pages": {2598 "name": "pages",2599 "schema": "",2600 "columns": {2601 "id": {2602 "name": "id",2603 "type": "uuid",2604 "primaryKey": true,2605 "notNull": true,2606 "default": "gen_random_uuid()"2607 },2608 "workspace_id": {2609 "name": "workspace_id",2610 "type": "uuid",2611 "primaryKey": false,2612 "notNull": true2613 },2614 "parent_id": {2615 "name": "parent_id",2616 "type": "uuid",2617 "primaryKey": false,2618 "notNull": false2619 },2620 "database_id": {2621 "name": "database_id",2622 "type": "uuid",2623 "primaryKey": false,2624 "notNull": false2625 },2626 "type": {2627 "name": "type",2628 "type": "text",2629 "primaryKey": false,2630 "notNull": true,2631 "default": "'page'"2632 },2633 "section": {2634 "name": "section",2635 "type": "text",2636 "primaryKey": false,2637 "notNull": true,2638 "default": "'notes'"2639 },2640 "title": {2641 "name": "title",2642 "type": "text",2643 "primaryKey": false,2644 "notNull": true,2645 "default": "'Untitled'"2646 },2647 "icon": {2648 "name": "icon",2649 "type": "text",2650 "primaryKey": false,2651 "notNull": false2652 },2653 "cover": {2654 "name": "cover",2655 "type": "text",2656 "primaryKey": false,2657 "notNull": false2658 },2659 "content": {2660 "name": "content",2661 "type": "jsonb",2662 "primaryKey": false,2663 "notNull": true,2664 "default": "'{\"type\":\"doc\",\"content\":[]}'::jsonb"2665 },2666 "plain_text": {2667 "name": "plain_text",2668 "type": "text",2669 "primaryKey": false,2670 "notNull": true,2671 "default": "''"2672 },2673 "tsv": {2674 "name": "tsv",2675 "type": "tsvector",2676 "primaryKey": false,2677 "notNull": false,2678 "generated": {2679 "as": "setweight(to_tsvector('simple', coalesce(title,'')), 'A') || setweight(to_tsvector('simple', coalesce(plain_text,'')), 'B')",2680 "type": "stored"2681 }2682 },2683 "properties": {2684 "name": "properties",2685 "type": "jsonb",2686 "primaryKey": false,2687 "notNull": true,2688 "default": "'{}'::jsonb"2689 },2690 "position": {2691 "name": "position",2692 "type": "double precision",2693 "primaryKey": false,2694 "notNull": true,2695 "default": 02696 },2697 "pinned": {2698 "name": "pinned",2699 "type": "boolean",2700 "primaryKey": false,2701 "notNull": true,2702 "default": false2703 },2704 "archived": {2705 "name": "archived",2706 "type": "boolean",2707 "primaryKey": false,2708 "notNull": true,2709 "default": false2710 },2711 "version": {2712 "name": "version",2713 "type": "integer",2714 "primaryKey": false,2715 "notNull": true,2716 "default": 12717 },2718 "word_count": {2719 "name": "word_count",2720 "type": "integer",2721 "primaryKey": false,2722 "notNull": true,2723 "default": 02724 },2725 "created_at": {2726 "name": "created_at",2727 "type": "timestamp with time zone",2728 "primaryKey": false,2729 "notNull": true,2730 "default": "now()"2731 },2732 "updated_at": {2733 "name": "updated_at",2734 "type": "timestamp with time zone",2735 "primaryKey": false,2736 "notNull": true,2737 "default": "now()"2738 },2739 "last_opened_at": {2740 "name": "last_opened_at",2741 "type": "timestamp with time zone",2742 "primaryKey": false,2743 "notNull": false2744 },2745 "deleted_at": {2746 "name": "deleted_at",2747 "type": "timestamp with time zone",2748 "primaryKey": false,2749 "notNull": false2750 }2751 },2752 "indexes": {2753 "pages_ws_parent_idx": {2754 "name": "pages_ws_parent_idx",2755 "columns": [2756 {2757 "expression": "workspace_id",2758 "isExpression": false,2759 "asc": true,2760 "nulls": "last"2761 },2762 {2763 "expression": "parent_id",2764 "isExpression": false,2765 "asc": true,2766 "nulls": "last"2767 }2768 ],2769 "isUnique": false,2770 "concurrently": false,2771 "method": "btree",2772 "with": {}2773 },2774 "pages_tsv_idx": {2775 "name": "pages_tsv_idx",2776 "columns": [2777 {2778 "expression": "tsv",2779 "isExpression": false,2780 "asc": true,2781 "nulls": "last"2782 }2783 ],2784 "isUnique": false,2785 "concurrently": false,2786 "method": "gin",2787 "with": {}2788 },2789 "pages_updated_idx": {2790 "name": "pages_updated_idx",2791 "columns": [2792 {2793 "expression": "updated_at",2794 "isExpression": false,2795 "asc": true,2796 "nulls": "last"2797 }2798 ],2799 "isUnique": false,2800 "concurrently": false,2801 "method": "btree",2802 "with": {}2803 },2804 "pages_db_idx": {2805 "name": "pages_db_idx",2806 "columns": [2807 {2808 "expression": "database_id",2809 "isExpression": false,2810 "asc": true,2811 "nulls": "last"2812 }2813 ],2814 "isUnique": false,2815 "concurrently": false,2816 "method": "btree",2817 "with": {}2818 },2819 "pages_title_trgm_idx": {2820 "name": "pages_title_trgm_idx",2821 "columns": [2822 {2823 "expression": "\"title\" gin_trgm_ops",2824 "asc": true,2825 "isExpression": true,2826 "nulls": "last"2827 }2828 ],2829 "isUnique": false,2830 "concurrently": false,2831 "method": "gin",2832 "with": {}2833 }2834 },2835 "foreignKeys": {2836 "pages_workspace_id_workspaces_id_fk": {2837 "name": "pages_workspace_id_workspaces_id_fk",2838 "tableFrom": "pages",2839 "tableTo": "workspaces",2840 "columnsFrom": [2841 "workspace_id"2842 ],2843 "columnsTo": [2844 "id"2845 ],2846 "onDelete": "cascade",2847 "onUpdate": "no action"2848 }2849 },2850 "compositePrimaryKeys": {},2851 "uniqueConstraints": {},2852 "policies": {},2853 "checkConstraints": {},2854 "isRLSEnabled": false2855 },2856 "public.relations": {2857 "name": "relations",2858 "schema": "",2859 "columns": {2860 "id": {2861 "name": "id",2862 "type": "uuid",2863 "primaryKey": true,2864 "notNull": true,2865 "default": "gen_random_uuid()"2866 },2867 "property_id": {2868 "name": "property_id",2869 "type": "uuid",2870 "primaryKey": false,2871 "notNull": true2872 },2873 "from_row_id": {2874 "name": "from_row_id",2875 "type": "uuid",2876 "primaryKey": false,2877 "notNull": true2878 },2879 "to_row_id": {2880 "name": "to_row_id",2881 "type": "uuid",2882 "primaryKey": false,2883 "notNull": true2884 },2885 "created_at": {2886 "name": "created_at",2887 "type": "timestamp with time zone",2888 "primaryKey": false,2889 "notNull": true,2890 "default": "now()"2891 }2892 },2893 "indexes": {2894 "relations_unique": {2895 "name": "relations_unique",2896 "columns": [2897 {2898 "expression": "property_id",2899 "isExpression": false,2900 "asc": true,2901 "nulls": "last"2902 },2903 {2904 "expression": "from_row_id",2905 "isExpression": false,2906 "asc": true,2907 "nulls": "last"2908 },2909 {2910 "expression": "to_row_id",2911 "isExpression": false,2912 "asc": true,2913 "nulls": "last"2914 }2915 ],2916 "isUnique": true,2917 "concurrently": false,2918 "method": "btree",2919 "with": {}2920 },2921 "relations_to_idx": {2922 "name": "relations_to_idx",2923 "columns": [2924 {2925 "expression": "to_row_id",2926 "isExpression": false,2927 "asc": true,2928 "nulls": "last"2929 }2930 ],2931 "isUnique": false,2932 "concurrently": false,2933 "method": "btree",2934 "with": {}2935 }2936 },2937 "foreignKeys": {2938 "relations_property_id_database_properties_id_fk": {2939 "name": "relations_property_id_database_properties_id_fk",2940 "tableFrom": "relations",2941 "tableTo": "database_properties",2942 "columnsFrom": [2943 "property_id"2944 ],2945 "columnsTo": [2946 "id"2947 ],2948 "onDelete": "cascade",2949 "onUpdate": "no action"2950 },2951 "relations_from_row_id_database_rows_id_fk": {2952 "name": "relations_from_row_id_database_rows_id_fk",2953 "tableFrom": "relations",2954 "tableTo": "database_rows",2955 "columnsFrom": [2956 "from_row_id"2957 ],2958 "columnsTo": [2959 "id"2960 ],2961 "onDelete": "cascade",2962 "onUpdate": "no action"2963 },2964 "relations_to_row_id_database_rows_id_fk": {2965 "name": "relations_to_row_id_database_rows_id_fk",2966 "tableFrom": "relations",2967 "tableTo": "database_rows",2968 "columnsFrom": [2969 "to_row_id"2970 ],2971 "columnsTo": [2972 "id"2973 ],2974 "onDelete": "cascade",2975 "onUpdate": "no action"2976 }2977 },2978 "compositePrimaryKeys": {},2979 "uniqueConstraints": {},2980 "policies": {},2981 "checkConstraints": {},2982 "isRLSEnabled": false2983 },2984 "public.references": {2985 "name": "references",2986 "schema": "",2987 "columns": {2988 "id": {2989 "name": "id",2990 "type": "uuid",2991 "primaryKey": true,2992 "notNull": true,2993 "default": "gen_random_uuid()"2994 },2995 "workspace_id": {2996 "name": "workspace_id",2997 "type": "uuid",2998 "primaryKey": false,2999 "notNull": true3000 },3001 "page_id": {3002 "name": "page_id",3003 "type": "uuid",3004 "primaryKey": false,3005 "notNull": false3006 },3007 "cite_key": {3008 "name": "cite_key",3009 "type": "text",3010 "primaryKey": false,3011 "notNull": true3012 },3013 "entry_type": {3014 "name": "entry_type",3015 "type": "text",3016 "primaryKey": false,3017 "notNull": true,3018 "default": "'article'"3019 },3020 "title": {3021 "name": "title",3022 "type": "text",3023 "primaryKey": false,3024 "notNull": true3025 },3026 "authors": {3027 "name": "authors",3028 "type": "jsonb",3029 "primaryKey": false,3030 "notNull": false,3031 "default": "'[]'::jsonb"3032 },3033 "year": {3034 "name": "year",3035 "type": "integer",3036 "primaryKey": false,3037 "notNull": false3038 },3039 "journal": {3040 "name": "journal",3041 "type": "text",3042 "primaryKey": false,3043 "notNull": false3044 },3045 "doi": {3046 "name": "doi",3047 "type": "text",3048 "primaryKey": false,3049 "notNull": false3050 },3051 "url": {3052 "name": "url",3053 "type": "text",3054 "primaryKey": false,3055 "notNull": false3056 },3057 "bibtex": {3058 "name": "bibtex",3059 "type": "text",3060 "primaryKey": false,3061 "notNull": false3062 },3063 "fields": {3064 "name": "fields",3065 "type": "jsonb",3066 "primaryKey": false,3067 "notNull": false,3068 "default": "'{}'::jsonb"3069 },3070 "verified": {3071 "name": "verified",3072 "type": "text",3073 "primaryKey": false,3074 "notNull": true,3075 "default": "'user'"3076 },3077 "attachment_id": {3078 "name": "attachment_id",3079 "type": "uuid",3080 "primaryKey": false,3081 "notNull": false3082 },3083 "created_at": {3084 "name": "created_at",3085 "type": "timestamp with time zone",3086 "primaryKey": false,3087 "notNull": true,3088 "default": "now()"3089 },3090 "updated_at": {3091 "name": "updated_at",3092 "type": "timestamp with time zone",3093 "primaryKey": false,3094 "notNull": true,3095 "default": "now()"3096 },3097 "deleted_at": {3098 "name": "deleted_at",3099 "type": "timestamp with time zone",3100 "primaryKey": false,3101 "notNull": false3102 }3103 },3104 "indexes": {3105 "references_key_unique": {3106 "name": "references_key_unique",3107 "columns": [3108 {3109 "expression": "workspace_id",3110 "isExpression": false,3111 "asc": true,3112 "nulls": "last"3113 },3114 {3115 "expression": "cite_key",3116 "isExpression": false,3117 "asc": true,3118 "nulls": "last"3119 }3120 ],3121 "isUnique": true,3122 "concurrently": false,3123 "method": "btree",3124 "with": {}3125 }3126 },3127 "foreignKeys": {3128 "references_workspace_id_workspaces_id_fk": {3129 "name": "references_workspace_id_workspaces_id_fk",3130 "tableFrom": "references",3131 "tableTo": "workspaces",3132 "columnsFrom": [3133 "workspace_id"3134 ],3135 "columnsTo": [3136 "id"3137 ],3138 "onDelete": "cascade",3139 "onUpdate": "no action"3140 },3141 "references_page_id_pages_id_fk": {3142 "name": "references_page_id_pages_id_fk",3143 "tableFrom": "references",3144 "tableTo": "pages",3145 "columnsFrom": [3146 "page_id"3147 ],3148 "columnsTo": [3149 "id"3150 ],3151 "onDelete": "set null",3152 "onUpdate": "no action"3153 },3154 "references_attachment_id_attachments_id_fk": {3155 "name": "references_attachment_id_attachments_id_fk",3156 "tableFrom": "references",3157 "tableTo": "attachments",3158 "columnsFrom": [3159 "attachment_id"3160 ],3161 "columnsTo": [3162 "id"3163 ],3164 "onDelete": "set null",3165 "onUpdate": "no action"3166 }3167 },3168 "compositePrimaryKeys": {},3169 "uniqueConstraints": {},3170 "policies": {},3171 "checkConstraints": {},3172 "isRLSEnabled": false3173 },3174 "public.sessions": {3175 "name": "sessions",3176 "schema": "",3177 "columns": {3178 "id": {3179 "name": "id",3180 "type": "uuid",3181 "primaryKey": true,3182 "notNull": true,3183 "default": "gen_random_uuid()"3184 },3185 "user_id": {3186 "name": "user_id",3187 "type": "uuid",3188 "primaryKey": false,3189 "notNull": true3190 },3191 "token_hash": {3192 "name": "token_hash",3193 "type": "text",3194 "primaryKey": false,3195 "notNull": true3196 },3197 "user_agent": {3198 "name": "user_agent",3199 "type": "text",3200 "primaryKey": false,3201 "notNull": false3202 },3203 "ip": {3204 "name": "ip",3205 "type": "text",3206 "primaryKey": false,3207 "notNull": false3208 },3209 "created_at": {3210 "name": "created_at",3211 "type": "timestamp with time zone",3212 "primaryKey": false,3213 "notNull": true,3214 "default": "now()"3215 },3216 "last_seen_at": {3217 "name": "last_seen_at",3218 "type": "timestamp with time zone",3219 "primaryKey": false,3220 "notNull": true,3221 "default": "now()"3222 },3223 "expires_at": {3224 "name": "expires_at",3225 "type": "timestamp with time zone",3226 "primaryKey": false,3227 "notNull": true3228 },3229 "absolute_expires_at": {3230 "name": "absolute_expires_at",3231 "type": "timestamp with time zone",3232 "primaryKey": false,3233 "notNull": true3234 },3235 "revoked_at": {3236 "name": "revoked_at",3237 "type": "timestamp with time zone",3238 "primaryKey": false,3239 "notNull": false3240 },3241 "mfa_passed": {3242 "name": "mfa_passed",3243 "type": "boolean",3244 "primaryKey": false,3245 "notNull": true,3246 "default": false3247 }3248 },3249 "indexes": {3250 "sessions_user_idx": {3251 "name": "sessions_user_idx",3252 "columns": [3253 {3254 "expression": "user_id",3255 "isExpression": false,3256 "asc": true,3257 "nulls": "last"3258 }3259 ],3260 "isUnique": false,3261 "concurrently": false,3262 "method": "btree",3263 "with": {}3264 }3265 },3266 "foreignKeys": {3267 "sessions_user_id_users_id_fk": {3268 "name": "sessions_user_id_users_id_fk",3269 "tableFrom": "sessions",3270 "tableTo": "users",3271 "columnsFrom": [3272 "user_id"3273 ],3274 "columnsTo": [3275 "id"3276 ],3277 "onDelete": "cascade",3278 "onUpdate": "no action"3279 }3280 },3281 "compositePrimaryKeys": {},3282 "uniqueConstraints": {3283 "sessions_token_hash_unique": {3284 "name": "sessions_token_hash_unique",3285 "nullsNotDistinct": false,3286 "columns": [3287 "token_hash"3288 ]3289 }3290 },3291 "policies": {},3292 "checkConstraints": {},3293 "isRLSEnabled": false3294 },3295 "public.settings": {3296 "name": "settings",3297 "schema": "",3298 "columns": {3299 "key": {3300 "name": "key",3301 "type": "text",3302 "primaryKey": true,3303 "notNull": true3304 },3305 "value": {3306 "name": "value",3307 "type": "jsonb",3308 "primaryKey": false,3309 "notNull": true3310 },3311 "updated_at": {3312 "name": "updated_at",3313 "type": "timestamp with time zone",3314 "primaryKey": false,3315 "notNull": true,3316 "default": "now()"3317 }3318 },3319 "indexes": {},3320 "foreignKeys": {},3321 "compositePrimaryKeys": {},3322 "uniqueConstraints": {},3323 "policies": {},3324 "checkConstraints": {},3325 "isRLSEnabled": false3326 },3327 "public.tags": {3328 "name": "tags",3329 "schema": "",3330 "columns": {3331 "id": {3332 "name": "id",3333 "type": "uuid",3334 "primaryKey": true,3335 "notNull": true,3336 "default": "gen_random_uuid()"3337 },3338 "workspace_id": {3339 "name": "workspace_id",3340 "type": "uuid",3341 "primaryKey": false,3342 "notNull": true3343 },3344 "name": {3345 "name": "name",3346 "type": "text",3347 "primaryKey": false,3348 "notNull": true3349 },3350 "color": {3351 "name": "color",3352 "type": "text",3353 "primaryKey": false,3354 "notNull": false,3355 "default": "'gray'"3356 },3357 "created_at": {3358 "name": "created_at",3359 "type": "timestamp with time zone",3360 "primaryKey": false,3361 "notNull": true,3362 "default": "now()"3363 }3364 },3365 "indexes": {3366 "tags_unique": {3367 "name": "tags_unique",3368 "columns": [3369 {3370 "expression": "workspace_id",3371 "isExpression": false,3372 "asc": true,3373 "nulls": "last"3374 },3375 {3376 "expression": "name",3377 "isExpression": false,3378 "asc": true,3379 "nulls": "last"3380 }3381 ],3382 "isUnique": true,3383 "concurrently": false,3384 "method": "btree",3385 "with": {}3386 }3387 },3388 "foreignKeys": {3389 "tags_workspace_id_workspaces_id_fk": {3390 "name": "tags_workspace_id_workspaces_id_fk",3391 "tableFrom": "tags",3392 "tableTo": "workspaces",3393 "columnsFrom": [3394 "workspace_id"3395 ],3396 "columnsTo": [3397 "id"3398 ],3399 "onDelete": "cascade",3400 "onUpdate": "no action"3401 }3402 },3403 "compositePrimaryKeys": {},3404 "uniqueConstraints": {},3405 "policies": {},3406 "checkConstraints": {},3407 "isRLSEnabled": false3408 },3409 "public.tasks": {3410 "name": "tasks",3411 "schema": "",3412 "columns": {3413 "id": {3414 "name": "id",3415 "type": "uuid",3416 "primaryKey": true,3417 "notNull": true,3418 "default": "gen_random_uuid()"3419 },3420 "workspace_id": {3421 "name": "workspace_id",3422 "type": "uuid",3423 "primaryKey": false,3424 "notNull": true3425 },3426 "page_id": {3427 "name": "page_id",3428 "type": "uuid",3429 "primaryKey": false,3430 "notNull": false3431 },3432 "title": {3433 "name": "title",3434 "type": "text",3435 "primaryKey": false,3436 "notNull": true3437 },3438 "status": {3439 "name": "status",3440 "type": "text",3441 "primaryKey": false,3442 "notNull": true,3443 "default": "'todo'"3444 },3445 "priority": {3446 "name": "priority",3447 "type": "text",3448 "primaryKey": false,3449 "notNull": false,3450 "default": "'medium'"3451 },3452 "due_at": {3453 "name": "due_at",3454 "type": "timestamp with time zone",3455 "primaryKey": false,3456 "notNull": false3457 },3458 "completed_at": {3459 "name": "completed_at",3460 "type": "timestamp with time zone",3461 "primaryKey": false,3462 "notNull": false3463 },3464 "project": {3465 "name": "project",3466 "type": "text",3467 "primaryKey": false,3468 "notNull": false3469 },3470 "created_at": {3471 "name": "created_at",3472 "type": "timestamp with time zone",3473 "primaryKey": false,3474 "notNull": true,3475 "default": "now()"3476 },3477 "updated_at": {3478 "name": "updated_at",3479 "type": "timestamp with time zone",3480 "primaryKey": false,3481 "notNull": true,3482 "default": "now()"3483 },3484 "deleted_at": {3485 "name": "deleted_at",3486 "type": "timestamp with time zone",3487 "primaryKey": false,3488 "notNull": false3489 }3490 },3491 "indexes": {3492 "tasks_due_idx": {3493 "name": "tasks_due_idx",3494 "columns": [3495 {3496 "expression": "due_at",3497 "isExpression": false,3498 "asc": true,3499 "nulls": "last"3500 }3501 ],3502 "isUnique": false,3503 "concurrently": false,3504 "method": "btree",3505 "with": {}3506 }3507 },3508 "foreignKeys": {3509 "tasks_workspace_id_workspaces_id_fk": {3510 "name": "tasks_workspace_id_workspaces_id_fk",3511 "tableFrom": "tasks",3512 "tableTo": "workspaces",3513 "columnsFrom": [3514 "workspace_id"3515 ],3516 "columnsTo": [3517 "id"3518 ],3519 "onDelete": "cascade",3520 "onUpdate": "no action"3521 },3522 "tasks_page_id_pages_id_fk": {3523 "name": "tasks_page_id_pages_id_fk",3524 "tableFrom": "tasks",3525 "tableTo": "pages",3526 "columnsFrom": [3527 "page_id"3528 ],3529 "columnsTo": [3530 "id"3531 ],3532 "onDelete": "set null",3533 "onUpdate": "no action"3534 }3535 },3536 "compositePrimaryKeys": {},3537 "uniqueConstraints": {},3538 "policies": {},3539 "checkConstraints": {},3540 "isRLSEnabled": false3541 },3542 "public.users": {3543 "name": "users",3544 "schema": "",3545 "columns": {3546 "id": {3547 "name": "id",3548 "type": "uuid",3549 "primaryKey": true,3550 "notNull": true,3551 "default": "gen_random_uuid()"3552 },3553 "username": {3554 "name": "username",3555 "type": "text",3556 "primaryKey": false,3557 "notNull": true3558 },3559 "display_name": {3560 "name": "display_name",3561 "type": "text",3562 "primaryKey": false,3563 "notNull": true3564 },3565 "email": {3566 "name": "email",3567 "type": "text",3568 "primaryKey": false,3569 "notNull": false3570 },3571 "password_hash": {3572 "name": "password_hash",3573 "type": "text",3574 "primaryKey": false,3575 "notNull": true3576 },3577 "totp_secret": {3578 "name": "totp_secret",3579 "type": "text",3580 "primaryKey": false,3581 "notNull": false3582 },3583 "totp_enabled": {3584 "name": "totp_enabled",3585 "type": "boolean",3586 "primaryKey": false,3587 "notNull": true,3588 "default": false3589 },3590 "preferences": {3591 "name": "preferences",3592 "type": "jsonb",3593 "primaryKey": false,3594 "notNull": true,3595 "default": "'{}'::jsonb"3596 },3597 "created_at": {3598 "name": "created_at",3599 "type": "timestamp with time zone",3600 "primaryKey": false,3601 "notNull": true,3602 "default": "now()"3603 },3604 "updated_at": {3605 "name": "updated_at",3606 "type": "timestamp with time zone",3607 "primaryKey": false,3608 "notNull": true,3609 "default": "now()"3610 }3611 },3612 "indexes": {},3613 "foreignKeys": {},3614 "compositePrimaryKeys": {},3615 "uniqueConstraints": {3616 "users_username_unique": {3617 "name": "users_username_unique",3618 "nullsNotDistinct": false,3619 "columns": [3620 "username"3621 ]3622 }3623 },3624 "policies": {},3625 "checkConstraints": {},3626 "isRLSEnabled": false3627 },3628 "public.webauthn_challenges": {3629 "name": "webauthn_challenges",3630 "schema": "",3631 "columns": {3632 "id": {3633 "name": "id",3634 "type": "uuid",3635 "primaryKey": true,3636 "notNull": true,3637 "default": "gen_random_uuid()"3638 },3639 "user_id": {3640 "name": "user_id",3641 "type": "uuid",3642 "primaryKey": false,3643 "notNull": false3644 },3645 "challenge": {3646 "name": "challenge",3647 "type": "text",3648 "primaryKey": false,3649 "notNull": true3650 },3651 "kind": {3652 "name": "kind",3653 "type": "text",3654 "primaryKey": false,3655 "notNull": true3656 },3657 "created_at": {3658 "name": "created_at",3659 "type": "timestamp with time zone",3660 "primaryKey": false,3661 "notNull": true,3662 "default": "now()"3663 }3664 },3665 "indexes": {},3666 "foreignKeys": {},3667 "compositePrimaryKeys": {},3668 "uniqueConstraints": {},3669 "policies": {},3670 "checkConstraints": {},3671 "isRLSEnabled": false3672 },3673 "public.webauthn_credentials": {3674 "name": "webauthn_credentials",3675 "schema": "",3676 "columns": {3677 "id": {3678 "name": "id",3679 "type": "text",3680 "primaryKey": true,3681 "notNull": true3682 },3683 "user_id": {3684 "name": "user_id",3685 "type": "uuid",3686 "primaryKey": false,3687 "notNull": true3688 },3689 "public_key": {3690 "name": "public_key",3691 "type": "text",3692 "primaryKey": false,3693 "notNull": true3694 },3695 "counter": {3696 "name": "counter",3697 "type": "bigint",3698 "primaryKey": false,3699 "notNull": true,3700 "default": 03701 },3702 "transports": {3703 "name": "transports",3704 "type": "jsonb",3705 "primaryKey": false,3706 "notNull": false,3707 "default": "'[]'::jsonb"3708 },3709 "device_type": {3710 "name": "device_type",3711 "type": "text",3712 "primaryKey": false,3713 "notNull": false3714 },3715 "backed_up": {3716 "name": "backed_up",3717 "type": "boolean",3718 "primaryKey": false,3719 "notNull": false,3720 "default": false3721 },3722 "label": {3723 "name": "label",3724 "type": "text",3725 "primaryKey": false,3726 "notNull": false3727 },3728 "created_at": {3729 "name": "created_at",3730 "type": "timestamp with time zone",3731 "primaryKey": false,3732 "notNull": true,3733 "default": "now()"3734 },3735 "last_used_at": {3736 "name": "last_used_at",3737 "type": "timestamp with time zone",3738 "primaryKey": false,3739 "notNull": false3740 }3741 },3742 "indexes": {},3743 "foreignKeys": {3744 "webauthn_credentials_user_id_users_id_fk": {3745 "name": "webauthn_credentials_user_id_users_id_fk",3746 "tableFrom": "webauthn_credentials",3747 "tableTo": "users",3748 "columnsFrom": [3749 "user_id"3750 ],3751 "columnsTo": [3752 "id"3753 ],3754 "onDelete": "cascade",3755 "onUpdate": "no action"3756 }3757 },3758 "compositePrimaryKeys": {},3759 "uniqueConstraints": {},3760 "policies": {},3761 "checkConstraints": {},3762 "isRLSEnabled": false3763 },3764 "public.workspaces": {3765 "name": "workspaces",3766 "schema": "",3767 "columns": {3768 "id": {3769 "name": "id",3770 "type": "uuid",3771 "primaryKey": true,3772 "notNull": true,3773 "default": "gen_random_uuid()"3774 },3775 "owner_id": {3776 "name": "owner_id",3777 "type": "uuid",3778 "primaryKey": false,3779 "notNull": true3780 },3781 "name": {3782 "name": "name",3783 "type": "text",3784 "primaryKey": false,3785 "notNull": true3786 },3787 "slug": {3788 "name": "slug",3789 "type": "text",3790 "primaryKey": false,3791 "notNull": true3792 },3793 "settings": {3794 "name": "settings",3795 "type": "jsonb",3796 "primaryKey": false,3797 "notNull": true,3798 "default": "'{}'::jsonb"3799 },3800 "created_at": {3801 "name": "created_at",3802 "type": "timestamp with time zone",3803 "primaryKey": false,3804 "notNull": true,3805 "default": "now()"3806 },3807 "updated_at": {3808 "name": "updated_at",3809 "type": "timestamp with time zone",3810 "primaryKey": false,3811 "notNull": true,3812 "default": "now()"3813 }3814 },3815 "indexes": {},3816 "foreignKeys": {3817 "workspaces_owner_id_users_id_fk": {3818 "name": "workspaces_owner_id_users_id_fk",3819 "tableFrom": "workspaces",3820 "tableTo": "users",3821 "columnsFrom": [3822 "owner_id"3823 ],3824 "columnsTo": [3825 "id"3826 ],3827 "onDelete": "no action",3828 "onUpdate": "no action"3829 }3830 },3831 "compositePrimaryKeys": {},3832 "uniqueConstraints": {3833 "workspaces_slug_unique": {3834 "name": "workspaces_slug_unique",3835 "nullsNotDistinct": false,3836 "columns": [3837 "slug"3838 ]3839 }3840 },3841 "policies": {},3842 "checkConstraints": {},3843 "isRLSEnabled": false3844 }3845 },3846 "enums": {},3847 "schemas": {},3848 "sequences": {},3849 "roles": {},3850 "policies": {},3851 "views": {},3852 "_meta": {3853 "columns": {},3854 "schemas": {},3855 "tables": {}3856 }3857}