diff --git a/packages/pds/src/app-view/db/index.ts b/packages/pds/src/app-view/db/index.ts deleted file mode 100644 index e0eefa54edd..00000000000 --- a/packages/pds/src/app-view/db/index.ts +++ /dev/null @@ -1,40 +0,0 @@ -import * as duplicateRecords from './tables/duplicate-record' -import * as profile from './tables/profile' -import * as profileAgg from './tables/profile-agg' -import * as post from './tables/post' -import * as postAgg from './tables/post-agg' -import * as postEmbed from './tables/post-embed' -import * as postHierarchy from './tables/post-hierarchy' -import * as repost from './tables/repost' -import * as feedItem from './tables/feed-item' -import * as follow from './tables/follow' -import * as list from './tables/list' -import * as listItem from './tables/list-item' -import * as actorBlock from './tables/actor-block' -import * as like from './tables/like' -import * as feedGenerator from './tables/feed-generator' -import * as subscription from './tables/subscription' -import * as algo from './tables/algo' -import * as viewParam from './tables/view-param' -import * as suggestedFollow from './tables/suggested-follow' - -// @NOTE app-view also shares did-handle, record, and repo-root tables w/ main pds -export type DatabaseSchemaType = duplicateRecords.PartialDB & - profile.PartialDB & - profileAgg.PartialDB & - post.PartialDB & - postAgg.PartialDB & - postEmbed.PartialDB & - postHierarchy.PartialDB & - repost.PartialDB & - feedItem.PartialDB & - follow.PartialDB & - list.PartialDB & - listItem.PartialDB & - actorBlock.PartialDB & - like.PartialDB & - feedGenerator.PartialDB & - subscription.PartialDB & - algo.PartialDB & - viewParam.PartialDB & - suggestedFollow.PartialDB diff --git a/packages/pds/src/app-view/db/tables/actor-block.ts b/packages/pds/src/app-view/db/tables/actor-block.ts deleted file mode 100644 index 8923e921071..00000000000 --- a/packages/pds/src/app-view/db/tables/actor-block.ts +++ /dev/null @@ -1,11 +0,0 @@ -export const tableName = 'actor_block' -export interface ActorBlock { - uri: string - cid: string - creator: string - subjectDid: string - createdAt: string - indexedAt: string -} - -export type PartialDB = { [tableName]: ActorBlock } diff --git a/packages/pds/src/app-view/db/tables/algo.ts b/packages/pds/src/app-view/db/tables/algo.ts deleted file mode 100644 index e38a64c4a69..00000000000 --- a/packages/pds/src/app-view/db/tables/algo.ts +++ /dev/null @@ -1,12 +0,0 @@ -// @NOTE postgres-only -export const whatsHotViewTableName = 'algo_whats_hot_view' - -export interface AlgoWhatsHotView { - uri: string - cid: string - score: number -} - -export type PartialDB = { - [whatsHotViewTableName]: AlgoWhatsHotView -} diff --git a/packages/pds/src/app-view/db/tables/duplicate-record.ts b/packages/pds/src/app-view/db/tables/duplicate-record.ts deleted file mode 100644 index 3cad0cd148b..00000000000 --- a/packages/pds/src/app-view/db/tables/duplicate-record.ts +++ /dev/null @@ -1,12 +0,0 @@ -export interface DuplicateRecord { - uri: string - cid: string - duplicateOf: string - indexedAt: string -} - -export const tableName = 'duplicate_record' - -export type PartialDB = { - [tableName]: DuplicateRecord -} diff --git a/packages/pds/src/app-view/db/tables/feed-generator.ts b/packages/pds/src/app-view/db/tables/feed-generator.ts deleted file mode 100644 index 0b33f05cb12..00000000000 --- a/packages/pds/src/app-view/db/tables/feed-generator.ts +++ /dev/null @@ -1,18 +0,0 @@ -export const tableName = 'feed_generator' - -export interface FeedGenerator { - uri: string - cid: string - creator: string - feedDid: string - displayName: string - description: string | null - descriptionFacets: string | null - avatarCid: string | null - createdAt: string - indexedAt: string -} - -export type PartialDB = { - [tableName]: FeedGenerator -} diff --git a/packages/pds/src/app-view/db/tables/feed-item.ts b/packages/pds/src/app-view/db/tables/feed-item.ts deleted file mode 100644 index 2fb7f867311..00000000000 --- a/packages/pds/src/app-view/db/tables/feed-item.ts +++ /dev/null @@ -1,12 +0,0 @@ -export const tableName = 'feed_item' - -export interface FeedItem { - uri: string - cid: string - type: 'post' | 'repost' - postUri: string - originatorDid: string - sortAt: string -} - -export type PartialDB = { [tableName]: FeedItem } diff --git a/packages/pds/src/app-view/db/tables/follow.ts b/packages/pds/src/app-view/db/tables/follow.ts deleted file mode 100644 index b6ba34aea43..00000000000 --- a/packages/pds/src/app-view/db/tables/follow.ts +++ /dev/null @@ -1,11 +0,0 @@ -export const tableName = 'follow' -export interface Follow { - uri: string - cid: string - creator: string - subjectDid: string - createdAt: string - indexedAt: string -} - -export type PartialDB = { [tableName]: Follow } diff --git a/packages/pds/src/app-view/db/tables/like.ts b/packages/pds/src/app-view/db/tables/like.ts deleted file mode 100644 index 48edac21fde..00000000000 --- a/packages/pds/src/app-view/db/tables/like.ts +++ /dev/null @@ -1,13 +0,0 @@ -export interface Like { - uri: string - cid: string - creator: string - subject: string - subjectCid: string - createdAt: string - indexedAt: string -} - -const tableName = 'like' - -export type PartialDB = { [tableName]: Like } diff --git a/packages/pds/src/app-view/db/tables/list-item.ts b/packages/pds/src/app-view/db/tables/list-item.ts deleted file mode 100644 index 7e70e718169..00000000000 --- a/packages/pds/src/app-view/db/tables/list-item.ts +++ /dev/null @@ -1,13 +0,0 @@ -export const tableName = 'list_item' - -export interface ListItem { - uri: string - cid: string - creator: string - subjectDid: string - listUri: string - createdAt: string - indexedAt: string -} - -export type PartialDB = { [tableName]: ListItem } diff --git a/packages/pds/src/app-view/db/tables/list.ts b/packages/pds/src/app-view/db/tables/list.ts deleted file mode 100644 index d2db17574d2..00000000000 --- a/packages/pds/src/app-view/db/tables/list.ts +++ /dev/null @@ -1,16 +0,0 @@ -export const tableName = 'list' - -export interface List { - uri: string - cid: string - creator: string - name: string - purpose: string - description: string | null - descriptionFacets: string | null - avatarCid: string | null - createdAt: string - indexedAt: string -} - -export type PartialDB = { [tableName]: List } diff --git a/packages/pds/src/app-view/db/tables/post-agg.ts b/packages/pds/src/app-view/db/tables/post-agg.ts deleted file mode 100644 index 5341347403d..00000000000 --- a/packages/pds/src/app-view/db/tables/post-agg.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Generated } from 'kysely' - -export const tableName = 'post_agg' - -export interface PostAgg { - uri: string - likeCount: Generated - replyCount: Generated - repostCount: Generated -} - -export type PartialDB = { - [tableName]: PostAgg -} diff --git a/packages/pds/src/app-view/db/tables/post-embed.ts b/packages/pds/src/app-view/db/tables/post-embed.ts deleted file mode 100644 index 69c44efe718..00000000000 --- a/packages/pds/src/app-view/db/tables/post-embed.ts +++ /dev/null @@ -1,30 +0,0 @@ -export const imageTableName = 'post_embed_image' -export const externalTableName = 'post_embed_external' -export const recordTableName = 'post_embed_record' - -export interface PostEmbedImage { - postUri: string - position: number - imageCid: string - alt: string -} - -export interface PostEmbedExternal { - postUri: string - uri: string - title: string - description: string - thumbCid: string | null -} - -export interface PostEmbedRecord { - postUri: string - embedUri: string - embedCid: string -} - -export type PartialDB = { - [imageTableName]: PostEmbedImage - [externalTableName]: PostEmbedExternal - [recordTableName]: PostEmbedRecord -} diff --git a/packages/pds/src/app-view/db/tables/post-hierarchy.ts b/packages/pds/src/app-view/db/tables/post-hierarchy.ts deleted file mode 100644 index 70c44f67ce4..00000000000 --- a/packages/pds/src/app-view/db/tables/post-hierarchy.ts +++ /dev/null @@ -1,10 +0,0 @@ -export const tableName = 'post_hierarchy' -export interface PostHierarchy { - uri: string - ancestorUri: string - depth: number -} - -export type PartialDB = { - [tableName]: PostHierarchy -} diff --git a/packages/pds/src/app-view/db/tables/post.ts b/packages/pds/src/app-view/db/tables/post.ts deleted file mode 100644 index ce7c2b7acbe..00000000000 --- a/packages/pds/src/app-view/db/tables/post.ts +++ /dev/null @@ -1,18 +0,0 @@ -export const tableName = 'post' - -export interface Post { - uri: string - cid: string - creator: string - text: string - replyRoot: string | null - replyRootCid: string | null - replyParent: string | null - replyParentCid: string | null - createdAt: string - indexedAt: string -} - -export type PartialDB = { - [tableName]: Post -} diff --git a/packages/pds/src/app-view/db/tables/profile-agg.ts b/packages/pds/src/app-view/db/tables/profile-agg.ts deleted file mode 100644 index 333a5136461..00000000000 --- a/packages/pds/src/app-view/db/tables/profile-agg.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Generated } from 'kysely' - -export const tableName = 'profile_agg' - -export interface ProfileAgg { - did: string - followersCount: Generated - followsCount: Generated - postsCount: Generated -} - -export type PartialDB = { - [tableName]: ProfileAgg -} diff --git a/packages/pds/src/app-view/db/tables/profile.ts b/packages/pds/src/app-view/db/tables/profile.ts deleted file mode 100644 index 6f8fac50aa5..00000000000 --- a/packages/pds/src/app-view/db/tables/profile.ts +++ /dev/null @@ -1,13 +0,0 @@ -export const tableName = 'profile' - -export interface Profile { - uri: string - cid: string - creator: string - displayName: string | null - description: string | null - avatarCid: string | null - bannerCid: string | null - indexedAt: string -} -export type PartialDB = { [tableName]: Profile } diff --git a/packages/pds/src/app-view/db/tables/repost.ts b/packages/pds/src/app-view/db/tables/repost.ts deleted file mode 100644 index 8a0fadd6611..00000000000 --- a/packages/pds/src/app-view/db/tables/repost.ts +++ /dev/null @@ -1,13 +0,0 @@ -export const tableName = 'repost' - -export interface Repost { - uri: string - cid: string - creator: string - subject: string - subjectCid: string - createdAt: string - indexedAt: string -} - -export type PartialDB = { [tableName]: Repost } diff --git a/packages/pds/src/app-view/db/tables/subscription.ts b/packages/pds/src/app-view/db/tables/subscription.ts deleted file mode 100644 index 62a49d0b29b..00000000000 --- a/packages/pds/src/app-view/db/tables/subscription.ts +++ /dev/null @@ -1,9 +0,0 @@ -export const tableName = 'subscription' - -export interface Subscription { - service: string - method: string - state: string -} - -export type PartialDB = { [tableName]: Subscription } diff --git a/packages/pds/src/app-view/db/tables/suggested-follow.ts b/packages/pds/src/app-view/db/tables/suggested-follow.ts deleted file mode 100644 index 6ad10f43203..00000000000 --- a/packages/pds/src/app-view/db/tables/suggested-follow.ts +++ /dev/null @@ -1,10 +0,0 @@ -export const tableName = 'suggested_follow' - -export interface SuggestedFollow { - did: string - order: number -} - -export type PartialDB = { - [tableName]: SuggestedFollow -} diff --git a/packages/pds/src/app-view/db/tables/view-param.ts b/packages/pds/src/app-view/db/tables/view-param.ts deleted file mode 100644 index 07e3b08f0cf..00000000000 --- a/packages/pds/src/app-view/db/tables/view-param.ts +++ /dev/null @@ -1,12 +0,0 @@ -// @NOTE postgres-only -export const tableName = 'view_param' - -// materialized views are difficult to change, -// so we parameterize them at runtime with contents of this table. -// its contents are set in migrations, available param names are static. -export interface ViewParam { - name: string - value: string -} - -export type PartialDB = { [tableName]: ViewParam }