(core) Migrate Attachments columns from marshalled blobs to JSON

Summary: Adds a migration in preparation for future work on tracking and deleting attachments. This includes a `_grist_Attachments.timeDeleted` column which isn't used yet, and changing the storage format of user columns of type `Attachments`. DocStorage now treats Attachments like RefList in general (since they use JSON), which also prompted a tiny bit of refactoring.

Test Plan: Added a migration test case showing the change in format.

Reviewers: dsagal

Reviewed By: dsagal

Differential Revision: https://phab.getgrist.com/D3352
This commit is contained in:
Alex Hall
2022-04-01 23:55:59 +02:00
parent 22807fce8e
commit 251d79704b
8 changed files with 42 additions and 16 deletions

View File

@@ -4,7 +4,7 @@ import { GristObjCode } from "app/plugin/GristData";
// tslint:disable:object-literal-key-quotes
export const SCHEMA_VERSION = 27;
export const SCHEMA_VERSION = 28;
export const schema = {
@@ -148,6 +148,7 @@ export const schema = {
fileSize : "Int",
imageHeight : "Int",
imageWidth : "Int",
timeDeleted : "DateTime",
timeUploaded : "DateTime",
},
@@ -338,6 +339,7 @@ export interface SchemaTypes {
fileSize: number;
imageHeight: number;
imageWidth: number;
timeDeleted: number;
timeUploaded: number;
};