(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

@@ -15,7 +15,7 @@ import six
import actions
SCHEMA_VERSION = 27
SCHEMA_VERSION = 28
def make_column(col_id, col_type, formula='', isFormula=False):
return {
@@ -235,6 +235,7 @@ def schema_create_actions():
make_column("fileSize", "Int"), # The size in bytes
make_column("imageHeight", "Int"), # height in pixels
make_column("imageWidth", "Int"), # width in pixels
make_column("timeDeleted", "DateTime"),
make_column("timeUploaded", "DateTime")
]),