-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.sql
60 lines (57 loc) · 885 Bytes
/
schema.sql
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
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "articles" (
"id" INTEGER,
"author" TEXT,
"year" INTEGER,
"pages" TEXT,
"title" TEXT,
"place" TEXT,
"tags" TEXT,
"data" TEXT,
"file_id" INTEGER,
"filename" TEXT,
PRIMARY KEY("id")
);
CREATE VIRTUAL TABLE "articles_fts" USING FTS5(
author,
year,
pages,
title,
place,
tags,
data,
filename,
detail = full,
content_rowid = 'id',
content = 'articles',
-- This syntax works!
tokenize="unicode61 remove_diacritics 2 tokenchars '-_'"
);
CREATE TRIGGER after_articles_insert
AFTER
INSERT ON articles BEGIN
INSERT INTO articles_fts (
rowid,
author,
year,
pages,
title,
place,
tags,
data,
filename
)
VALUES
(
new.id,
new.author,
new.year,
new.pages,
new.title,
new.place,
new.tags,
new.data,
new.filename
);
END;
COMMIT;