Adds download_at to files, skips files that are impossible to download
This commit is contained in:
8
migrations/20210729031521_add_downloaded_at_to_files.sql
Normal file
8
migrations/20210729031521_add_downloaded_at_to_files.sql
Normal 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";
|
||||
Reference in New Issue
Block a user