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/news.ts
Views: 687
/*1* This file is part of CoCalc: Copyright © 2023 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { ID } from "./crm";6import { Table } from "./types";78Table({9name: "news",10fields: {11id: ID,12date: {13type: "timestamp",14desc: "date of this news item",15},16title: {17type: "string",18desc: "short title of this news item",19},20text: {21type: "string",22desc: "markdown text of this news item",23},24tags: {25type: "array",26pg_type: "TEXT[]",27desc: "list of strings, e.g. ['jupyter', 'python']",28},29url: {30type: "string",31desc: "optional url",32},33channel: {34type: "string",35desc: 'e.g. "announcement", "feature", …', // defined in @cocalc/util/types/news → CHANNELS36},37hide: {38type: "boolean",39desc: "optionally, hide/retract this news item",40},41history: {42type: "map",43desc: "history of changes to this news item",44},45},46rules: {47primary_key: "id",48pg_indexes: ["date"],49anonymous: true, // allow users read access, even if not signed in50user_query: {51get: {52pg_where: [53"date >= NOW() - INTERVAL '3 months'",54"date <= NOW() + INTERVAL '1 minute'",55"channel != 'event'",56"hide IS NOT true",57],58pg_changefeed: "news",59options: [{ order_by: "-date" }, { limit: 100 }],60throttle_changes: 60 * 1000,61fields: {62// we only send title, and a link to open the news item63id: null,64date: null,65title: null,66tags: null,67channel: null,68hide: null,69},70},71// no set, all done via v2 API72},73},74});757677