-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstant.schema.ts
62 lines (56 loc) · 1.68 KB
/
instant.schema.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// blogBuilder
// https://instantdb.com/dash?s=main&t=home&app=3b4a73a0-ffc6-488a-b883-550004ff6e0a
import { i } from "@instantdb/core";
import { Reflection, Introduction } from "@/lib/types";
// Example entities and links (you can delete these!)
const graph = i.graph(
{
dailyBlogs: i.entity({
date: i.string().indexed(),
day_count: i.number().indexed(),
blog_title: i.string().optional(),
blog_description: i.string().optional(),
blog_tags: i.json().optional(),
introduction: i.json<Introduction>().optional(),
reflection: i.json<Reflection>().optional(),
status: i.string().optional(),
created_at: i.string(),
updated_at: i.string(),
}),
task: i.entity({
challenges_encountered: i.string().optional(),
follow_up_tasks: i.string().optional(),
output_or_result: i.string().optional(),
reflection_failures: i.string().optional(),
reflection_successes: i.string().optional(),
research_questions: i.string().optional(),
task_description: i.string().optional(),
task_expected_difficulty: i.string().optional(),
task_goal: i.string().optional(),
task_name: i.string().optional(),
task_planned_approach: i.string().optional(),
task_progress_notes: i.string().optional(),
task_reflection_summary: i.string().optional(),
time_spent_coding: i.string().optional(),
time_spent_debugging: i.string().optional(),
time_spent_researching: i.string().optional(),
tools_used: i.string().optional(),
task_created_at: i.string(),
}),
},
{
tasks: {
forward: {
on: 'dailyBlogs',
has: 'many',
label: 'tasks',
},
reverse: {
on: 'task',
has: 'one',
label: 'dailyBlog',
},
},
},
);
export default graph;