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/collaborators.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: "collaborators",9fields: {10account_id: true,11first_name: true,12last_name: true,13name: true,14last_active: true,15profile: true,16},17rules: {18primary_key: "account_id",19db_standby: "unsafe",20anonymous: false,21virtual: "accounts",22user_query: {23get: {24pg_where: [25{26"account_id = ANY(SELECT DISTINCT jsonb_object_keys(users)::UUID FROM projects WHERE users ? $::TEXT)":27"account_id",28},29],30pg_changefeed: "collaborators",31fields: {32account_id: null,33first_name: "",34last_name: "",35name: "",36last_active: null,37profile: null,38},39},40},41},42});4344// This table does NOT support changefeeds.45Table({46name: "collaborators_one_project",47fields: {48account_id: true,49project_id: true,50first_name: true,51last_name: true,52name: true,53last_active: true,54profile: true,55},56rules: {57primary_key: "account_id",58db_standby: "unsafe",59anonymous: false,60virtual: "accounts",61user_query: {62get: {63pg_where: [64{65"account_id = ANY(SELECT DISTINCT jsonb_object_keys(users)::UUID FROM projects WHERE project_id = $::UUID)":66"project_id",67},68],69remove_from_query: [70"project_id",71] /* this is only used for the pg_where and removed from the actual query */,72fields: {73account_id: null,74project_id: null,75first_name: "",76last_name: "",77name: "",78last_active: null,79profile: null,80},81},82},83},84});858687