Path: blob/master/src/packages/util/db-schema/client-error-log.ts
1447 views
/*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: "client_error_log",9fields: {10id: {11type: "uuid",12desc: "unique identifier for entry (randomly generated)",13},14event: { type: "string", desc: "arbitrary event label" },15error: {16type: "string",17desc: "the actual error message user saw formatted in JSON",18render: { type: "json-string" },19},20account_id: {21type: "uuid",22desc: "the account_id of the user",23render: {24type: "account",25},26},27time: { type: "timestamp", desc: "when user saw the error" },28expire: {29type: "timestamp",30desc: "when to delete this error automatically from the table to save space",31},32},33rules: {34desc: "Table used to log errors that clients see in their web browser.",35primary_key: "id",36durability: "soft", // loss of some log data not serious, since used only for analytics37pg_indexes: ["time", "event"],38user_query: {39get: {40admin: true,41fields: {42id: null,43event: null,44error: null,45account_id: null,46time: null,47expire: null,48},49},50},51},52});535455