Skip to content

Commit

Permalink
migration fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
0xthrpw committed Aug 2, 2024
1 parent 28c6320 commit a1e4f0a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
-------------------------------------------------------------------------------
CREATE
OR REPLACE VIEW PUBLIC.view__events__efp_leaderboard_mutuals AS
SELECT hexlify(r.record_data) as leader, COUNT(r.record_data) as mutuals
SELECT public.hexlify(r.record_data) as leader, COUNT(r.record_data) as mutuals
FROM public.view__join__efp_list_records_with_nft_manager_user_tags r
WHERE hexlify(r.record_data) <> r.user
WHERE public.hexlify(r.record_data) <> r.user
AND EXISTS (
SELECT 1
FROM public.view__join__efp_list_records_with_nft_manager_user_tags r2
WHERE hexlify(r2.record_data) = r.user
AND hexlify(r.record_data) = r2.user
WHERE public.hexlify(r2.record_data) = r.user
AND public.hexlify(r.record_data) = r2.user
)
GROUP BY leader;

Expand Down
27 changes: 22 additions & 5 deletions src/database/generated/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@ export interface EfpAccountMetadata {
export interface EfpLeaderboard {
address: string
avatar: string | null
blocks: Int8 | null
blocks: Generated<Int8 | null>
created_at: Generated<Timestamp | null>
followers: Int8 | null
following: Int8 | null
mutuals: Int8 | null
name: string
followers: Generated<Int8 | null>
following: Generated<Int8 | null>
mutuals: Generated<Int8 | null>
mutuals_rank: Int8 | null
name: string | null
updated_at: Generated<Timestamp | null>
}

Expand Down Expand Up @@ -177,6 +178,11 @@ export interface ViewEventsEfpContracts {
owner: string | null
}

export interface ViewEventsEfpLeaderboardMutuals {
leader: string | null
mutuals: Int8 | null
}

export interface ViewEventsEfpListMetadata {
block_number: Int8 | null
chain_id: Int8 | null
Expand Down Expand Up @@ -273,6 +279,15 @@ export interface ViewEventsLatestRecordTags {
tag: string | null
}

export interface ViewJoinEfpLeaderboard {
address: string | null
blocks: Int8 | null
followers: Int8 | null
following: Int8 | null
mutuals: Int8 | null
mutuals_rank: Int8 | null
}

export interface ViewJoinEfpListRecordsWithNftManagerUserTags {
has_block_tag: boolean | null
has_mute_tag: boolean | null
Expand Down Expand Up @@ -325,6 +340,7 @@ export interface DB {
view__events__efp_account_metadata: ViewEventsEfpAccountMetadata
view__events__efp_accounts_with_primary_list: ViewEventsEfpAccountsWithPrimaryList
view__events__efp_contracts: ViewEventsEfpContracts
view__events__efp_leaderboard_mutuals: ViewEventsEfpLeaderboardMutuals
view__events__efp_list_metadata: ViewEventsEfpListMetadata
view__events__efp_list_nfts: ViewEventsEfpListNfts
view__events__efp_list_ops: ViewEventsEfpListOps
Expand All @@ -333,6 +349,7 @@ export interface DB {
view__events__efp_list_records: ViewEventsEfpListRecords
view__events__efp_list_storage_locations: ViewEventsEfpListStorageLocations
view__events__latest_record_tags: ViewEventsLatestRecordTags
view__join__efp_leaderboard: ViewJoinEfpLeaderboard
view__join__efp_list_records_with_nft_manager_user_tags: ViewJoinEfpListRecordsWithNftManagerUserTags
view__join__efp_list_records_with_tags: ViewJoinEfpListRecordsWithTags
view__latest_follows: ViewLatestFollows
Expand Down

0 comments on commit a1e4f0a

Please sign in to comment.