feat(podcasts): add zero schema and queries

This commit is contained in:
CREDO23 2026-06-10 18:44:35 +02:00
parent 15e44616f3
commit e61308387c
4 changed files with 35 additions and 0 deletions

View file

@ -4,6 +4,7 @@ import { chatCommentTable, chatSessionStateTable, newChatMessageTable } from "./
import { documentTable, searchSourceConnectorTable } from "./documents";
import { folderTable } from "./folders";
import { notificationTable } from "./inbox";
import { podcastTable } from "./podcasts";
import { userTable } from "./user";
const chatCommentRelationships = relationships(chatCommentTable, ({ one }) => ({
@ -38,6 +39,7 @@ export const schema = createSchema({
chatSessionStateTable,
userTable,
automationRunTable,
podcastTable,
],
relationships: [chatCommentRelationships, newChatMessageRelationships],
});

View file

@ -0,0 +1,19 @@
import { json, number, string, table } from "@rocicorp/zero";
// Mirrors PODCAST_COLS in the backend zero_publication. status drives the
// lifecycle UI by push; spec is the reviewable brief. The bulky source_content
// and transcript are intentionally not published and are fetched over REST.
export const podcastTable = table("podcasts")
.columns({
id: number(),
title: string(),
status: string(),
spec: json().optional(),
specVersion: number().from("spec_version"),
durationSeconds: number().optional().from("duration_seconds"),
error: string().optional(),
searchSpaceId: number().from("search_space_id"),
threadId: number().optional().from("thread_id"),
createdAt: number().from("created_at"),
})
.primaryKey("id");