Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Schema.sql « Database schema « Database « Server « Duplicati - github.com/duplicati/duplicati.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6cc17ae733a466e5d2046be8d7da5810578c9d98 (plain)
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/*
 * The primary table that stores all backups.
 *
 * The name and tag are free form user strings.
 * The tags are comma separated
 * the TargetURL is the url to remote storage,
 * and the DBPath is the path to the local database
 */
CREATE TABLE "Backup" (
    "ID" INTEGER PRIMARY KEY AUTOINCREMENT,
    "Name" TEXT NOT NULL,
    "Tags" TEXT NOT NULL,
    "TargetURL" TEXT NOT NULL,
    "DBPath" TEXT NOT NULL
);

/*
 * The table that stores all schedules
 * 
 * Tags is a comma separated parsed field that indicates 
 * which backups to run when activated.
 * special tags are ID:1 which means backup with ID = 1
 * 
 * Time is the scheduled time, and lastRun is the last time the backup was executed
 *
 * Rule is a special parsed field
 */
CREATE TABLE "Schedule" (
    "ID" INTEGER PRIMARY KEY,
    "Tags" TEXT NOT NULL,
    "Time" INTEGER NOT NULL,
    "Repeat" TEXT NOT NULL,
    "LastRun" INTEGER NOT NULL,
    "Rule" TEXT NOT NULL
);

/*
 * The source table is a list of source folders and files
 */
CREATE TABLE "Source" (
    "BackupID" INTEGER NOT NULL,
    "Path" TEXT NOT NULL
);

/*
 * The filter table contains all filters associated with a backup.
 * The special backupID -1 means "applied to all backups"
 * The expression is the filter, if the filter is a regular
 * expression, it is surrounded by hard brackets [ ]
 */
CREATE TABLE "Filter" (
    "BackupID" INTEGER NOT NULL,
    "Order" INTEGER NOT NULL,
    "Include" INTEGER NOT NULL,
    "Expression" TEXT NOT NULL
);

/*
 * All options are stored in this table
 *
 * The special backupID -1 means "applied to all backups".
 *
 * The filter is used to indicate what the option applies to,
 * for instance backend:s3 will only apply to backends of type S3
 *
 * The name and value are the option name and value
 */
CREATE TABLE "Option" (
    "BackupID" INTEGER NOT NULL,
    "Filter" TEXT NOT NULL,
    "Name" TEXT NOT NULL,
    "Value" TEXT NOT NULL
);

/*
 * Recorded metadata about a backup
 * This table contains metadata, such as when the backup was last started,
 * how long it took, how many files there were, how big the backup set was,
 * how much data was uploaded, downloaded, how fast, how much space is left,
 * and similar data. Programs can use this information to improve the display,
 * but cannot count on these values being present
 */
CREATE TABLE "Metadata" (
    "BackupID" INTEGER NOT NULL,
    "Name" TEXT NOT NULL,
    "Value" TEXT NOT NULL
);

/*
 * The log of operations initiated by the scheduler/user
 */
CREATE TABLE "Log" (
    "BackupID" INTEGER NOT NULL,
    "Description" TEXT NOT NULL,
    "Start" INTEGER NOT NULL,
    "Finish" INTEGER NOT NULL,
    "Result" TEXT NOT NULL,
    "SuggestedIcon" TEXT NOT NULL
);

/*
 * The log of errors
 */
CREATE TABLE "ErrorLog" (
    "BackupID" INTEGER,
    "Message" TEXT NOT NULL,
    "Exception" TEXT,
    "Timestamp" INTEGER NOT NULL
);

/*
Internal version tracking
*/
CREATE TABLE "Version" (
    "ID" INTEGER PRIMARY KEY,
    "Version" INTEGER NOT NULL
);

/*
Notifications not yet acknowledged by the user
*/
CREATE TABLE "Notification" (
    "ID" INTEGER PRIMARY KEY,
    "Type" TEXT NOT NULL,
    "Title" TEXT NOT NULL,
    "Message" TEXT NOT NULL, 
    "Exception" TEXT NOT NULL, 
    "BackupID" TEXT NULL,
    "Action" TEXT NOT NULL,
    "Timestamp" INTEGER NOT NULL
);

/*
Key/value storage for frontends
*/
CREATE TABLE "UIStorage" (
    "Scheme" TEXT NOT NULL, 
    "Key" TEXT NOT NULL, 
    "Value" TEXT NOT NULL
);

/*
Long-term temporary file records
*/
CREATE TABLE "TempFile" (
    "ID" INTEGER PRIMARY KEY,
    "Origin" TEXT NOT NULL, 
    "Path" TEXT NOT NULL, 
    "Timestamp" INTEGER NOT NULL,
    "Expires" INTEGER NOT NULL
);

INSERT INTO "Version" ("Version") VALUES (4);