From a484207eb66d7f76a1cf6396bcb18d856e7f9c9f Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Sat, 22 May 2021 09:02:02 -0400 Subject: [PATCH] copy url --- migrations/2021-05-15-071601_assets/up.sql | 10 ++++++++-- sqlx-data.json | 20 ++++++++++---------- src/job/job_queries.rs | 3 ++- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/migrations/2021-05-15-071601_assets/up.sql b/migrations/2021-05-15-071601_assets/up.sql index 967c91b5a1..34596b98a8 100644 --- a/migrations/2021-05-15-071601_assets/up.sql +++ b/migrations/2021-05-15-071601_assets/up.sql @@ -70,7 +70,10 @@ CREATE TABLE tts_models ( ) NOT NULL DEFAULT 'public', -- The filename that was used at upload time. - original_filename VARCHAR(255) NOT NULL, + original_filename VARCHAR(255) DEFAULT NULL, + + -- Where the file was originally downloaded (if it was downloaded) + original_download_url VARCHAR(512) DEFAULT NULL, -- The pytorch model -- For now, this will be a hash of the file contents. @@ -178,7 +181,10 @@ CREATE TABLE w2l_templates ( ) NOT NULL DEFAULT 'public', -- The filename that was used at upload time. - original_filename CHAR(255) NOT NULL, + original_filename CHAR(255) DEFAULT NULL, + + -- Where the file was originally downloaded (if it was downloaded) + original_download_url VARCHAR(512) DEFAULT NULL, -- The original source image/video and the "precomputed" faces private_bucket_hash CHAR(64) NOT NULL, diff --git a/sqlx-data.json b/sqlx-data.json index 322fa1850e..6eb95a1a71 100644 --- a/sqlx-data.json +++ b/sqlx-data.json @@ -651,16 +651,6 @@ ] } }, - "b4fa3ec3e2f65f217ef8a08f54f1366b537d0e99497cd7e2882e8e5a96c4c4ab": { - "query": "\nINSERT INTO tts_models\nSET\n token = ?,\n tts_model_type = \"tacotron2\",\n updatable_slug = ?,\n title = ?,\n description_markdown = '',\n description_rendered_html = '',\n creator_user_token = ?,\n creator_ip_address = ?,\n original_filename = \"TODO\",\n private_bucket_hash = ?\n ", - "describe": { - "columns": [], - "parameters": { - "Right": 6 - }, - "nullable": [] - } - }, "bf489cf419d342d144f072c310d6d70c9073b092b5721f489eaf2ffc8ad3915e": { "query": "\nUPDATE tts_model_upload_jobs\nSET\n status = ?,\n failure_reason = ?,\n retry_at = NOW() + interval 2 minute\nWHERE id = ?\n ", "describe": { @@ -691,6 +681,16 @@ "nullable": [] } }, + "d1c8e0f9c5600fd7c296558cdb3525a2678b3e775f9e2bee0f1da979d4a82d70": { + "query": "\nINSERT INTO tts_models\nSET\n token = ?,\n tts_model_type = \"tacotron2\",\n updatable_slug = ?,\n title = ?,\n description_markdown = '',\n description_rendered_html = '',\n creator_user_token = ?,\n creator_ip_address = ?,\n original_download_url = ?,\n private_bucket_hash = ?\n ", + "describe": { + "columns": [], + "parameters": { + "Right": 7 + }, + "nullable": [] + } + }, "e73192a3e763a287d5737821443c5a81649f17e39978497b99c52e1e896a75f6": { "query": "\nSELECT\n token as session_token,\n user_token\nFROM user_sessions\nWHERE token = ?\nAND deleted_at IS NULL\n ", "describe": { diff --git a/src/job/job_queries.rs b/src/job/job_queries.rs index 24b380949a..91cb43449c 100644 --- a/src/job/job_queries.rs +++ b/src/job/job_queries.rs @@ -129,7 +129,7 @@ SET description_rendered_html = '', creator_user_token = ?, creator_ip_address = ?, - original_filename = "TODO", + original_download_url = ?, private_bucket_hash = ? "#, model_token, @@ -137,6 +137,7 @@ SET job.title.to_string(), job.creator_user_token.clone(), job.creator_ip_address.clone(), + job.download_url.clone(), private_bucket_hash.to_string(), ) .execute(pool)