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/bookmarks.ts
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2024 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
import { Table } from "./types";
7
import { ID } from "./crm";
8
9
// This table stores various types of bookmarks. This started with backing up starred tabs for a user in a project.
10
Table({
11
name: "bookmarks",
12
fields: {
13
id: ID,
14
type: {
15
type: "string",
16
desc: "Type of bookmark as defined in @cocalc/util/consts/bookmarks",
17
},
18
project_id: {
19
type: "uuid",
20
desc: "The Project ID where this bookmark belongs to",
21
},
22
account_id: {
23
type: "uuid",
24
desc: "(optional) if not set, this bookmark is project wide, for all collaborators",
25
},
26
path: {
27
type: "string",
28
desc: "(optional) path to a specific file in the project",
29
},
30
stars: {
31
type: "array",
32
pg_type: "TEXT[]",
33
desc: " a list of strings of paths or IDs",
34
},
35
last_edited: {
36
type: "timestamp",
37
desc: "When the bookmark last changed",
38
},
39
},
40
rules: {
41
desc: "Table for various types of bookmarks.",
42
primary_key: "id",
43
pg_indexes: ["type", "project_id", "account_id"],
44
user_query: {},
45
},
46
});
47
48