-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_schema_queries.js
67 lines (58 loc) · 1.65 KB
/
create_schema_queries.js
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
63
64
65
66
67
let create_table_markdown_nodes = `
CREATE TABLE IF NOT EXISTS markdown_nodes (
id UUID PRIMARY KEY,
raw_markdown TEXT,
rendered_markdown TEXT,
full_file_path VARCHAR(1024),
title VARCHAR(1024),
yaml_json JSON,
metadata JSON
)`
let create_table_markdown_edges = `
CREATE TABLE IF NOT EXISTS markdown_edges (
link_id UUID PRIMARY_KEY,
label VARCHAR,
title VARCHAR,
from_node_id UUID,
from_node_metadata JSON,
link_mtadata JSON,
to_node_id UUID,
to_node_metadata JSON
)`
let create_table_markdown_key_values = `
CREATE TABLE IF NOT EXISTS markdown_key_values (
id UUID PRIMARY_KEY,
note_id UUID,
tag VARCHAR(1024),
raw_value TEXT,
json_value JSON
)`
let create_table_markdown_syntax_trees = `
CREATE TABLE IF NOT EXISTS markdown_syntax_trees (
id UUID PRIMARY KEY,
markdown_id TEXT,
syntax_tree JSON,
metadata JSON
)`
let html_rendered_from_markdown = `
CREATE TABLE IF NOT EXISTS html_rendered_from_markdown (
id UUID PRIMARY KEY,
markdown_id UUID,
html_content TEXT,
metadata JSON
)`
let urls_extracted_from_markdown = `
CREATE TABLE IF NOT EXISTS urls_extracted_from_nodes (
markdown_node_id UUID,
url TEXT,
domain TEXT
)`
const create_schema_queries = [
create_table_markdown_nodes,
create_table_markdown_edges,
create_table_markdown_key_values,
create_table_markdown_syntax_trees,
html_rendered_from_markdown,
urls_extracted_from_markdown
]
export default create_schema_queries;