diff --git a/ecosystem/nft-metadata-crawler/migrations/2024-10-02-062003_add_asset_uploader_requests_table/down.sql b/ecosystem/nft-metadata-crawler/migrations/2024-10-02-062003_add_asset_uploader_requests_table/down.sql index 8c4d8349ff9da..d30dbd6bc7b12 100644 --- a/ecosystem/nft-metadata-crawler/migrations/2024-10-02-062003_add_asset_uploader_requests_table/down.sql +++ b/ecosystem/nft-metadata-crawler/migrations/2024-10-02-062003_add_asset_uploader_requests_table/down.sql @@ -1,2 +1,2 @@ -DROP INDEX IF EXISTS asset_uploader_request_status_code; +DROP INDEX IF EXISTS asset_uploader_status_code_inserted_at; DROP TABLE IF EXISTS nft_metadata_crawler.asset_uploader_request_statuses; diff --git a/ecosystem/nft-metadata-crawler/migrations/2024-10-02-062003_add_asset_uploader_requests_table/up.sql b/ecosystem/nft-metadata-crawler/migrations/2024-10-02-062003_add_asset_uploader_requests_table/up.sql index 1766b6b6fdd70..384f15fc6c7c4 100644 --- a/ecosystem/nft-metadata-crawler/migrations/2024-10-02-062003_add_asset_uploader_requests_table/up.sql +++ b/ecosystem/nft-metadata-crawler/migrations/2024-10-02-062003_add_asset_uploader_requests_table/up.sql @@ -6,7 +6,8 @@ CREATE TABLE nft_metadata_crawler.asset_uploader_request_statuses ( error_message VARCHAR, cdn_image_uri VARCHAR, num_failures BIGINT NOT NULL DEFAULT 0, + request_received_at TIMESTAMP NOT NULL DEFAULT NOW(), inserted_at TIMESTAMP NOT NULL DEFAULT NOW(), PRIMARY KEY (request_id, asset_uri) ); -CREATE INDEX IF NOT EXISTS asset_uploader_request_status_code ON nft_metadata_crawler.asset_uploader_request_statuses (status_code); +CREATE INDEX IF NOT EXISTS asset_uploader_status_code_inserted_at ON nft_metadata_crawler.asset_uploader_request_statuses (status_code, inserted_at); diff --git a/ecosystem/nft-metadata-crawler/src/models/asset_uploader_request_statuses_query.rs b/ecosystem/nft-metadata-crawler/src/models/asset_uploader_request_statuses_query.rs index 7ad868422ec73..0b7ed72e9f3cb 100644 --- a/ecosystem/nft-metadata-crawler/src/models/asset_uploader_request_statuses_query.rs +++ b/ecosystem/nft-metadata-crawler/src/models/asset_uploader_request_statuses_query.rs @@ -18,5 +18,6 @@ pub struct AssetUploaderRequestStatusesQuery { pub error_message: Option, pub cdn_image_uri: Option, pub num_failures: i64, + pub request_received_at: chrono::NaiveDateTime, pub inserted_at: chrono::NaiveDateTime, } diff --git a/ecosystem/nft-metadata-crawler/src/schema.rs b/ecosystem/nft-metadata-crawler/src/schema.rs index 39a543ab7b139..fbe433201f0ad 100644 --- a/ecosystem/nft-metadata-crawler/src/schema.rs +++ b/ecosystem/nft-metadata-crawler/src/schema.rs @@ -1,6 +1,3 @@ -// Copyright © Aptos Foundation -// SPDX-License-Identifier: Apache-2.0 - // @generated automatically by Diesel CLI. pub mod nft_metadata_crawler { @@ -13,6 +10,7 @@ pub mod nft_metadata_crawler { error_message -> Nullable, cdn_image_uri -> Nullable, num_failures -> Int8, + request_received_at -> Timestamp, inserted_at -> Timestamp, } }