-
Notifications
You must be signed in to change notification settings - Fork 0
/
motion_sqlite3_schema
37 lines (29 loc) · 1.08 KB
/
motion_sqlite3_schema
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
## exampe output
sqlite> CREATE TABLE security (
...> id INTEGER PRIMARY KEY,
...> camera int(11) DEFAULT NULL,
...> filename char(80) NOT NULL,
...> frame int(11) DEFAULT NULL,
...> file_type int(11) DEFAULT NULL,
...> time_stamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
...> text_event char(40) DEFAULT NULL,
...> downloaded int(1) NOT NULL DEFAULT 0
...> );
sqlite>
## /exampe output
sqlite3 security.db
CREATE TABLE security (
id INTEGER PRIMARY KEY,
camera int(11) DEFAULT NULL,
filename char(80) NOT NULL,
frame int(11) DEFAULT NULL,
file_type int(11) DEFAULT NULL,
time_stamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
text_event char(40) DEFAULT NULL,
downloaded int(1) NOT NULL DEFAULT 0
);
#test data
#sqlite> insert into security(camera, filename, frame, file_type, time_stamp, text_event) values('0', '/var/www/html/cam/2020-01-09-131301-01.jpg', '2', '1', '2020-01-09 22:38:36', '20200109131301')
mv security.db /var/lib/motion/
chmod 664 /var/lib/motion/security.db
chown root:motion /var/lib/motion/security.db