Adds download_at to files, skips files that are impossible to download

This commit is contained in:
2021-07-28 23:54:39 -04:00
parent 8a356ac7f5
commit a8424e830e
4 changed files with 49 additions and 8 deletions

View File

@@ -0,0 +1,8 @@
ALTER TABLE "files" ADD COLUMN "downloaded_at" TIMESTAMP(3);
/* Backfill existing columns the created_at timestamps.
*
* This is approximate since usually the file was downloaded shortly after the record was created.
* I mostly only care whether it is null or not null. All existing files need non-null values.
*/
UPDATE "files" SET "downloaded_at" = "created_at";