Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/src/packages/util/db-schema/mentions.ts
Views: 687
/*1* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { Table } from "./types";67Table({8name: "mentions",9fields: {10time: {11type: "timestamp",12desc: "when this mention happened.",13},14project_id: {15type: "uuid",16},17path: {18type: "string",19},20source: {21type: "uuid",22desc: "User who did the mentioning.",23},24target: {25type: "string",26desc: "uuid of user who was mentioned; later will have other possibilities including group names, 'all', etc.",27},28description: {29type: "string",30desc: "Extra text to describe the mention. eg. could be the containing message",31},32fragment_id: {33type: "string",34desc: "Text represenation of fragment_id, which is an indicator of exactly where the mention occurs in the document, e.g., a specific chat or cell in a notebook or line in a file.",35},36priority: {37type: "number",38desc: "optional integer priority. 0 = default, but could be 1 = higher priority, etc.",39},40error: {41type: "string",42desc: "some sort of error occured handling this mention",43},44action: {45type: "string",46desc: "what action was attempted by the backend - 'email', 'ignore'",47},48users: {49type: "map",50desc: "{account_id1: {read: boolean, saved: boolean}, account_id2: {...}}",51},52expire: {53type: "timestamp",54desc: "delete this row after this date, if not null",55},56},57rules: {58primary_key: ["time", "project_id", "path", "target"],59db_standby: "unsafe",60pg_indexes: ["action"],61user_query: {62get: {63pg_where: ["time >= NOW() - interval '45 days'", "projects"],64pg_changefeed: "projects",65options: [{ order_by: "-time" }, { limit: 500 }],66throttle_changes: 2000,67fields: {68time: null,69project_id: null,70path: null,71source: null,72target: null,73priority: null,74description: null,75fragment_id: null,76users: null,77},78},79set: {80fields: {81time({ time }) {82return time || new Date();83},84project_id: "project_write",85path: true,86source: true,87target: true,88priority: true,89description: true,90fragment_id: true,91users: true,92},93required_fields: {94project_id: true,95source: true,96path: true,97target: true,98},99},100},101},102});103104105