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/copy-paths.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";67/*8Requests and status related to copying files between projects.910TODO: for now there are no user queries -- this is used entirely by backend servers,11actually only in kucalc; later that may change, so the user can make copy12requests this way, check on their status, show all current copies they are13causing in a page (that is persistent over browser refreshes, etc.).14That's for later.15*/16Table({17name: "copy_paths",18fields: {19id: {20type: "uuid",21desc: "random unique id assigned to this copy request",22},23time: {24type: "timestamp",25desc: "when this request was made",26},27source_project_id: {28type: "uuid",29desc: "the project_id of the source project",30},31source_path: {32type: "string",33desc: "the path of the source file or directory",34},35target_project_id: {36type: "uuid",37desc: "the project_id of the target project",38},39target_path: {40type: "string",41desc: "the path of the target file or directory",42},43exclude: {44type: "array",45pg_type: "TEXT[]",46desc: "patterns to exclude (each is passed to rsync's --exclude)",47},48overwrite_newer: {49type: "boolean",50desc: "if new, overwrite newer files in destination",51},52delete_missing: {53type: "boolean",54desc: "if true, delete files in the target that aren't in the source path",55},56backup: {57type: "boolean",58desc: "if true, make backup of files before overwriting",59},60public: {61type: "boolean",62desc: "if true, use files from the public share server instead of starting up the project",63},64bwlimit: {65type: "string",66desc: "optional limit on the bandwidth dedicated to this copy (passed to rsync)",67},68timeout: {69type: "number",70desc: "fail if the transfer itself takes longer than this number of seconds (passed to rsync)",71},72scheduled: {73type: "timestamp",74desc: "earliest time in the future, when the copy request should start (or null, for immediate execution)",75},76started: {77type: "timestamp",78desc: "when the copy request actually started running",79},80finished: {81type: "timestamp",82desc: "when the copy request finished",83},84error: {85type: "string",86desc: "if the copy failed or output any errors, they are put here.",87},88expire: {89type: "timestamp",90desc: "delete this row after this date, if not null",91},92},93rules: {94primary_key: "id",9596pg_indexes: [97"time",98"scheduled",99"((started IS NULL))",100"((started IS NOT NULL))",101"((finished IS NULL))",102"((finished IS NOT NULL))",103"((error IS NOT NULL))",104],105},106});107108109