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/project-status.ts
Views: 687
/*1* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45/*6This table contains the current overall status about a running project.7This is the sister-table to "project-info".8In contrast, this table provides much less frequently changed pieces of status information.9For example, project version, certain "alerts", disk usage, etc.10Its intended usage is to subscribe to it once you open a project and notify the user if certain alerts go off.11*/1213import { Table } from "./types";1415Table({16name: "project_status",17fields: {18project_id: {19type: "uuid",20desc: "The project id.",21},22status: {23// change this according to all the usual schema rules24type: "map",25pg_type: "JSONB[]",26desc: "Status of this project",27},28},29rules: {30durability: "ephemeral", // won't be stored in the database at all ever.31desc:32"Project status, like version, certain 'alerts', disk usage, ...",33primary_key: ["project_id"], // can list multiple another field if you want to have multiple records for a project.34user_query: {35get: {36pg_where: ["projects"],37fields: {38project_id: null,39status: null,40},41},42set: {43// users can set that they are interested in this44fields: {45project_id: "project_id",46status: true,47},48},49},5051project_query: {52get: {53pg_where: [{ "project_id = $::UUID": "project_id" }],54fields: {55project_id: null,56status: null,57},58},59set: {60// delete=true, since project *IS* allowed to delete entries61delete: true,62fields: {63project_id: "project_id",64status: true,65},66},67},68},69});707172