diff --git a/db/queries/api/v1/discover/create_view__discover.sql b/db/queries/api/v1/discover/create_view__discover.sql index dd612c8..4cd2542 100644 --- a/db/queries/api/v1/discover/create_view__discover.sql +++ b/db/queries/api/v1/discover/create_view__discover.sql @@ -11,7 +11,7 @@ SELECT l.followers, l.following FROM public.view__latest_follows r -LEFT JOIN efp_leaderboard l ON l.address = r.address; +LEFT JOIN public.efp_leaderboard l ON l.address = r.address; diff --git a/db/queries/api/v1/leaderboard/ranked/create_view__join__efp_leaderboard.sql b/db/queries/api/v1/leaderboard/ranked/create_view__join__efp_leaderboard.sql index b21b51d..c5dea36 100644 --- a/db/queries/api/v1/leaderboard/ranked/create_view__join__efp_leaderboard.sql +++ b/db/queries/api/v1/leaderboard/ranked/create_view__join__efp_leaderboard.sql @@ -18,12 +18,12 @@ SELECT ORDER BY fing.following_count DESC NULLS LAST ) as following_rank, RANK () OVER ( - ORDER BY blocks.blocks_count DESC NULLS LAST + ORDER BY blocks.blocked_count DESC NULLS LAST ) as blocks_rank, COALESCE(mut.mutuals, 0 ) as mutuals, COALESCE(fers.followers_count, 0 ) as followers, COALESCE(fing.following_count, 0 ) as following, - COALESCE(blocks.blocks_count, 0 ) as blocks + COALESCE(blocks.blocked_count, 0 ) as blocks FROM query.get_leaderboard_followers(10000) fers LEFT OUTER JOIN query.get_leaderboard_following(10000) fing ON fing.address = fers.address LEFT OUTER JOIN query.get_leaderboard_blocked(10000) blocks ON blocks.address = fers.address diff --git a/db/queries/api/v1/stats/create_view__events__efp_stats.sql b/db/queries/api/v1/stats/create_view__events__efp_stats.sql index 7d50155..122aa43 100644 --- a/db/queries/api/v1/stats/create_view__events__efp_stats.sql +++ b/db/queries/api/v1/stats/create_view__events__efp_stats.sql @@ -5,7 +5,7 @@ CREATE OR REPLACE VIEW PUBLIC.view__efp_stats AS SELECT - COUNT(DISTINCT (hexlify(record_data))) as address_count, + COUNT(DISTINCT (public.hexlify(record_data))) as address_count, MAX (token_id) as list_count, COUNT(*) as list_op_count FROM diff --git a/db/queries/api/v1/discover/create_view__latest_follows.sql b/db/schema/050__views/004/events__efp_discover/create_view__latest_follows.sql similarity index 100% rename from db/queries/api/v1/discover/create_view__latest_follows.sql rename to db/schema/050__views/004/events__efp_discover/create_view__latest_follows.sql diff --git a/src/database/generated/index.ts b/src/database/generated/index.ts index bd4d118..8ffd271 100644 --- a/src/database/generated/index.ts +++ b/src/database/generated/index.ts @@ -125,6 +125,14 @@ export interface EfpLists { user: string } +export interface EfpRecommended { + address: string + avatar: string | null + class: string | null + created_at: Generated + name: string +} + export interface EnsMetadata { address: string avatar: string | null @@ -158,6 +166,20 @@ export interface SchemaMigrations { version: string } +export interface ViewDiscover { + address: string | null + avatar: string | null + followers: Int8 | null + following: Int8 | null + name: string | null +} + +export interface ViewEfpStats { + address_count: Int8 | null + list_count: Int8 | null + list_op_count: Int8 | null +} + export interface ViewEventsEfpAccountMetadata { address: string | null block_number: Int8 | null @@ -273,6 +295,14 @@ export interface ViewEventsEfpListStorageLocations { efp_list_storage_location_version: number | null } +export interface ViewEventsEfpRecommended { + address: string | null + avatar: string | null + class: string | null + created_at: Timestamp | null + name: string | null +} + export interface ViewEventsLatestRecordTags { chain_id: Int8 | null contract_address: string | null @@ -362,9 +392,12 @@ export interface DB { efp_list_record_tags: EfpListRecordTags efp_list_records: EfpListRecords efp_lists: EfpLists + efp_recommended: EfpRecommended ens_metadata: EnsMetadata events: Events schema_migrations: SchemaMigrations + view__discover: ViewDiscover + view__efp_stats: ViewEfpStats view__events__efp_account_metadata: ViewEventsEfpAccountMetadata view__events__efp_accounts_with_primary_list: ViewEventsEfpAccountsWithPrimaryList view__events__efp_contracts: ViewEventsEfpContracts @@ -376,6 +409,7 @@ export interface DB { view__events__efp_list_record_tags: ViewEventsEfpListRecordTags view__events__efp_list_records: ViewEventsEfpListRecords view__events__efp_list_storage_locations: ViewEventsEfpListStorageLocations + view__events__efp_recommended: ViewEventsEfpRecommended view__events__latest_record_tags: ViewEventsLatestRecordTags view__join__efp_leaderboard: ViewJoinEfpLeaderboard view__join__efp_list_records_with_nft_manager_user_tags: ViewJoinEfpListRecordsWithNftManagerUserTags