~aleteoryx/muditaos

ref: 2e6899a4923ef53e5f02e9a018aec1967e7eed82 muditaos/image/user/db/file_indexer_001.sql -rw-r--r-- 1003 bytes
2e6899a4 — Marek Niepieklo [CP-2] I don't want to see data from Pure in Center when Pure is locked 4 years ago
                                                                                
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
-- Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
-- For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

-- Main file table
CREATE TABLE IF NOT EXISTS file_tab (
    file_id INTEGER,
    path TEXT NOT NULL UNIQUE,
    size INTEGER,
    mime_type INTEGER,
    mtime INTEGER,
    directory TEXT,
    file_type INTEGER,
    PRIMARY KEY (file_id),
    CONSTRAINT file_path_unique
        UNIQUE (file_id, path) ON CONFLICT REPLACE
    );

-- Table contains information
-- about file metadata.
CREATE TABLE IF NOT EXISTS metadata_tab (
    file_id INTEGER NOT NULL,
    property TEXT NOT NULL,
    value TEXT NOT NULL,
    PRIMARY KEY (file_id, property),
    FOREIGN KEY (file_id) REFERENCES file_tab(file_id)
    );

-- Table contains information who to inform
-- about changes in values.
CREATE TABLE IF NOT EXISTS notifications_tab (
    id INTEGER PRIMARY KEY,
    path TEXT NOT NULL,
    service TEXT,
    CONSTRAINT notification_unique
         UNIQUE(path, service)
);