Trash for tables and records
Trash for tables and records
trash with tableId sends the table to the trash with its records and formats; with tableId and recordIds, only those records. A record can be trashed by whoever wrote it or by someone with write on the table; a table, by someone with write on it. In the trash, the table and the records disappear from table_list, table_get, record_read, record_history, table_export and sql, and writing to them fails with trashed. Another table may take a trashed table’s name.
restore brings back the table, with its records and formats, or the records, exactly as they were, without a new revision. After recoverUntil (30 days) it fails with restore_expired, and Siglata erases the item for good.
purge with confirm: true erases what is in the trash for good: every revision of a record, or the whole table with its schemas, records, formats and exports. The room they took is freed, and their source and template files are no longer held by the table. Exported files stay where they are: exportFileIds lists the ones that still hold the erased data, so you can make a fresh export and trash the old ones.