CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/util/db-schema/file-access-log.ts
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
import { Table } from "./types";
7
8
Table({
9
name: "file_access_log",
10
rules: {
11
primary_key: "id",
12
durability: "soft", // loss of some log data not serious, since used only for analytics
13
pg_indexes: ["project_id", "account_id", "filename", "time"],
14
user_query: {
15
get: {
16
admin: true,
17
fields: {
18
id: null,
19
project_id: null,
20
account_id: null,
21
filename: null,
22
time: null,
23
},
24
},
25
},
26
},
27
fields: {
28
id: {
29
type: "uuid",
30
},
31
project_id: {
32
type: "uuid",
33
render: { type: "project_link" },
34
},
35
account_id: {
36
type: "uuid",
37
render: { type: "account" },
38
},
39
filename: {
40
type: "string",
41
},
42
time: {
43
type: "timestamp",
44
},
45
expire: {
46
type: "timestamp",
47
desc: "Either expire after the given PII retention period, or after 1 year, whichever is sooner.",
48
},
49
},
50
});
51
52