From df6f9337a7e1d8c9f673924a9b1cb10d0f9ff818 Mon Sep 17 00:00:00 2001 From: agorischek <6295280+agorischek@users.noreply.github.com> Date: Fri, 4 Dec 2026 22:35:15 +0000 Subject: [PATCH 1/4] Database: fold mass removals and additions Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --- packages/renderers/database/src/geometry.ts | 5 +- .../renderers/database/src/links-view.tsx | 5 +- .../renderers/database/src/mass-folds.tsx | 43 ++++++ .../renderers/database/src/schema-links.ts | 23 +++- .../renderers/database/src/schema-model.ts | 17 +-- packages/renderers/database/src/styles.css | 25 ++++ packages/renderers/database/src/table.tsx | 103 ++++++++++++-- packages/renderers/database/src/tags.tsx | 3 + packages/renderers/database/src/view.tsx | 21 ++- packages/renderers/kit/src/react.ts | 1 + .../kit/src/react/graph-canvas/mass-folds.ts | 101 +++----------- .../renderers/kit/src/react/mass-folds.ts | 126 ++++++++++++++++++ 12 files changed, 361 insertions(+), 112 deletions(-) create mode 100644 packages/renderers/database/src/mass-folds.tsx create mode 100644 packages/renderers/kit/src/react/mass-folds.ts diff --git a/packages/renderers/database/src/geometry.ts b/packages/renderers/database/src/geometry.ts index ec7e6ccae..21b79a786 100644 --- a/packages/renderers/database/src/geometry.ts +++ b/packages/renderers/database/src/geometry.ts @@ -1,4 +1,4 @@ -import {compareIds} from '@githubnext/projections-renderer-kit' +import {compareIds, isMassFold} from '@githubnext/projections-renderer-kit' import {textMetrics, type TextSizer} from './text.js' import {type SchemaBox, type SchemaModel, schemaMetrics} from './schema.js' @@ -36,7 +36,8 @@ export function rowGeometry(model: SchemaModel, cardWidth: number, sizer: TextSi } export const cardHeight = (model: SchemaModel, table: string, geometry: Geometry) => { const rows = model.columns.get(table)! - const body = rows.length ? rows.reduce((sum, id) => sum + geometry.heights.get(id)!, 0) : schemaMetrics.row + // A fold of cards removed (or added) together is its header alone; any other card without rows keeps one for its note. + const body = rows.length ? rows.reduce((sum, id) => sum + geometry.heights.get(id)!, 0) : isMassFold(table) ? 0 : schemaMetrics.row return geometry.headers.get(table)! + body + geometry.edge } export const anchor = (geometry: Geometry, box: SchemaBox, table: string, column?: string) => diff --git a/packages/renderers/database/src/links-view.tsx b/packages/renderers/database/src/links-view.tsx index e8a56f43f..2807c16e9 100644 --- a/packages/renderers/database/src/links-view.tsx +++ b/packages/renderers/database/src/links-view.tsx @@ -1,4 +1,4 @@ -import {changeMark, describeChange, arrowHeadStyle, edgePaint, isChanged} from '@githubnext/projections-renderer-kit' +import {changeMark, describeChange, arrowHeadStyle, edgePaint, isChanged, isMassFold} from '@githubnext/projections-renderer-kit' import {useSelectControl, type RendererProps} from '@githubnext/projections-renderer-kit/react' import type {FrameLink} from './frame.js' import {linkHead, linkPath} from './link-geometry.js' @@ -58,7 +58,8 @@ export function Link({ readonly string[] | undefined>(() => undefined) + +/** Whether a fold is open: its items drawn on their own, and it the way to fold them again. */ +export const isOpenFold = (entity: Entity) => entity.data?.open === true + +/** + * A fold's attributes: whether it is open, that activating it is an action rather than a selection, and while closed + * the items it presents (`data-entity-aliases`), so the host's selection, hover and filter of one find it. None for + * anything else. + */ +export function useFoldAttributes(entity: Entity | undefined): Record { + const aliases = use(FoldAliases) + if (!entity || !isMassFold(entity.id)) return {} + const presents = aliases(entity.id) + return { + 'data-fold': isOpenFold(entity) ? 'open' : 'closed', + 'data-projections-action': '', + ...(presents !== undefined && presents.length > 0 ? {[entityAliasesAttribute]: JSON.stringify(presents)} : {}), + } +} + +/** A fold's chevrons: pointing apart while it is closed, together once it is open. */ +export function FoldIcon({open}: {open: boolean}) { + return ( + + ) +} diff --git a/packages/renderers/database/src/schema-links.ts b/packages/renderers/database/src/schema-links.ts index 706dd412a..14b8f38c6 100644 --- a/packages/renderers/database/src/schema-links.ts +++ b/packages/renderers/database/src/schema-links.ts @@ -1,4 +1,4 @@ -import {compareIds, isFold} from '@githubnext/projections-renderer-kit' +import {compareIds, isFold, isMassFold} from '@githubnext/projections-renderer-kit' import type {SchemaColumnRole, SchemaLink, SchemaMarker, SchemaState} from './schema.js' import {isEnum, names} from './vocabulary.js' import type {Cards} from './schema-model.js' @@ -44,7 +44,21 @@ export function linksOf(state: SchemaState, {nodes, tableSet, tableOf, columnNam } if (edge.kind !== 'foreign-key' && edge.kind !== 'relation') continue if (tableOf.has(edge.from) && tableOf.has(edge.to)) addLink(edge.id, tableOf.get(edge.from)!, tableOf.get(edge.to)!, edge.from, edge.to) - else if (tableSet.has(edge.from) && tableSet.has(edge.to)) { + else if ( + (isMassFold(edge.from) || isMassFold(edge.to)) && + tableSet.has(edge.from) !== tableSet.has(edge.to) && + (tableOf.has(edge.from) || tableOf.has(edge.to)) + ) { + // A column's foreign key to a card, or a card's to a column: a fold of tables removed (or added) together stands + // for its tables' columns, so their foreign keys run from (or to) its header. + addLink( + edge.id, + tableOf.get(edge.from) ?? edge.from, + tableOf.get(edge.to) ?? edge.to, + tableOf.has(edge.from) ? edge.from : undefined, + tableOf.has(edge.to) ? edge.to : undefined, + ) + } else if (tableSet.has(edge.from) && tableSet.has(edge.to)) { const local = names(edge.data?.columns) const remote = names(edge.data?.principalColumns) if (!local.length) addLink(edge.id, edge.from, edge.to) @@ -73,8 +87,9 @@ export function columnMarkers( const markers = new Map() const ordered = new Map() for (const table of tables) { - // Keys first, then the other columns, and last the fold of those the Changes scope leaves out. - const rank = (id: string) => (isFold(id) ? 3 : primary.has(id) ? 0 : foreign.has(id) ? 1 : 2) + // Keys first, then the other columns, and last the folds: of columns removed (or added) together, and of those the + // Changes scope leaves out. + const rank = (id: string) => (isFold(id) || isMassFold(id) ? 3 : primary.has(id) ? 0 : foreign.has(id) ? 1 : 2) const columns = columnsOf .get(table)! .toSorted((a, b) => rank(a) - rank(b) || compareIds(nodes.get(a)!.label, nodes.get(b)!.label) || compareIds(a, b)) diff --git a/packages/renderers/database/src/schema-model.ts b/packages/renderers/database/src/schema-model.ts index fbd755b6e..ef1ba9d2e 100644 --- a/packages/renderers/database/src/schema-model.ts +++ b/packages/renderers/database/src/schema-model.ts @@ -1,4 +1,4 @@ -import {compareIds, isFold} from '@githubnext/projections-renderer-kit' +import {compareIds, isFold, isMassFold} from '@githubnext/projections-renderer-kit' import type {CardText, RowText} from './text.js' import {columnType} from './types.js' import type {SchemaKeyRow, SchemaModel, SchemaRowKind, SchemaState} from './schema.js' @@ -133,13 +133,14 @@ function cardTexts( const key = keyRows.get(id) texts.rows.set( id, - key - ? {kind: 'key', text: key.text, name: key.name} - : values.has(id) - ? {kind: 'value', text: values.get(id)!} - : // A fold of the columns the Changes scope leaves out is one line of words, measured as a value is. - isFold(id) - ? {kind: 'value', text: nodes.get(id)!.label} + // A fold, of the columns the Changes scope leaves out or of rows removed (or added) together, is one line of + // words, measured as a value is. + isFold(id) || isMassFold(id) + ? {kind: 'value', text: nodes.get(id)!.label} + : key + ? {kind: 'key', text: key.text, name: key.name} + : values.has(id) + ? {kind: 'value', text: values.get(id)!} : {kind: 'column', name: nodes.get(id)!.label, type: columnType(nodes.get(id)!)}, ) } diff --git a/packages/renderers/database/src/styles.css b/packages/renderers/database/src/styles.css index a9826998d..0c8545a2d 100644 --- a/packages/renderers/database/src/styles.css +++ b/packages/renderers/database/src/styles.css @@ -191,6 +191,31 @@ width: var(--key-width); height: 16px; } +/* + * Rows or cards removed (or added) together, folded into one (the kit's `useMassFolds`): the row, or the card's header + * alone, is a button like the Changes scope's fold, drawn in the change's style rather than on the inset surface. The + * card's header is its only part, so it takes the card's bottom corners and draws no rule of its own. + */ +.database-table > .database-mass-fold-row { + align-items: stretch; + padding-block: 0; + padding-inline-start: 0; +} +.database-mass-fold-row .database-glyph { + align-self: center; +} +.database-table.database-mass-fold > header { + padding-inline-start: 0; + border-bottom: 0; + border-end-start-radius: var(--pk-group-inner-radius); + border-end-end-radius: var(--pk-group-inner-radius); +} +.database-mass-fold > header .database-fold-button { + align-self: stretch; + color: var(--text); + font-size: inherit; + line-height: 18px; +} .database-key { flex: 0 0 var(--key-width); font-family: var(--font-mono); diff --git a/packages/renderers/database/src/table.tsx b/packages/renderers/database/src/table.tsx index 3285b7c1c..bcca95e7d 100644 --- a/packages/renderers/database/src/table.tsx +++ b/packages/renderers/database/src/table.tsx @@ -1,7 +1,7 @@ import type {CSSProperties, MouseEvent, ReactNode} from 'react' import type {Entity} from '@githubnext/projections-schemas' import {identifier, type EntityChange} from '@githubnext/projections-renderer-sdk/presentation' -import {changeMark, classifyChange, describeChange, isChanged, isFold} from '@githubnext/projections-renderer-kit' +import {changeMark, classifyChange, describeChange, isChanged, isFold, isMassFold} from '@githubnext/projections-renderer-kit' import {ChangeStatus, ValueChange, type RendererProps, useSelectControl} from '@githubnext/projections-renderer-kit/react' import {Breakable} from './measure.js' import {textMetrics} from './text.js' @@ -10,6 +10,7 @@ import {baseType, columnType, declaredType} from './types.js' import type {FrameColumn, SchemaFrame} from './frame.js' import {ChangeLines, describeColumn, GlyphStatus, oneLine, type Wrap} from './row-parts.js' import {placeAttributes, rowPlaces, runAttributes, type RowPlace} from './row-edges.js' +import {FoldIcon, isOpenFold, useFoldAttributes} from './mass-folds.js' /** What every row of one card is drawn with. */ interface Card { @@ -206,22 +207,51 @@ function FoldRow({card, row}: {card: Card; row: FrameColumn}) { }} title={open ? label : `Show ${label[0]!.toLowerCase()}${label.slice(1)}`} > - + {label} ) } +/** + * Rows of a table that stays, removed (or added) together, folded into one row in their style (`useMassFolds`): + * "14 columns removed", a button that opens them in place; open, "Hide 14 removed columns" below them, which folds + * them again. Closed, it presents them to the host. + */ +function MassFoldRow({card, row}: {card: Card; row: FrameColumn}) { + const {props, rowBadges} = card + const {change: fold, entity: version, top, height, opacity} = row + const open = isOpenFold(version) + const emphasis = props.emphasis(fold) + const marked = mark(card, fold, undefined, emphasis) + return ( +
+ + +
+ ) +} + /** A column: its key marker, then its name and type whole, on one line when the card has room. */ function ColumnRow({card, row}: {card: Card; row: FrameColumn}) { const selectControl = useSelectControl() @@ -325,7 +355,54 @@ function CardHeader({card, entity, header, status}: {card: Card; entity: Entity; ) } +/** + * Cards removed (or added) together, folded into one card in their style (`useMassFolds`): its header alone, "48 + * tables removed", a button that opens them in place; open, "Hide 48 removed tables", which folds them again. Closed, it + * presents them, their rows and their links to the host. + */ +function MassFoldCard({table, props, diff}: {table: SchemaFrame['tables'][number]; props: RendererProps; diff: boolean}) { + const {change, entity, box, header, status, opacity} = table + const open = isOpenFold(entity) + const emphasis = props.emphasis(change) + return ( +
+
+ + +
+
+ ) +} + export function Table({table, props, diff, wrap}: {table: SchemaFrame['tables'][number]; props: RendererProps; diff: boolean; wrap: Wrap}) { + if (isMassFold(table.change.id)) return + return +} + +function SchemaCard({table, props, diff, wrap}: {table: SchemaFrame['tables'][number]; props: RendererProps; diff: boolean; wrap: Wrap}) { const {change, entity, box, header, status, opacity, columns} = table // Rows of a wholly added or removed table share its status rather than repeating it; the diff marks every row. const survives = change.before !== undefined && change.after !== undefined @@ -361,7 +438,9 @@ export function Table({table, props, diff, wrap}: {table: SchemaFrame['tables'][ {/* The name is data, shown whole: the card is sized for it, and where the frame is too narrow it wraps, with the kind and status under it. */} {columns.map(row => - isFold(row.change.id) ? ( + isMassFold(row.change.id) ? ( + + ) : isFold(row.change.id) ? ( ) : row.kind === 'value' ? ( diff --git a/packages/renderers/database/src/tags.tsx b/packages/renderers/database/src/tags.tsx index 0347869fa..b62e6653f 100644 --- a/packages/renderers/database/src/tags.tsx +++ b/packages/renderers/database/src/tags.tsx @@ -5,6 +5,7 @@ import {balancedWrap, changeMark, classifyChange, describeChange, easeWithin, is import {StatusTab, type RendererProps, useSelectControl} from '@githubnext/projections-renderer-kit/react' import type {DatabaseTransition} from './transition.js' import type {FrameTag, SchemaFrame} from './frame.js' +import {useFoldAttributes} from './mass-folds.js' export const tagLimit = 500 @@ -177,6 +178,7 @@ function TagPill({tag, slot, props, diff}: {tag: FrameTag; slot: TagSlot | undef // overflow after the slots move (to a narrower width), so the block would still scroll to where it was. const geometry: CSSProperties = slot ? {left: slot.x, top: slot.y, width: slot.width} : {visibility: 'hidden'} const status = emphasis > 0.01 && isChanged(tag.change) ? `, ${describeChange(tag.change)}` : '' + const foldAttributes = useFoldAttributes(tag.change.after ?? tag.change.before) return (
props.onSelect(id)} diff --git a/packages/renderers/database/src/view.tsx b/packages/renderers/database/src/view.tsx index ff670ec81..721c89d33 100644 --- a/packages/renderers/database/src/view.tsx +++ b/packages/renderers/database/src/view.tsx @@ -8,6 +8,7 @@ import { useFrameSizing, useOpeningFloor, useStageHeightCap, + useMassFolds, useStageZoom, type RendererProps, } from '@githubnext/projections-renderer-kit/react' @@ -24,6 +25,7 @@ import {Table} from './table.js' import type {SchemaFrame} from './frame.js' import {morphSchemaFrame} from './morph.js' import {useNaturalHeight, useViewSize} from './view-size.js' +import {FoldAliases} from './mass-folds.js' /** How long cards, rows and links move to a new layout of the schema. */ const moveMs = 320 @@ -70,7 +72,22 @@ function useFrameMorph(frame: SchemaFrame, layout: unknown, document: unknown, r return [shown, move !== undefined] } -export function DatabaseRenderer(props: RendererProps) { +/** + * A dozen or more tables (or other siblings) removed or added together fold into one card that counts them and opens in + * place (`useMassFolds`), so a comparison that drops a whole schema stays one frame a host can draw. + */ +export function DatabaseRenderer(given: RendererProps) { + // Folds stay open, and the schema glides as one opens, while the same document is shown. + const document = given.filtered === false ? undefined : (given.scope?.all ?? given.model) + const folding = useMassFolds(given, document ?? given.model) + return ( + + + + ) +} + +function Schema({props, document: shownDocument}: {props: RendererProps; document: unknown}) { const {model, schedule, progress} = props const view = useRef(null) const {available, stage} = useViewSize(view) @@ -103,7 +120,7 @@ export function DatabaseRenderer(props: RendererProps) { // Before the host's filter, every table is drawn provisionally, as a document of its own for each model: the first // scope the host chooses is drawn at once, and so is every new model while no filter comes (a host without one). const provisional = useMemo(() => ({provisional: model}), [model]) - const document = props.filtered === false ? provisional : (props.scope?.all ?? model) + const document = shownDocument ?? provisional const [frame, moving] = useFrameMorph(union ? union.frame : transition!(progress), model, document, props.reducedMotion) const tagSource = union ?? transition! const tableCount = (union ? union.layout : transition!.layouts.at(-1)!).tables.size diff --git a/packages/renderers/kit/src/react.ts b/packages/renderers/kit/src/react.ts index 8f315b91e..23d80872f 100644 --- a/packages/renderers/kit/src/react.ts +++ b/packages/renderers/kit/src/react.ts @@ -30,6 +30,7 @@ export * from './react/facts.js' export * from './react/matrix-grid.js' export * from './react/icons.js' export {Fold, useFolds} from './react/fold.js' +export {useMassFolds, type MassFolding} from './react/mass-folds.js' export {IdentifierText} from './react/identifiers.js' export * from './react/layout-components.js' export * from './react/type.js' diff --git a/packages/renderers/kit/src/react/graph-canvas/mass-folds.ts b/packages/renderers/kit/src/react/graph-canvas/mass-folds.ts index e20f5a2fe..95f55fd57 100644 --- a/packages/renderers/kit/src/react/graph-canvas/mass-folds.ts +++ b/packages/renderers/kit/src/react/graph-canvas/mass-folds.ts @@ -1,107 +1,44 @@ // The graph canvas's folds of mass changes: a dozen or more sibling cards removed (or added) together drawn as one card // that counts them and opens in place (`foldMassChanges`). -import {useCallback, useMemo, useState} from 'react' +import {useMemo} from 'react' import type {Entity} from '@githubnext/projections-schemas' -import type {RendererFocus} from '@githubnext/projections-renderer-sdk/protocol' -import {foldMassChanges, foldMassSteps, isMassFold} from '../../mass-fold.js' -import type {EmphasisOf} from '../../emphasis.js' -import {useKindNoun} from '../kind-nouns.js' +import {isMassFold} from '../../mass-fold.js' +import {useMassFolds as useFolding} from '../mass-folds.js' import type {GraphCanvasProps} from './props.js' -const none: ReadonlySet = new Set() - /** - * The canvas's props with mass changes folded: the model and schedule with each fold's card and links in place of - * what they stand for, a fold's card presenting its items (`aliases`, so the host's selection, hover and filter of one - * find the card), and the host's selection and focus of a folded item moved onto its card. Activating a fold's card, or - * a link drawn for it, opens or closes it; what the person opened stays open until the document changes. The props - * pass through unchanged when nothing folds. + * The canvas's props with mass changes folded (`useMassFolds`): besides the model, schedule, emphasis, selection and + * focus request, the host's focus and visible items move onto a fold's card, the card presents its items (`aliases`) + * and is activated as a synthetic card, and a fold's links stand for no item of the host's. The props pass through + * unchanged when nothing folds. */ export function useMassFolds(props: GraphCanvasProps): GraphCanvasProps { - const noun = useKindNoun() - const {model, comparing, locale} = props // Folds stay open while the same document is shown, the Changes scope's views of it included. - const document = props.scope?.all ?? props.source ?? model - const [opened, setOpened] = useState<{document: unknown; ids: ReadonlySet}>({document, ids: none}) - const open = opened.document === document ? opened.ids : none - const folding = useMemo( - () => (comparing ? foldMassChanges(model, {open, noun, locale}) : undefined), - [comparing, model, open, noun, locale], - ) - const toggle = useCallback( - (id: string) => - setOpened(previous => { - const ids = new Set(previous.document === document ? previous.ids : none) - if (ids.has(id)) ids.delete(id) - else ids.add(id) - return {document, ids} - }), - [document], - ) - const folds = folding !== undefined && folding.folds.size > 0 ? folding : undefined - // What the canvas lays out and frames keeps its identity while the folds and the renderer's props do. - const onCard = useCallback((id: string) => folds?.folded.get(id) ?? id, [folds]) - const schedule = useMemo(() => (folds ? foldMassSteps(props.schedule, folds) : props.schedule), [folds, props.schedule]) - const request = props.focusRequest - const focusRequest = useMemo( - () => (request?.id === undefined ? request : {...request, id: onCard(request.id)}), - [request, onCard], - ) - const focus = useMemo(() => props.focus && {...props.focus, ids: new Set([...props.focus.ids].map(onCard))}, [props.focus, onCard]) - const visibleIds = useMemo(() => props.visibleIds && new Set([...props.visibleIds].map(onCard)), [props.visibleIds, onCard]) - // The fold a card or link opens: a link drawn for folded relationships opens the fold at its end. - const foldOf = useMemo(() => { - const found = new Map() - if (!folds) return found - for (const row of folds.model.relationships) { - if (!isMassFold(row.id)) continue - const item = row.before ?? row.after - if (!item) continue - const fold = [item.from, item.to].find(end => folds.folds.has(end)) - if (fold !== undefined) found.set(row.id, fold) - } - for (const id of folds.folds.keys()) found.set(id, id) - return found - }, [folds]) - const rows = useMemo( - () => new Map[0]>([...model.entities, ...model.relationships].map(row => [row.id, row])), - [model], - ) - if (!folds) return props - const {onSelect, synthetic, syntheticAction, aliases, prose} = props - const emphasis: EmphasisOf = (change, id = change.id) => { - const standing = id === undefined ? undefined : folds.stands.get(id) - if (!standing) return props.emphasis(change, id) - return Math.max(0, ...standing.map(row => props.emphasis(rows.get(row) ?? change, row))) - } + const document = props.scope?.all ?? props.source ?? props.model + const folding = useFolding(props, document) + const {drawnFor, folds} = folding + const focus = useMemo(() => props.focus && {...props.focus, ids: new Set([...props.focus.ids].map(drawnFor))}, [props.focus, drawnFor]) + const visibleIds = useMemo(() => props.visibleIds && new Set([...props.visibleIds].map(drawnFor)), [props.visibleIds, drawnFor]) + if (!folds.size) return props + const {synthetic, syntheticAction, aliases, prose} = props return { - ...props, - model: folds.model, - schedule, - emphasis, + ...folding.props, source: document, - selectedId: props.selectedId === null ? null : onCard(props.selectedId), - focusRequest, ...(props.focus === undefined ? {} : {focus}), ...(visibleIds ? {visibleIds} : {}), - onSelect: (id: string | null) => { - const fold = id === null ? undefined : foldOf.get(id) - if (fold === undefined) onSelect(id) - else toggle(fold) - }, // A fold's links stand for relationships the card presents: drawn, and opening the fold, but no item of the host's. - synthetic: (id: string) => (isMassFold(id) && !folds.folds.has(id)) || (synthetic?.(id) ?? false), + synthetic: (id: string) => (isMassFold(id) && !folds.has(id)) || (synthetic?.(id) ?? false), syntheticAction: (entity: Entity) => { - const fold = folds.folds.get(entity.id) + const fold = folds.get(entity.id) if (!fold) return syntheticAction?.(entity) return {label: fold.open ? fold.label : `Show ${fold.label}`, expanded: fold.open} }, aliases: (id: string) => { - const fold = folds.folds.get(id) + const fold = folds.get(id) if (!fold) return aliases?.(id) if (fold.open) return undefined return [...fold.presents, ...fold.presents.flatMap(member => aliases?.(member) ?? [])] }, - prose: (entity: Entity) => folds.folds.has(entity.id) || (prose?.(entity) ?? false), + prose: (entity: Entity) => folds.has(entity.id) || (prose?.(entity) ?? false), } } diff --git a/packages/renderers/kit/src/react/mass-folds.ts b/packages/renderers/kit/src/react/mass-folds.ts new file mode 100644 index 000000000..7d19fb83c --- /dev/null +++ b/packages/renderers/kit/src/react/mass-folds.ts @@ -0,0 +1,126 @@ +// Folds of mass changes for a renderer that lays out its own model: a dozen or more sibling items removed (or added) +// together drawn as one card that counts them and opens in place (`foldMassChanges`). +import {useCallback, useMemo, useState} from 'react' +import type {RendererFocus} from '@githubnext/projections-renderer-sdk/protocol' +import {foldMassChanges, foldMassSteps, isMassFold, type MassFold, type MassFolded} from '../mass-fold.js' +import type {EmphasisOf} from '../emphasis.js' +import {useKindNoun} from './kind-nouns.js' +import type {RendererProps} from './shell/props.js' + +const none: ReadonlySet = new Set() +const noFolds: ReadonlyMap = new Map() + +/** A renderer's props with its mass changes folded (`useMassFolds`), and the folds. */ +export interface MassFolding

{ + /** + * The props to draw: `model` and `schedule` with each fold's card and links in place of what they stand for, a + * card's or link's emphasis the most of what it stands for, the host's selection and focus of a folded item moved + * onto its card, and `onSelect` of a fold's card, or of a link drawn for it, opening or closing the fold. The props + * passed, when nothing folds. + */ + props: P + /** Each fold, by its card's ID; empty when nothing folds. */ + folds: ReadonlyMap + /** The card or link drawn for an item: the fold's, while it hides the item, else the item itself. */ + drawnFor: (id: string) => string + /** The fold a card, or a link drawn for one, opens or closes. */ + foldOf: (id: string) => string | undefined + /** Opens a fold, or closes an open one. */ + toggle: (id: string) => void + /** + * The items a closed fold's card presents (for its `data-entity-aliases`, the SDK's `entityAliasesAttribute`), so the + * host's selection, hover and filter of one find the card; undefined for an open fold or any other item. + */ + aliases: (id: string) => readonly string[] | undefined +} + +/** + * Folds a renderer's mass changes (`foldMassChanges`) as the graph canvas and card grid do, for a renderer that lays out + * its own model: draw `props` and give each fold's card (an entity row whose ID `isMassFold`) its label, its status's + * style, `data-entity-aliases` from `aliases` and `data-fold`, and activate it with `onSelect` (or `toggle`). The cards + * are labeled with the definition's plural noun for their kind, as the summary bar counts it. What the person opened + * stays open while the same `document` is shown (by default the Changes scope's `all`, else `model`), the Changes + * scope's views of it included. A single revision folds nothing. + */ +export function useMassFolds< + P extends Pick< + RendererProps, + 'model' | 'schedule' | 'emphasis' | 'selectedId' | 'focusRequest' | 'onSelect' | 'comparing' | 'locale' | 'scope' + >, +>(props: P, document: unknown = props.scope?.all ?? props.model): MassFolding

{ + const noun = useKindNoun() + const {model, comparing, locale} = props + const [opened, setOpened] = useState<{document: unknown; ids: ReadonlySet}>({document, ids: none}) + const open = opened.document === document ? opened.ids : none + const folding = useMemo( + () => (comparing ? foldMassChanges(model, {open, noun, locale}) : undefined), + [comparing, model, open, noun, locale], + ) + const toggle = useCallback( + (id: string) => + setOpened(previous => { + const ids = new Set(previous.document === document ? previous.ids : none) + if (ids.has(id)) ids.delete(id) + else ids.add(id) + return {document, ids} + }), + [document], + ) + const folds: MassFolded | undefined = folding !== undefined && folding.folds.size > 0 ? folding : undefined + const drawnFor = useCallback((id: string) => folds?.folded.get(id) ?? id, [folds]) + const schedule = useMemo(() => (folds ? foldMassSteps(props.schedule, folds) : props.schedule), [folds, props.schedule]) + const request = props.focusRequest + const focusRequest = useMemo( + () => (request?.id === undefined ? request : {...request, id: drawnFor(request.id)}), + [request, drawnFor], + ) + // The fold a card or link opens: a link drawn for folded relationships opens the fold at its end. + const opens = useMemo(() => { + const found = new Map() + if (!folds) return found + for (const row of folds.model.relationships) { + if (!isMassFold(row.id)) continue + const item = row.before ?? row.after + if (!item) continue + const fold = [item.from, item.to].find(end => folds.folds.has(end)) + if (fold !== undefined) found.set(row.id, fold) + } + for (const id of folds.folds.keys()) found.set(id, id) + return found + }, [folds]) + const foldOf = useCallback((id: string) => opens.get(id), [opens]) + const rows = useMemo( + () => new Map[0]>([...model.entities, ...model.relationships].map(row => [row.id, row])), + [model], + ) + const aliases = useCallback( + (id: string) => { + const fold = folds?.folds.get(id) + return fold && !fold.open ? fold.presents : undefined + }, + [folds], + ) + const folded = useMemo((): P => { + if (!folds) return props + const {onSelect} = props + const emphasis: EmphasisOf = (change, id = change.id) => { + const standing = id === undefined ? undefined : folds.stands.get(id) + if (!standing) return props.emphasis(change, id) + return Math.max(0, ...standing.map(row => props.emphasis(rows.get(row) ?? change, row))) + } + return { + ...props, + model: folds.model, + schedule, + emphasis, + selectedId: props.selectedId === null ? null : drawnFor(props.selectedId), + focusRequest, + onSelect: (id: string | null) => { + const fold = id === null ? undefined : opens.get(id) + if (fold === undefined) onSelect(id) + else toggle(fold) + }, + } + }, [folds, props, schedule, rows, drawnFor, focusRequest, opens, toggle]) + return {props: folded, folds: folds?.folds ?? noFolds, drawnFor, foldOf, toggle, aliases} +} From 705cb0d03d110da39f5f2d3359efe22bfc9c4f6c Mon Sep 17 00:00:00 2001 From: agorischek <6295280+agorischek@users.noreply.github.com> Date: Fri, 4 Dec 2026 23:18:30 +0000 Subject: [PATCH 2/4] Database: test and document mass folds with a retired partner program Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --- docs/guides/renderer-kit-graphs.md | 9 + packages/renderers/database/README.md | 23 +- .../renderers/database/browser/diff.spec.ts | 2 +- .../database/browser/mass-fold.spec.ts | 45 + .../database/fixtures/make-schemas.mjs | 5 +- .../fixtures/prisma-partners-after.json | 706 ++ .../fixtures/prisma-partners-before.json | 6661 +++++++++++++++++ .../after/prisma/schema.prisma | 25 + .../before/prisma/schema.prisma | 182 + packages/renderers/database/scenarios.json | 7 + .../renderers/database/src/schema-links.ts | 2 + .../database/test/mass-fold.test.mjs | 123 + 12 files changed, 7783 insertions(+), 7 deletions(-) create mode 100644 packages/renderers/database/browser/mass-fold.spec.ts create mode 100644 packages/renderers/database/fixtures/prisma-partners-after.json create mode 100644 packages/renderers/database/fixtures/prisma-partners-before.json create mode 100644 packages/renderers/database/fixtures/prisma-partners/after/prisma/schema.prisma create mode 100644 packages/renderers/database/fixtures/prisma-partners/before/prisma/schema.prisma create mode 100644 packages/renderers/database/test/mass-fold.test.mjs diff --git a/docs/guides/renderer-kit-graphs.md b/docs/guides/renderer-kit-graphs.md index 115971ab1..2d694c83f 100644 --- a/docs/guides/renderer-kit-graphs.md +++ b/docs/guides/renderer-kit-graphs.md @@ -118,6 +118,15 @@ status and kind from its `change` row, and a card a fold takes keeps its place, hidden. A single revision folds nothing. `Fold` takes an `id` and the IDs it `presents` for a fold the host can find its items on. +A renderer that lays out its own model, as the database renderer does, folds the +same way with `useMassFolds(props)`: it returns the props to draw (`model` and +`schedule` folded, emphasis, selection and focus request moved onto the cards, +and `onSelect` of a fold's card or link opening it) and, for each card (an +entity row whose ID `isMassFold`), the items it presents (`aliases`). Draw the +card in its status's style with its `label`, `data-fold`, +`data-projections-action` and `data-entity-aliases`, and draw a fold's links +without a `data-entity-id`, since they stand for no item of the host's. + **Sibling blocks.** When six or more cards (`blockMinimum`) share every relationship, they wrap into a block instead of stretching their layer into one long row. Sharing every relationship means having the same sources and targets, diff --git a/packages/renderers/database/README.md b/packages/renderers/database/README.md index 9bf38787a..5ad1e0d08 100644 --- a/packages/renderers/database/README.md +++ b/packages/renderers/database/README.md @@ -97,6 +97,19 @@ dashed while emphasized. Status text, link colors and tag tints use only the host's change highlighting, so nothing looks changed at either endpoint or for a single extraction. +A dozen or more tables, views or enums removed together (or added together) fold +into one card in the removed (or added) style, its header alone, counting them +with the definition's noun: `48 tables removed`. Their columns, keys and links +fold with them; a foreign key from one of them to a table that stays, or a +column typed by an enum that stays, is drawn once from the card's header. A +dozen or more columns or keys removed together from a table that stays fold the +same way into one row of it, `14 columns removed`. Activating a fold, or a link +drawn from it, opens its items in place; it stays, labeled +`Hide 48 removed tables`, as the way to fold them again. A fold presents its +items to the host (`data-entity-aliases`), so selecting, hovering, filtering or +focusing (`--entity`) one finds it. A comparison that drops a whole schema stays +a frame the host can draw. + ## Diff mode The renderer declares all four comparison modes; `diff` draws one static schema @@ -140,9 +153,11 @@ with highlighting off the diff draws plainly in the same boxes. ## Fixtures -`fixtures/prisma-shop-{before,after}.json` and -`fixtures/django-library-{before,after}.json` are real extractions by -`prisma-schema` and `django-schema` of the small projects in -`fixtures/prisma-shop/` and `fixtures/django-library/`, regenerated with +`fixtures/prisma-shop-{before,after}.json`, +`fixtures/prisma-partners-{before,after}.json` (a partner program of 14 tables +retired at once) and `fixtures/django-library-{before,after}.json` are real +extractions by `prisma-schema` and `django-schema` of the small projects in +`fixtures/prisma-shop/`, `fixtures/prisma-partners/` and +`fixtures/django-library/`, regenerated with `node packages/renderers/database/fixtures/make-schemas.mjs --python `. `fixtures/invoicing-*.json` are EF Core–shaped synthetic extractions. diff --git a/packages/renderers/database/browser/diff.spec.ts b/packages/renderers/database/browser/diff.spec.ts index c415732d7..17d81d5cb 100644 --- a/packages/renderers/database/browser/diff.spec.ts +++ b/packages/renderers/database/browser/diff.spec.ts @@ -10,7 +10,7 @@ import type {Extraction} from '@githubnext/projections-schemas' * draws the same boxes. Set `PROJECTIONS_DIFF_SCREENSHOTS` to a directory to * save every comparison's diff in light and dark at the project's width. */ -const comparisons = ['prisma-shop', 'django-library', 'organizations', 'cleanup'] +const comparisons = ['prisma-shop', 'django-library', 'organizations', 'cleanup', 'prisma-partners'] const shots = process.env.PROJECTIONS_DIFF_SCREENSHOTS for (const name of comparisons) { diff --git a/packages/renderers/database/browser/mass-fold.spec.ts b/packages/renderers/database/browser/mass-fold.spec.ts new file mode 100644 index 000000000..a0fbb621b --- /dev/null +++ b/packages/renderers/database/browser/mass-fold.spec.ts @@ -0,0 +1,45 @@ +import {expect, test} from '@playwright/test' +import {openStage} from '@githubnext/projections-renderer-testing/playwright' +import {harnessInspector} from '@githubnext/projections-renderer-harness/playwright' + +const fold = 'pk-mass:removed:table:' + +test('14 tables removed together fold into one card that presents them to the host and opens in place', async ({page}) => { + for (const comparisonMode of ['animated', 'diff'] as const) { + const renderer = await openStage(page, harnessInspector(), {scenario: 'database/prisma-partners', comparisonMode, progress: 0}) + const card = renderer.frame.locator(`.database-table[data-entity-id="${fold}"]`) + const button = card.locator('.database-fold-button') + const program = renderer.frame.locator('.database-table[data-entity-id="table:/Program"]') + await expect(card).toHaveCount(1) + await expect(button).toHaveAttribute('title', 'Show 14 tables removed') + await expect(button).toHaveAttribute('aria-expanded', 'false') + await expect(card).toHaveAttribute('data-fold', 'closed') + await expect(program).toHaveCount(0) + const aliases: unknown = JSON.parse((await card.getAttribute('data-entity-aliases')) ?? '[]') + expect(aliases).toEqual(expect.arrayContaining(['table:/Program', 'table:/FraudAlert', 'column:table%3A%2FCommission/amount'])) + // The host's selection and hover of a folded table find the card. + await renderer.select('table:/Program') + await expect(card).toHaveClass(/\bselected\b/u) + await expect(card).toHaveAttribute('data-projections-ring-selected', /.*/u) + await renderer.select(null) + await renderer.hover('table:/Program') + await expect(card).toHaveAttribute('data-projections-ring-hover', /.*/u) + await renderer.hover(null) + // Activating it opens the tables in place and selects nothing; again folds them. + await button.click() + await expect(program).toHaveCount(1) + await expect(renderer.frame.locator('.database-table[data-entity-id^="table:/"]')).toHaveCount(16) + await expect(button).toHaveAttribute('aria-expanded', 'true') + await expect(button).toHaveAttribute('title', 'Hide 14 removed tables') + expect((await renderer.state()).selections).toEqual([]) + await button.click() + await expect(program).toHaveCount(0) + } + // `--entity` on a folded table opens on its card. + const focused = await openStage(page, harnessInspector(), { + scenario: 'database/prisma-partners', + progress: 0, + focus: {id: 'table:/Program'}, + }) + await expect(focused.frame.locator(`.database-table[data-entity-id="${fold}"]`)).toBeInViewport() +}) diff --git a/packages/renderers/database/fixtures/make-schemas.mjs b/packages/renderers/database/fixtures/make-schemas.mjs index d87d917ff..7eab7233f 100644 --- a/packages/renderers/database/fixtures/make-schemas.mjs +++ b/packages/renderers/database/fixtures/make-schemas.mjs @@ -1,6 +1,6 @@ // Regenerates the Prisma and Django database fixtures from the small projects beside this script: -// `prisma-shop/{before,after}` and `prisma-licensing/{before,after}` (Prisma schemas, the second with tables that -// reference each other) and `django-library/{before,after}` (a Django +// `prisma-shop/{before,after}`, `prisma-licensing/{before,after}` and `prisma-partners/{before,after}` (Prisma +// schemas, the second with tables that reference each other, the third retiring 14 tables at once) and `django-library/{before,after}` (a Django // project) are each committed to a scratch Git repository, and the prisma-schema and // django-schema extractors read both revisions with the Projections CLI into // `-{before,after}.json`. @@ -30,6 +30,7 @@ const python = values.python ?? process.env.PROJECTIONS_DJANGO_PYTHON ?? 'python const projects = [ {name: 'prisma-shop', definition: {id: 'database', title: 'Database', extractor: 'prisma-schema', renderer: 'database'}, trust: false}, {name: 'prisma-licensing', definition: {id: 'database', title: 'Database', extractor: 'prisma-schema', renderer: 'database'}, trust: false}, + {name: 'prisma-partners', definition: {id: 'database', title: 'Database', extractor: 'prisma-schema', renderer: 'database'}, trust: false}, { name: 'django-library', definition: { diff --git a/packages/renderers/database/fixtures/prisma-partners-after.json b/packages/renderers/database/fixtures/prisma-partners-after.json new file mode 100644 index 000000000..8ff0fbf02 --- /dev/null +++ b/packages/renderers/database/fixtures/prisma-partners-after.json @@ -0,0 +1,706 @@ +{ + "entities": [ + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/User", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 22 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FUser/email", + "kind": "column", + "label": "email" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": { + "args": [ + 1 + ], + "name": "cuid" + }, + "hasDefault": true, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/User", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 21 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FUser/id", + "kind": "column", + "label": "id" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/User", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 23 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FUser/workspaceId", + "kind": "column", + "label": "workspaceId" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": { + "args": [], + "name": "now" + }, + "hasDefault": true, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Workspace", + "type": "DateTime", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 16 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FWorkspace/createdAt", + "kind": "column", + "label": "createdAt" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": { + "args": [ + 1 + ], + "name": "cuid" + }, + "hasDefault": true, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Workspace", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 13 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FWorkspace/id", + "kind": "column", + "label": "id" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Workspace", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 14 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FWorkspace/name", + "kind": "column", + "label": "name" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Workspace", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 15 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FWorkspace/slug", + "kind": "column", + "label": "slug" + }, + { + "confidence": "authoritative", + "data": { + "columns": [ + "workspaceId" + ], + "onDelete": null, + "onUpdate": null, + "references": [ + "id" + ], + "table": "table:/User", + "target": "table:/Workspace", + "type": "foreign-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 24 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FUser/foreign-key/%5B%22workspaceId%22%5D/table%3A%2FWorkspace", + "kind": "constraint", + "label": "foreign-key (workspaceId)" + }, + { + "confidence": "authoritative", + "data": { + "databaseName": null, + "fields": [ + { + "name": "id" + } + ], + "table": "table:/User", + "type": "primary-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 21 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FUser/primary-key/%5B%22id%22%5D", + "kind": "constraint", + "label": "primary-key (id)" + }, + { + "confidence": "authoritative", + "data": { + "databaseName": null, + "fields": [ + { + "name": "email" + } + ], + "table": "table:/User", + "type": "unique" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 22 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FUser/unique/%5B%22email%22%5D", + "kind": "constraint", + "label": "unique (email)" + }, + { + "confidence": "authoritative", + "data": { + "databaseName": null, + "fields": [ + { + "name": "id" + } + ], + "table": "table:/Workspace", + "type": "primary-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 13 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FWorkspace/primary-key/%5B%22id%22%5D", + "kind": "constraint", + "label": "primary-key (id)" + }, + { + "confidence": "authoritative", + "data": { + "databaseName": null, + "fields": [ + { + "name": "slug" + } + ], + "table": "table:/Workspace", + "type": "unique" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 15 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FWorkspace/unique/%5B%22slug%22%5D", + "kind": "constraint", + "label": "unique (slug)" + }, + { + "confidence": "authoritative", + "data": { + "namespace": null, + "provider": "postgresql" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 20 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "table:/User", + "kind": "table", + "label": "User" + }, + { + "confidence": "authoritative", + "data": { + "namespace": null, + "provider": "postgresql" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 12 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "table:/Workspace", + "kind": "table", + "label": "Workspace" + } + ], + "metadata": { + "authority": "Prisma schema language, parsed by Projections", + "framework": "prisma", + "limitations": [ + "Desired Prisma model, not a live database or migration history; no database connection, generation or Prisma installation is involved.", + "Ignored (@ignore, @@ignore) and Unsupported fields are not columns; composite types are not relational columns.", + "Implicit many-to-many relations are relationships, not invented physical join tables.", + "Unnamed constraint identities use ordered database columns, not connector-generated SQL names; relationMode, mapped foreign-key names and implicit referential-action defaults are not inferred.", + "Connector-specific capability checks (supported native types, index types and arguments per database) are left to Prisma." + ], + "sources": [ + "prisma/schema.prisma" + ] + }, + "protocolVersion": 0, + "relationships": [ + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 24 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FUser/foreign-key/%5B%22workspaceId%22%5D/table%3A%2FWorkspace", + "id": "constrains:constraint%3Atable%253A%252FUser%2Fforeign-key%2F%255B%2522workspaceId%2522%255D%2Ftable%253A%252FWorkspace/column%3Atable%253A%252FUser%2FworkspaceId/", + "kind": "constrains", + "to": "column:table%3A%2FUser/workspaceId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 21 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FUser/primary-key/%5B%22id%22%5D", + "id": "constrains:constraint%3Atable%253A%252FUser%2Fprimary-key%2F%255B%2522id%2522%255D/column%3Atable%253A%252FUser%2Fid/", + "kind": "constrains", + "to": "column:table%3A%2FUser/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 22 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FUser/unique/%5B%22email%22%5D", + "id": "constrains:constraint%3Atable%253A%252FUser%2Funique%2F%255B%2522email%2522%255D/column%3Atable%253A%252FUser%2Femail/", + "kind": "constrains", + "to": "column:table%3A%2FUser/email" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 13 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FWorkspace/primary-key/%5B%22id%22%5D", + "id": "constrains:constraint%3Atable%253A%252FWorkspace%2Fprimary-key%2F%255B%2522id%2522%255D/column%3Atable%253A%252FWorkspace%2Fid/", + "kind": "constrains", + "to": "column:table%3A%2FWorkspace/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 15 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FWorkspace/unique/%5B%22slug%22%5D", + "id": "constrains:constraint%3Atable%253A%252FWorkspace%2Funique%2F%255B%2522slug%2522%255D/column%3Atable%253A%252FWorkspace%2Fslug/", + "kind": "constrains", + "to": "column:table%3A%2FWorkspace/slug" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 22 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/User", + "id": "contains:table%3A%2FUser/column%3Atable%253A%252FUser%2Femail/", + "kind": "contains", + "to": "column:table%3A%2FUser/email" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 21 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/User", + "id": "contains:table%3A%2FUser/column%3Atable%253A%252FUser%2Fid/", + "kind": "contains", + "to": "column:table%3A%2FUser/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 23 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/User", + "id": "contains:table%3A%2FUser/column%3Atable%253A%252FUser%2FworkspaceId/", + "kind": "contains", + "to": "column:table%3A%2FUser/workspaceId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 24 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/User", + "id": "contains:table%3A%2FUser/constraint%3Atable%253A%252FUser%2Fforeign-key%2F%255B%2522workspaceId%2522%255D%2Ftable%253A%252FWorkspace/", + "kind": "contains", + "to": "constraint:table%3A%2FUser/foreign-key/%5B%22workspaceId%22%5D/table%3A%2FWorkspace" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 21 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/User", + "id": "contains:table%3A%2FUser/constraint%3Atable%253A%252FUser%2Fprimary-key%2F%255B%2522id%2522%255D/", + "kind": "contains", + "to": "constraint:table%3A%2FUser/primary-key/%5B%22id%22%5D" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 22 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/User", + "id": "contains:table%3A%2FUser/constraint%3Atable%253A%252FUser%2Funique%2F%255B%2522email%2522%255D/", + "kind": "contains", + "to": "constraint:table%3A%2FUser/unique/%5B%22email%22%5D" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 16 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Workspace", + "id": "contains:table%3A%2FWorkspace/column%3Atable%253A%252FWorkspace%2FcreatedAt/", + "kind": "contains", + "to": "column:table%3A%2FWorkspace/createdAt" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 13 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Workspace", + "id": "contains:table%3A%2FWorkspace/column%3Atable%253A%252FWorkspace%2Fid/", + "kind": "contains", + "to": "column:table%3A%2FWorkspace/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 14 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Workspace", + "id": "contains:table%3A%2FWorkspace/column%3Atable%253A%252FWorkspace%2Fname/", + "kind": "contains", + "to": "column:table%3A%2FWorkspace/name" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 15 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Workspace", + "id": "contains:table%3A%2FWorkspace/column%3Atable%253A%252FWorkspace%2Fslug/", + "kind": "contains", + "to": "column:table%3A%2FWorkspace/slug" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 13 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Workspace", + "id": "contains:table%3A%2FWorkspace/constraint%3Atable%253A%252FWorkspace%2Fprimary-key%2F%255B%2522id%2522%255D/", + "kind": "contains", + "to": "constraint:table%3A%2FWorkspace/primary-key/%5B%22id%22%5D" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 15 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Workspace", + "id": "contains:table%3A%2FWorkspace/constraint%3Atable%253A%252FWorkspace%2Funique%2F%255B%2522slug%2522%255D/", + "kind": "contains", + "to": "constraint:table%3A%2FWorkspace/unique/%5B%22slug%22%5D" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 24 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "column:table%3A%2FUser/workspaceId", + "id": "foreign-key:column%3Atable%253A%252FUser%2FworkspaceId/column%3Atable%253A%252FWorkspace%2Fid/constraint%3Atable%253A%252FUser%2Fforeign-key%2F%255B%2522workspaceId%2522%255D%2Ftable%253A%252FWorkspace", + "kind": "foreign-key", + "to": "column:table%3A%2FWorkspace/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 24 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FUser/foreign-key/%5B%22workspaceId%22%5D/table%3A%2FWorkspace", + "id": "references:constraint%3Atable%253A%252FUser%2Fforeign-key%2F%255B%2522workspaceId%2522%255D%2Ftable%253A%252FWorkspace/table%3A%2FWorkspace/", + "kind": "references", + "to": "table:/Workspace" + } + ], + "schema": "database/v0" +} diff --git a/packages/renderers/database/fixtures/prisma-partners-before.json b/packages/renderers/database/fixtures/prisma-partners-before.json new file mode 100644 index 000000000..992402a5c --- /dev/null +++ b/packages/renderers/database/fixtures/prisma-partners-before.json @@ -0,0 +1,6661 @@ +{ + "entities": [ + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": { + "args": [ + 1 + ], + "name": "cuid" + }, + "hasDefault": true, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Bounty", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 111 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FBounty/id", + "kind": "column", + "label": "id" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Bounty", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 113 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FBounty/name", + "kind": "column", + "label": "name" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Bounty", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 112 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FBounty/programId", + "kind": "column", + "label": "programId" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Bounty", + "type": "Int", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 114 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FBounty/rewardAmount", + "kind": "column", + "label": "rewardAmount" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/BountySubmission", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 121 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FBountySubmission/bountyId", + "kind": "column", + "label": "bountyId" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": { + "args": [ + 1 + ], + "name": "cuid" + }, + "hasDefault": true, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/BountySubmission", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 120 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FBountySubmission/id", + "kind": "column", + "label": "id" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/BountySubmission", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 122 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FBountySubmission/partnerId", + "kind": "column", + "label": "partnerId" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/BountySubmission", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 123 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FBountySubmission/url", + "kind": "column", + "label": "url" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Campaign", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 148 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FCampaign/body", + "kind": "column", + "label": "body" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": { + "args": [ + 1 + ], + "name": "cuid" + }, + "hasDefault": true, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Campaign", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 145 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FCampaign/id", + "kind": "column", + "label": "id" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Campaign", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 146 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FCampaign/programId", + "kind": "column", + "label": "programId" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Campaign", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 147 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FCampaign/subject", + "kind": "column", + "label": "subject" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Commission", + "type": "Int", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 92 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FCommission/amount", + "kind": "column", + "label": "amount" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": { + "args": [ + 1 + ], + "name": "cuid" + }, + "hasDefault": true, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Commission", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 88 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FCommission/id", + "kind": "column", + "label": "id" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Commission", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 90 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FCommission/partnerId", + "kind": "column", + "label": "partnerId" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": true, + "table": "table:/Commission", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 91 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FCommission/payoutId", + "kind": "column", + "label": "payoutId" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Commission", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 89 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FCommission/programId", + "kind": "column", + "label": "programId" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Commission", + "type": "enum:CommissionStatus", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 93 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FCommission/status", + "kind": "column", + "label": "status" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Discount", + "type": "Int", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 139 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FDiscount/amount", + "kind": "column", + "label": "amount" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": true, + "table": "table:/Discount", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 140 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FDiscount/couponId", + "kind": "column", + "label": "couponId" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": { + "args": [ + 1 + ], + "name": "cuid" + }, + "hasDefault": true, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Discount", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 137 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FDiscount/id", + "kind": "column", + "label": "id" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Discount", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 138 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FDiscount/programId", + "kind": "column", + "label": "programId" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": { + "args": [ + 1 + ], + "name": "cuid" + }, + "hasDefault": true, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/FraudAlert", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 164 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FFraudAlert/id", + "kind": "column", + "label": "id" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/FraudAlert", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 166 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FFraudAlert/partnerId", + "kind": "column", + "label": "partnerId" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/FraudAlert", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 165 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FFraudAlert/programId", + "kind": "column", + "label": "programId" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/FraudAlert", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 167 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FFraudAlert/reason", + "kind": "column", + "label": "reason" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": { + "args": [ + 1 + ], + "name": "cuid" + }, + "hasDefault": true, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Message", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 153 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FMessage/id", + "kind": "column", + "label": "id" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Message", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 155 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FMessage/partnerId", + "kind": "column", + "label": "partnerId" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Message", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 154 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FMessage/programId", + "kind": "column", + "label": "programId" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Message", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 156 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FMessage/senderUserId", + "kind": "column", + "label": "senderUserId" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Message", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 157 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FMessage/text", + "kind": "column", + "label": "text" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": true, + "table": "table:/Partner", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 53 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FPartner/country", + "kind": "column", + "label": "country" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Partner", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 52 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FPartner/email", + "kind": "column", + "label": "email" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": { + "args": [ + 1 + ], + "name": "cuid" + }, + "hasDefault": true, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Partner", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 50 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FPartner/id", + "kind": "column", + "label": "id" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Partner", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 51 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FPartner/name", + "kind": "column", + "label": "name" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/PartnerInvite", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 82 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FPartnerInvite/email", + "kind": "column", + "label": "email" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/PartnerInvite", + "type": "DateTime", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 83 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FPartnerInvite/expiresAt", + "kind": "column", + "label": "expiresAt" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": { + "args": [ + 1 + ], + "name": "cuid" + }, + "hasDefault": true, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/PartnerInvite", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 80 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FPartnerInvite/id", + "kind": "column", + "label": "id" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/PartnerInvite", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 81 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FPartnerInvite/programId", + "kind": "column", + "label": "programId" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Payout", + "type": "Int", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 103 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FPayout/amount", + "kind": "column", + "label": "amount" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": { + "args": [ + 1 + ], + "name": "cuid" + }, + "hasDefault": true, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Payout", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 100 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FPayout/id", + "kind": "column", + "label": "id" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Payout", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 102 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FPayout/partnerId", + "kind": "column", + "label": "partnerId" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Payout", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 101 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FPayout/programId", + "kind": "column", + "label": "programId" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Payout", + "type": "enum:PayoutStatus", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 104 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FPayout/status", + "kind": "column", + "label": "status" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": true, + "table": "table:/Program", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 34 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FProgram/domain", + "kind": "column", + "label": "domain" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": { + "args": [ + 1 + ], + "name": "cuid" + }, + "hasDefault": true, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Program", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 31 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FProgram/id", + "kind": "column", + "label": "id" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Program", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 33 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FProgram/name", + "kind": "column", + "label": "name" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Program", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 32 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FProgram/workspaceId", + "kind": "column", + "label": "workspaceId" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/ProgramApplication", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 74 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FProgramApplication/email", + "kind": "column", + "label": "email" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": { + "args": [ + 1 + ], + "name": "cuid" + }, + "hasDefault": true, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/ProgramApplication", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 72 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FProgramApplication/id", + "kind": "column", + "label": "id" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/ProgramApplication", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 73 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FProgramApplication/programId", + "kind": "column", + "label": "programId" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": true, + "table": "table:/ProgramApplication", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 75 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FProgramApplication/website", + "kind": "column", + "label": "website" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": { + "args": [ + 1 + ], + "name": "cuid" + }, + "hasDefault": true, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/ProgramEnrollment", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 63 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FProgramEnrollment/id", + "kind": "column", + "label": "id" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/ProgramEnrollment", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 65 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FProgramEnrollment/partnerId", + "kind": "column", + "label": "partnerId" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/ProgramEnrollment", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 64 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FProgramEnrollment/programId", + "kind": "column", + "label": "programId" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/ProgramEnrollment", + "type": "enum:CommissionStatus", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 66 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FProgramEnrollment/status", + "kind": "column", + "label": "status" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Reward", + "type": "Int", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 132 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FReward/amount", + "kind": "column", + "label": "amount" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Reward", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 131 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FReward/event", + "kind": "column", + "label": "event" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": { + "args": [ + 1 + ], + "name": "cuid" + }, + "hasDefault": true, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Reward", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 129 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FReward/id", + "kind": "column", + "label": "id" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Reward", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 130 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FReward/programId", + "kind": "column", + "label": "programId" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/User", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 24 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FUser/email", + "kind": "column", + "label": "email" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": { + "args": [ + 1 + ], + "name": "cuid" + }, + "hasDefault": true, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/User", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 23 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FUser/id", + "kind": "column", + "label": "id" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/User", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 25 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FUser/workspaceId", + "kind": "column", + "label": "workspaceId" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": { + "args": [], + "name": "now" + }, + "hasDefault": true, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Workspace", + "type": "DateTime", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 17 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FWorkspace/createdAt", + "kind": "column", + "label": "createdAt" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": { + "args": [ + 1 + ], + "name": "cuid" + }, + "hasDefault": true, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Workspace", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 13 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FWorkspace/id", + "kind": "column", + "label": "id" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Workspace", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 14 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FWorkspace/name", + "kind": "column", + "label": "name" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": false, + "hasDefault": true, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Workspace", + "type": "Boolean", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 16 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FWorkspace/partnersEnabled", + "kind": "column", + "label": "partnersEnabled" + }, + { + "confidence": "authoritative", + "data": { + "databaseType": null, + "default": null, + "hasDefault": false, + "list": false, + "nativeType": null, + "nullable": false, + "table": "table:/Workspace", + "type": "String", + "updatedAt": false + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 15 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "column:table%3A%2FWorkspace/slug", + "kind": "column", + "label": "slug" + }, + { + "confidence": "authoritative", + "data": { + "columns": [ + "programId" + ], + "onDelete": null, + "onUpdate": null, + "references": [ + "id" + ], + "table": "table:/Bounty", + "target": "table:/Program", + "type": "foreign-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 115 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FBounty/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "kind": "constraint", + "label": "foreign-key (programId)" + }, + { + "confidence": "authoritative", + "data": { + "databaseName": null, + "fields": [ + { + "name": "id" + } + ], + "table": "table:/Bounty", + "type": "primary-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 111 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FBounty/primary-key/%5B%22id%22%5D", + "kind": "constraint", + "label": "primary-key (id)" + }, + { + "confidence": "authoritative", + "data": { + "columns": [ + "bountyId" + ], + "onDelete": null, + "onUpdate": null, + "references": [ + "id" + ], + "table": "table:/BountySubmission", + "target": "table:/Bounty", + "type": "foreign-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 124 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FBountySubmission/foreign-key/%5B%22bountyId%22%5D/table%3A%2FBounty", + "kind": "constraint", + "label": "foreign-key (bountyId)" + }, + { + "confidence": "authoritative", + "data": { + "columns": [ + "partnerId" + ], + "onDelete": null, + "onUpdate": null, + "references": [ + "id" + ], + "table": "table:/BountySubmission", + "target": "table:/Partner", + "type": "foreign-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 125 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FBountySubmission/foreign-key/%5B%22partnerId%22%5D/table%3A%2FPartner", + "kind": "constraint", + "label": "foreign-key (partnerId)" + }, + { + "confidence": "authoritative", + "data": { + "databaseName": null, + "fields": [ + { + "name": "id" + } + ], + "table": "table:/BountySubmission", + "type": "primary-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 120 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FBountySubmission/primary-key/%5B%22id%22%5D", + "kind": "constraint", + "label": "primary-key (id)" + }, + { + "confidence": "authoritative", + "data": { + "columns": [ + "programId" + ], + "onDelete": null, + "onUpdate": null, + "references": [ + "id" + ], + "table": "table:/Campaign", + "target": "table:/Program", + "type": "foreign-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 149 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FCampaign/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "kind": "constraint", + "label": "foreign-key (programId)" + }, + { + "confidence": "authoritative", + "data": { + "databaseName": null, + "fields": [ + { + "name": "id" + } + ], + "table": "table:/Campaign", + "type": "primary-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 145 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FCampaign/primary-key/%5B%22id%22%5D", + "kind": "constraint", + "label": "primary-key (id)" + }, + { + "confidence": "authoritative", + "data": { + "columns": [ + "partnerId" + ], + "onDelete": null, + "onUpdate": null, + "references": [ + "id" + ], + "table": "table:/Commission", + "target": "table:/Partner", + "type": "foreign-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 95 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FCommission/foreign-key/%5B%22partnerId%22%5D/table%3A%2FPartner", + "kind": "constraint", + "label": "foreign-key (partnerId)" + }, + { + "confidence": "authoritative", + "data": { + "columns": [ + "payoutId" + ], + "onDelete": null, + "onUpdate": null, + "references": [ + "id" + ], + "table": "table:/Commission", + "target": "table:/Payout", + "type": "foreign-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 96 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FCommission/foreign-key/%5B%22payoutId%22%5D/table%3A%2FPayout", + "kind": "constraint", + "label": "foreign-key (payoutId)" + }, + { + "confidence": "authoritative", + "data": { + "columns": [ + "programId" + ], + "onDelete": null, + "onUpdate": null, + "references": [ + "id" + ], + "table": "table:/Commission", + "target": "table:/Program", + "type": "foreign-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 94 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FCommission/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "kind": "constraint", + "label": "foreign-key (programId)" + }, + { + "confidence": "authoritative", + "data": { + "databaseName": null, + "fields": [ + { + "name": "id" + } + ], + "table": "table:/Commission", + "type": "primary-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 88 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FCommission/primary-key/%5B%22id%22%5D", + "kind": "constraint", + "label": "primary-key (id)" + }, + { + "confidence": "authoritative", + "data": { + "columns": [ + "programId" + ], + "onDelete": null, + "onUpdate": null, + "references": [ + "id" + ], + "table": "table:/Discount", + "target": "table:/Program", + "type": "foreign-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 141 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FDiscount/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "kind": "constraint", + "label": "foreign-key (programId)" + }, + { + "confidence": "authoritative", + "data": { + "databaseName": null, + "fields": [ + { + "name": "id" + } + ], + "table": "table:/Discount", + "type": "primary-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 137 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FDiscount/primary-key/%5B%22id%22%5D", + "kind": "constraint", + "label": "primary-key (id)" + }, + { + "confidence": "authoritative", + "data": { + "columns": [ + "partnerId" + ], + "onDelete": null, + "onUpdate": null, + "references": [ + "id" + ], + "table": "table:/FraudAlert", + "target": "table:/Partner", + "type": "foreign-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 169 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FFraudAlert/foreign-key/%5B%22partnerId%22%5D/table%3A%2FPartner", + "kind": "constraint", + "label": "foreign-key (partnerId)" + }, + { + "confidence": "authoritative", + "data": { + "columns": [ + "programId" + ], + "onDelete": null, + "onUpdate": null, + "references": [ + "id" + ], + "table": "table:/FraudAlert", + "target": "table:/Program", + "type": "foreign-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 168 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FFraudAlert/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "kind": "constraint", + "label": "foreign-key (programId)" + }, + { + "confidence": "authoritative", + "data": { + "databaseName": null, + "fields": [ + { + "name": "id" + } + ], + "table": "table:/FraudAlert", + "type": "primary-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 164 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FFraudAlert/primary-key/%5B%22id%22%5D", + "kind": "constraint", + "label": "primary-key (id)" + }, + { + "confidence": "authoritative", + "data": { + "columns": [ + "partnerId" + ], + "onDelete": null, + "onUpdate": null, + "references": [ + "id" + ], + "table": "table:/Message", + "target": "table:/Partner", + "type": "foreign-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 159 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FMessage/foreign-key/%5B%22partnerId%22%5D/table%3A%2FPartner", + "kind": "constraint", + "label": "foreign-key (partnerId)" + }, + { + "confidence": "authoritative", + "data": { + "columns": [ + "programId" + ], + "onDelete": null, + "onUpdate": null, + "references": [ + "id" + ], + "table": "table:/Message", + "target": "table:/Program", + "type": "foreign-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 158 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FMessage/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "kind": "constraint", + "label": "foreign-key (programId)" + }, + { + "confidence": "authoritative", + "data": { + "columns": [ + "senderUserId" + ], + "onDelete": null, + "onUpdate": null, + "references": [ + "id" + ], + "table": "table:/Message", + "target": "table:/User", + "type": "foreign-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 160 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FMessage/foreign-key/%5B%22senderUserId%22%5D/table%3A%2FUser", + "kind": "constraint", + "label": "foreign-key (senderUserId)" + }, + { + "confidence": "authoritative", + "data": { + "databaseName": null, + "fields": [ + { + "name": "id" + } + ], + "table": "table:/Message", + "type": "primary-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 153 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FMessage/primary-key/%5B%22id%22%5D", + "kind": "constraint", + "label": "primary-key (id)" + }, + { + "confidence": "authoritative", + "data": { + "databaseName": null, + "fields": [ + { + "name": "id" + } + ], + "table": "table:/Partner", + "type": "primary-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 50 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FPartner/primary-key/%5B%22id%22%5D", + "kind": "constraint", + "label": "primary-key (id)" + }, + { + "confidence": "authoritative", + "data": { + "databaseName": null, + "fields": [ + { + "name": "email" + } + ], + "table": "table:/Partner", + "type": "unique" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 52 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FPartner/unique/%5B%22email%22%5D", + "kind": "constraint", + "label": "unique (email)" + }, + { + "confidence": "authoritative", + "data": { + "columns": [ + "programId" + ], + "onDelete": null, + "onUpdate": null, + "references": [ + "id" + ], + "table": "table:/PartnerInvite", + "target": "table:/Program", + "type": "foreign-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 84 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FPartnerInvite/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "kind": "constraint", + "label": "foreign-key (programId)" + }, + { + "confidence": "authoritative", + "data": { + "databaseName": null, + "fields": [ + { + "name": "id" + } + ], + "table": "table:/PartnerInvite", + "type": "primary-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 80 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FPartnerInvite/primary-key/%5B%22id%22%5D", + "kind": "constraint", + "label": "primary-key (id)" + }, + { + "confidence": "authoritative", + "data": { + "columns": [ + "partnerId" + ], + "onDelete": null, + "onUpdate": null, + "references": [ + "id" + ], + "table": "table:/Payout", + "target": "table:/Partner", + "type": "foreign-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 106 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FPayout/foreign-key/%5B%22partnerId%22%5D/table%3A%2FPartner", + "kind": "constraint", + "label": "foreign-key (partnerId)" + }, + { + "confidence": "authoritative", + "data": { + "columns": [ + "programId" + ], + "onDelete": null, + "onUpdate": null, + "references": [ + "id" + ], + "table": "table:/Payout", + "target": "table:/Program", + "type": "foreign-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 105 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FPayout/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "kind": "constraint", + "label": "foreign-key (programId)" + }, + { + "confidence": "authoritative", + "data": { + "databaseName": null, + "fields": [ + { + "name": "id" + } + ], + "table": "table:/Payout", + "type": "primary-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 100 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FPayout/primary-key/%5B%22id%22%5D", + "kind": "constraint", + "label": "primary-key (id)" + }, + { + "confidence": "authoritative", + "data": { + "columns": [ + "workspaceId" + ], + "onDelete": null, + "onUpdate": null, + "references": [ + "id" + ], + "table": "table:/Program", + "target": "table:/Workspace", + "type": "foreign-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 35 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FProgram/foreign-key/%5B%22workspaceId%22%5D/table%3A%2FWorkspace", + "kind": "constraint", + "label": "foreign-key (workspaceId)" + }, + { + "confidence": "authoritative", + "data": { + "databaseName": null, + "fields": [ + { + "name": "id" + } + ], + "table": "table:/Program", + "type": "primary-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 31 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FProgram/primary-key/%5B%22id%22%5D", + "kind": "constraint", + "label": "primary-key (id)" + }, + { + "confidence": "authoritative", + "data": { + "columns": [ + "programId" + ], + "onDelete": null, + "onUpdate": null, + "references": [ + "id" + ], + "table": "table:/ProgramApplication", + "target": "table:/Program", + "type": "foreign-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 76 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FProgramApplication/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "kind": "constraint", + "label": "foreign-key (programId)" + }, + { + "confidence": "authoritative", + "data": { + "databaseName": null, + "fields": [ + { + "name": "id" + } + ], + "table": "table:/ProgramApplication", + "type": "primary-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 72 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FProgramApplication/primary-key/%5B%22id%22%5D", + "kind": "constraint", + "label": "primary-key (id)" + }, + { + "confidence": "authoritative", + "data": { + "columns": [ + "partnerId" + ], + "onDelete": null, + "onUpdate": null, + "references": [ + "id" + ], + "table": "table:/ProgramEnrollment", + "target": "table:/Partner", + "type": "foreign-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 68 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FProgramEnrollment/foreign-key/%5B%22partnerId%22%5D/table%3A%2FPartner", + "kind": "constraint", + "label": "foreign-key (partnerId)" + }, + { + "confidence": "authoritative", + "data": { + "columns": [ + "programId" + ], + "onDelete": null, + "onUpdate": null, + "references": [ + "id" + ], + "table": "table:/ProgramEnrollment", + "target": "table:/Program", + "type": "foreign-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 67 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FProgramEnrollment/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "kind": "constraint", + "label": "foreign-key (programId)" + }, + { + "confidence": "authoritative", + "data": { + "databaseName": null, + "fields": [ + { + "name": "id" + } + ], + "table": "table:/ProgramEnrollment", + "type": "primary-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 63 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FProgramEnrollment/primary-key/%5B%22id%22%5D", + "kind": "constraint", + "label": "primary-key (id)" + }, + { + "confidence": "authoritative", + "data": { + "columns": [ + "programId" + ], + "onDelete": null, + "onUpdate": null, + "references": [ + "id" + ], + "table": "table:/Reward", + "target": "table:/Program", + "type": "foreign-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 133 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FReward/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "kind": "constraint", + "label": "foreign-key (programId)" + }, + { + "confidence": "authoritative", + "data": { + "databaseName": null, + "fields": [ + { + "name": "id" + } + ], + "table": "table:/Reward", + "type": "primary-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 129 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FReward/primary-key/%5B%22id%22%5D", + "kind": "constraint", + "label": "primary-key (id)" + }, + { + "confidence": "authoritative", + "data": { + "columns": [ + "workspaceId" + ], + "onDelete": null, + "onUpdate": null, + "references": [ + "id" + ], + "table": "table:/User", + "target": "table:/Workspace", + "type": "foreign-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 26 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FUser/foreign-key/%5B%22workspaceId%22%5D/table%3A%2FWorkspace", + "kind": "constraint", + "label": "foreign-key (workspaceId)" + }, + { + "confidence": "authoritative", + "data": { + "databaseName": null, + "fields": [ + { + "name": "id" + } + ], + "table": "table:/User", + "type": "primary-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 23 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FUser/primary-key/%5B%22id%22%5D", + "kind": "constraint", + "label": "primary-key (id)" + }, + { + "confidence": "authoritative", + "data": { + "databaseName": null, + "fields": [ + { + "name": "email" + } + ], + "table": "table:/User", + "type": "unique" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 24 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FUser/unique/%5B%22email%22%5D", + "kind": "constraint", + "label": "unique (email)" + }, + { + "confidence": "authoritative", + "data": { + "databaseName": null, + "fields": [ + { + "name": "id" + } + ], + "table": "table:/Workspace", + "type": "primary-key" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 13 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FWorkspace/primary-key/%5B%22id%22%5D", + "kind": "constraint", + "label": "primary-key (id)" + }, + { + "confidence": "authoritative", + "data": { + "databaseName": null, + "fields": [ + { + "name": "slug" + } + ], + "table": "table:/Workspace", + "type": "unique" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 15 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "constraint:table%3A%2FWorkspace/unique/%5B%22slug%22%5D", + "kind": "constraint", + "label": "unique (slug)" + }, + { + "confidence": "authoritative", + "data": { + "values": [ + "pending", + "processed", + "paid" + ] + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 172 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "enum:CommissionStatus", + "kind": "enum", + "label": "CommissionStatus" + }, + { + "confidence": "authoritative", + "data": { + "values": [ + "pending", + "sent", + "failed" + ] + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 178 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "enum:PayoutStatus", + "kind": "enum", + "label": "PayoutStatus" + }, + { + "confidence": "authoritative", + "data": { + "namespace": null, + "provider": "postgresql" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 110 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "table:/Bounty", + "kind": "table", + "label": "Bounty" + }, + { + "confidence": "authoritative", + "data": { + "namespace": null, + "provider": "postgresql" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 119 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "table:/BountySubmission", + "kind": "table", + "label": "BountySubmission" + }, + { + "confidence": "authoritative", + "data": { + "namespace": null, + "provider": "postgresql" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 144 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "table:/Campaign", + "kind": "table", + "label": "Campaign" + }, + { + "confidence": "authoritative", + "data": { + "namespace": null, + "provider": "postgresql" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 87 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "table:/Commission", + "kind": "table", + "label": "Commission" + }, + { + "confidence": "authoritative", + "data": { + "namespace": null, + "provider": "postgresql" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 136 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "table:/Discount", + "kind": "table", + "label": "Discount" + }, + { + "confidence": "authoritative", + "data": { + "namespace": null, + "provider": "postgresql" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 163 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "table:/FraudAlert", + "kind": "table", + "label": "FraudAlert" + }, + { + "confidence": "authoritative", + "data": { + "namespace": null, + "provider": "postgresql" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 152 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "table:/Message", + "kind": "table", + "label": "Message" + }, + { + "confidence": "authoritative", + "data": { + "namespace": null, + "provider": "postgresql" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 49 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "table:/Partner", + "kind": "table", + "label": "Partner" + }, + { + "confidence": "authoritative", + "data": { + "namespace": null, + "provider": "postgresql" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 79 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "table:/PartnerInvite", + "kind": "table", + "label": "PartnerInvite" + }, + { + "confidence": "authoritative", + "data": { + "namespace": null, + "provider": "postgresql" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 99 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "table:/Payout", + "kind": "table", + "label": "Payout" + }, + { + "confidence": "authoritative", + "data": { + "namespace": null, + "provider": "postgresql" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 30 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "table:/Program", + "kind": "table", + "label": "Program" + }, + { + "confidence": "authoritative", + "data": { + "namespace": null, + "provider": "postgresql" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 71 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "table:/ProgramApplication", + "kind": "table", + "label": "ProgramApplication" + }, + { + "confidence": "authoritative", + "data": { + "namespace": null, + "provider": "postgresql" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 62 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "table:/ProgramEnrollment", + "kind": "table", + "label": "ProgramEnrollment" + }, + { + "confidence": "authoritative", + "data": { + "namespace": null, + "provider": "postgresql" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 128 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "table:/Reward", + "kind": "table", + "label": "Reward" + }, + { + "confidence": "authoritative", + "data": { + "namespace": null, + "provider": "postgresql" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 22 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "table:/User", + "kind": "table", + "label": "User" + }, + { + "confidence": "authoritative", + "data": { + "namespace": null, + "provider": "postgresql" + }, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 12 + }, + "source": "prisma/schema.prisma" + } + ], + "id": "table:/Workspace", + "kind": "table", + "label": "Workspace" + } + ], + "metadata": { + "authority": "Prisma schema language, parsed by Projections", + "framework": "prisma", + "limitations": [ + "Desired Prisma model, not a live database or migration history; no database connection, generation or Prisma installation is involved.", + "Ignored (@ignore, @@ignore) and Unsupported fields are not columns; composite types are not relational columns.", + "Implicit many-to-many relations are relationships, not invented physical join tables.", + "Unnamed constraint identities use ordered database columns, not connector-generated SQL names; relationMode, mapped foreign-key names and implicit referential-action defaults are not inferred.", + "Connector-specific capability checks (supported native types, index types and arguments per database) are left to Prisma." + ], + "sources": [ + "prisma/schema.prisma" + ] + }, + "protocolVersion": 0, + "relationships": [ + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 115 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FBounty/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "id": "constrains:constraint%3Atable%253A%252FBounty%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/column%3Atable%253A%252FBounty%2FprogramId/", + "kind": "constrains", + "to": "column:table%3A%2FBounty/programId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 111 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FBounty/primary-key/%5B%22id%22%5D", + "id": "constrains:constraint%3Atable%253A%252FBounty%2Fprimary-key%2F%255B%2522id%2522%255D/column%3Atable%253A%252FBounty%2Fid/", + "kind": "constrains", + "to": "column:table%3A%2FBounty/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 124 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FBountySubmission/foreign-key/%5B%22bountyId%22%5D/table%3A%2FBounty", + "id": "constrains:constraint%3Atable%253A%252FBountySubmission%2Fforeign-key%2F%255B%2522bountyId%2522%255D%2Ftable%253A%252FBounty/column%3Atable%253A%252FBountySubmission%2FbountyId/", + "kind": "constrains", + "to": "column:table%3A%2FBountySubmission/bountyId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 125 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FBountySubmission/foreign-key/%5B%22partnerId%22%5D/table%3A%2FPartner", + "id": "constrains:constraint%3Atable%253A%252FBountySubmission%2Fforeign-key%2F%255B%2522partnerId%2522%255D%2Ftable%253A%252FPartner/column%3Atable%253A%252FBountySubmission%2FpartnerId/", + "kind": "constrains", + "to": "column:table%3A%2FBountySubmission/partnerId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 120 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FBountySubmission/primary-key/%5B%22id%22%5D", + "id": "constrains:constraint%3Atable%253A%252FBountySubmission%2Fprimary-key%2F%255B%2522id%2522%255D/column%3Atable%253A%252FBountySubmission%2Fid/", + "kind": "constrains", + "to": "column:table%3A%2FBountySubmission/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 149 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FCampaign/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "id": "constrains:constraint%3Atable%253A%252FCampaign%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/column%3Atable%253A%252FCampaign%2FprogramId/", + "kind": "constrains", + "to": "column:table%3A%2FCampaign/programId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 145 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FCampaign/primary-key/%5B%22id%22%5D", + "id": "constrains:constraint%3Atable%253A%252FCampaign%2Fprimary-key%2F%255B%2522id%2522%255D/column%3Atable%253A%252FCampaign%2Fid/", + "kind": "constrains", + "to": "column:table%3A%2FCampaign/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 95 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FCommission/foreign-key/%5B%22partnerId%22%5D/table%3A%2FPartner", + "id": "constrains:constraint%3Atable%253A%252FCommission%2Fforeign-key%2F%255B%2522partnerId%2522%255D%2Ftable%253A%252FPartner/column%3Atable%253A%252FCommission%2FpartnerId/", + "kind": "constrains", + "to": "column:table%3A%2FCommission/partnerId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 96 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FCommission/foreign-key/%5B%22payoutId%22%5D/table%3A%2FPayout", + "id": "constrains:constraint%3Atable%253A%252FCommission%2Fforeign-key%2F%255B%2522payoutId%2522%255D%2Ftable%253A%252FPayout/column%3Atable%253A%252FCommission%2FpayoutId/", + "kind": "constrains", + "to": "column:table%3A%2FCommission/payoutId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 94 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FCommission/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "id": "constrains:constraint%3Atable%253A%252FCommission%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/column%3Atable%253A%252FCommission%2FprogramId/", + "kind": "constrains", + "to": "column:table%3A%2FCommission/programId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 88 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FCommission/primary-key/%5B%22id%22%5D", + "id": "constrains:constraint%3Atable%253A%252FCommission%2Fprimary-key%2F%255B%2522id%2522%255D/column%3Atable%253A%252FCommission%2Fid/", + "kind": "constrains", + "to": "column:table%3A%2FCommission/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 141 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FDiscount/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "id": "constrains:constraint%3Atable%253A%252FDiscount%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/column%3Atable%253A%252FDiscount%2FprogramId/", + "kind": "constrains", + "to": "column:table%3A%2FDiscount/programId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 137 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FDiscount/primary-key/%5B%22id%22%5D", + "id": "constrains:constraint%3Atable%253A%252FDiscount%2Fprimary-key%2F%255B%2522id%2522%255D/column%3Atable%253A%252FDiscount%2Fid/", + "kind": "constrains", + "to": "column:table%3A%2FDiscount/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 169 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FFraudAlert/foreign-key/%5B%22partnerId%22%5D/table%3A%2FPartner", + "id": "constrains:constraint%3Atable%253A%252FFraudAlert%2Fforeign-key%2F%255B%2522partnerId%2522%255D%2Ftable%253A%252FPartner/column%3Atable%253A%252FFraudAlert%2FpartnerId/", + "kind": "constrains", + "to": "column:table%3A%2FFraudAlert/partnerId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 168 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FFraudAlert/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "id": "constrains:constraint%3Atable%253A%252FFraudAlert%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/column%3Atable%253A%252FFraudAlert%2FprogramId/", + "kind": "constrains", + "to": "column:table%3A%2FFraudAlert/programId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 164 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FFraudAlert/primary-key/%5B%22id%22%5D", + "id": "constrains:constraint%3Atable%253A%252FFraudAlert%2Fprimary-key%2F%255B%2522id%2522%255D/column%3Atable%253A%252FFraudAlert%2Fid/", + "kind": "constrains", + "to": "column:table%3A%2FFraudAlert/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 159 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FMessage/foreign-key/%5B%22partnerId%22%5D/table%3A%2FPartner", + "id": "constrains:constraint%3Atable%253A%252FMessage%2Fforeign-key%2F%255B%2522partnerId%2522%255D%2Ftable%253A%252FPartner/column%3Atable%253A%252FMessage%2FpartnerId/", + "kind": "constrains", + "to": "column:table%3A%2FMessage/partnerId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 158 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FMessage/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "id": "constrains:constraint%3Atable%253A%252FMessage%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/column%3Atable%253A%252FMessage%2FprogramId/", + "kind": "constrains", + "to": "column:table%3A%2FMessage/programId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 160 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FMessage/foreign-key/%5B%22senderUserId%22%5D/table%3A%2FUser", + "id": "constrains:constraint%3Atable%253A%252FMessage%2Fforeign-key%2F%255B%2522senderUserId%2522%255D%2Ftable%253A%252FUser/column%3Atable%253A%252FMessage%2FsenderUserId/", + "kind": "constrains", + "to": "column:table%3A%2FMessage/senderUserId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 153 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FMessage/primary-key/%5B%22id%22%5D", + "id": "constrains:constraint%3Atable%253A%252FMessage%2Fprimary-key%2F%255B%2522id%2522%255D/column%3Atable%253A%252FMessage%2Fid/", + "kind": "constrains", + "to": "column:table%3A%2FMessage/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 50 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FPartner/primary-key/%5B%22id%22%5D", + "id": "constrains:constraint%3Atable%253A%252FPartner%2Fprimary-key%2F%255B%2522id%2522%255D/column%3Atable%253A%252FPartner%2Fid/", + "kind": "constrains", + "to": "column:table%3A%2FPartner/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 52 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FPartner/unique/%5B%22email%22%5D", + "id": "constrains:constraint%3Atable%253A%252FPartner%2Funique%2F%255B%2522email%2522%255D/column%3Atable%253A%252FPartner%2Femail/", + "kind": "constrains", + "to": "column:table%3A%2FPartner/email" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 84 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FPartnerInvite/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "id": "constrains:constraint%3Atable%253A%252FPartnerInvite%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/column%3Atable%253A%252FPartnerInvite%2FprogramId/", + "kind": "constrains", + "to": "column:table%3A%2FPartnerInvite/programId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 80 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FPartnerInvite/primary-key/%5B%22id%22%5D", + "id": "constrains:constraint%3Atable%253A%252FPartnerInvite%2Fprimary-key%2F%255B%2522id%2522%255D/column%3Atable%253A%252FPartnerInvite%2Fid/", + "kind": "constrains", + "to": "column:table%3A%2FPartnerInvite/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 106 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FPayout/foreign-key/%5B%22partnerId%22%5D/table%3A%2FPartner", + "id": "constrains:constraint%3Atable%253A%252FPayout%2Fforeign-key%2F%255B%2522partnerId%2522%255D%2Ftable%253A%252FPartner/column%3Atable%253A%252FPayout%2FpartnerId/", + "kind": "constrains", + "to": "column:table%3A%2FPayout/partnerId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 105 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FPayout/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "id": "constrains:constraint%3Atable%253A%252FPayout%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/column%3Atable%253A%252FPayout%2FprogramId/", + "kind": "constrains", + "to": "column:table%3A%2FPayout/programId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 100 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FPayout/primary-key/%5B%22id%22%5D", + "id": "constrains:constraint%3Atable%253A%252FPayout%2Fprimary-key%2F%255B%2522id%2522%255D/column%3Atable%253A%252FPayout%2Fid/", + "kind": "constrains", + "to": "column:table%3A%2FPayout/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 35 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FProgram/foreign-key/%5B%22workspaceId%22%5D/table%3A%2FWorkspace", + "id": "constrains:constraint%3Atable%253A%252FProgram%2Fforeign-key%2F%255B%2522workspaceId%2522%255D%2Ftable%253A%252FWorkspace/column%3Atable%253A%252FProgram%2FworkspaceId/", + "kind": "constrains", + "to": "column:table%3A%2FProgram/workspaceId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 31 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FProgram/primary-key/%5B%22id%22%5D", + "id": "constrains:constraint%3Atable%253A%252FProgram%2Fprimary-key%2F%255B%2522id%2522%255D/column%3Atable%253A%252FProgram%2Fid/", + "kind": "constrains", + "to": "column:table%3A%2FProgram/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 76 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FProgramApplication/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "id": "constrains:constraint%3Atable%253A%252FProgramApplication%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/column%3Atable%253A%252FProgramApplication%2FprogramId/", + "kind": "constrains", + "to": "column:table%3A%2FProgramApplication/programId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 72 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FProgramApplication/primary-key/%5B%22id%22%5D", + "id": "constrains:constraint%3Atable%253A%252FProgramApplication%2Fprimary-key%2F%255B%2522id%2522%255D/column%3Atable%253A%252FProgramApplication%2Fid/", + "kind": "constrains", + "to": "column:table%3A%2FProgramApplication/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 68 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FProgramEnrollment/foreign-key/%5B%22partnerId%22%5D/table%3A%2FPartner", + "id": "constrains:constraint%3Atable%253A%252FProgramEnrollment%2Fforeign-key%2F%255B%2522partnerId%2522%255D%2Ftable%253A%252FPartner/column%3Atable%253A%252FProgramEnrollment%2FpartnerId/", + "kind": "constrains", + "to": "column:table%3A%2FProgramEnrollment/partnerId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 67 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FProgramEnrollment/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "id": "constrains:constraint%3Atable%253A%252FProgramEnrollment%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/column%3Atable%253A%252FProgramEnrollment%2FprogramId/", + "kind": "constrains", + "to": "column:table%3A%2FProgramEnrollment/programId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 63 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FProgramEnrollment/primary-key/%5B%22id%22%5D", + "id": "constrains:constraint%3Atable%253A%252FProgramEnrollment%2Fprimary-key%2F%255B%2522id%2522%255D/column%3Atable%253A%252FProgramEnrollment%2Fid/", + "kind": "constrains", + "to": "column:table%3A%2FProgramEnrollment/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 133 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FReward/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "id": "constrains:constraint%3Atable%253A%252FReward%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/column%3Atable%253A%252FReward%2FprogramId/", + "kind": "constrains", + "to": "column:table%3A%2FReward/programId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 129 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FReward/primary-key/%5B%22id%22%5D", + "id": "constrains:constraint%3Atable%253A%252FReward%2Fprimary-key%2F%255B%2522id%2522%255D/column%3Atable%253A%252FReward%2Fid/", + "kind": "constrains", + "to": "column:table%3A%2FReward/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 26 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FUser/foreign-key/%5B%22workspaceId%22%5D/table%3A%2FWorkspace", + "id": "constrains:constraint%3Atable%253A%252FUser%2Fforeign-key%2F%255B%2522workspaceId%2522%255D%2Ftable%253A%252FWorkspace/column%3Atable%253A%252FUser%2FworkspaceId/", + "kind": "constrains", + "to": "column:table%3A%2FUser/workspaceId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 23 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FUser/primary-key/%5B%22id%22%5D", + "id": "constrains:constraint%3Atable%253A%252FUser%2Fprimary-key%2F%255B%2522id%2522%255D/column%3Atable%253A%252FUser%2Fid/", + "kind": "constrains", + "to": "column:table%3A%2FUser/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 24 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FUser/unique/%5B%22email%22%5D", + "id": "constrains:constraint%3Atable%253A%252FUser%2Funique%2F%255B%2522email%2522%255D/column%3Atable%253A%252FUser%2Femail/", + "kind": "constrains", + "to": "column:table%3A%2FUser/email" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 13 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FWorkspace/primary-key/%5B%22id%22%5D", + "id": "constrains:constraint%3Atable%253A%252FWorkspace%2Fprimary-key%2F%255B%2522id%2522%255D/column%3Atable%253A%252FWorkspace%2Fid/", + "kind": "constrains", + "to": "column:table%3A%2FWorkspace/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 15 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FWorkspace/unique/%5B%22slug%22%5D", + "id": "constrains:constraint%3Atable%253A%252FWorkspace%2Funique%2F%255B%2522slug%2522%255D/column%3Atable%253A%252FWorkspace%2Fslug/", + "kind": "constrains", + "to": "column:table%3A%2FWorkspace/slug" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 111 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Bounty", + "id": "contains:table%3A%2FBounty/column%3Atable%253A%252FBounty%2Fid/", + "kind": "contains", + "to": "column:table%3A%2FBounty/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 113 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Bounty", + "id": "contains:table%3A%2FBounty/column%3Atable%253A%252FBounty%2Fname/", + "kind": "contains", + "to": "column:table%3A%2FBounty/name" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 112 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Bounty", + "id": "contains:table%3A%2FBounty/column%3Atable%253A%252FBounty%2FprogramId/", + "kind": "contains", + "to": "column:table%3A%2FBounty/programId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 114 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Bounty", + "id": "contains:table%3A%2FBounty/column%3Atable%253A%252FBounty%2FrewardAmount/", + "kind": "contains", + "to": "column:table%3A%2FBounty/rewardAmount" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 115 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Bounty", + "id": "contains:table%3A%2FBounty/constraint%3Atable%253A%252FBounty%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/", + "kind": "contains", + "to": "constraint:table%3A%2FBounty/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 111 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Bounty", + "id": "contains:table%3A%2FBounty/constraint%3Atable%253A%252FBounty%2Fprimary-key%2F%255B%2522id%2522%255D/", + "kind": "contains", + "to": "constraint:table%3A%2FBounty/primary-key/%5B%22id%22%5D" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 121 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/BountySubmission", + "id": "contains:table%3A%2FBountySubmission/column%3Atable%253A%252FBountySubmission%2FbountyId/", + "kind": "contains", + "to": "column:table%3A%2FBountySubmission/bountyId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 120 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/BountySubmission", + "id": "contains:table%3A%2FBountySubmission/column%3Atable%253A%252FBountySubmission%2Fid/", + "kind": "contains", + "to": "column:table%3A%2FBountySubmission/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 122 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/BountySubmission", + "id": "contains:table%3A%2FBountySubmission/column%3Atable%253A%252FBountySubmission%2FpartnerId/", + "kind": "contains", + "to": "column:table%3A%2FBountySubmission/partnerId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 123 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/BountySubmission", + "id": "contains:table%3A%2FBountySubmission/column%3Atable%253A%252FBountySubmission%2Furl/", + "kind": "contains", + "to": "column:table%3A%2FBountySubmission/url" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 124 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/BountySubmission", + "id": "contains:table%3A%2FBountySubmission/constraint%3Atable%253A%252FBountySubmission%2Fforeign-key%2F%255B%2522bountyId%2522%255D%2Ftable%253A%252FBounty/", + "kind": "contains", + "to": "constraint:table%3A%2FBountySubmission/foreign-key/%5B%22bountyId%22%5D/table%3A%2FBounty" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 125 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/BountySubmission", + "id": "contains:table%3A%2FBountySubmission/constraint%3Atable%253A%252FBountySubmission%2Fforeign-key%2F%255B%2522partnerId%2522%255D%2Ftable%253A%252FPartner/", + "kind": "contains", + "to": "constraint:table%3A%2FBountySubmission/foreign-key/%5B%22partnerId%22%5D/table%3A%2FPartner" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 120 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/BountySubmission", + "id": "contains:table%3A%2FBountySubmission/constraint%3Atable%253A%252FBountySubmission%2Fprimary-key%2F%255B%2522id%2522%255D/", + "kind": "contains", + "to": "constraint:table%3A%2FBountySubmission/primary-key/%5B%22id%22%5D" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 148 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Campaign", + "id": "contains:table%3A%2FCampaign/column%3Atable%253A%252FCampaign%2Fbody/", + "kind": "contains", + "to": "column:table%3A%2FCampaign/body" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 145 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Campaign", + "id": "contains:table%3A%2FCampaign/column%3Atable%253A%252FCampaign%2Fid/", + "kind": "contains", + "to": "column:table%3A%2FCampaign/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 146 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Campaign", + "id": "contains:table%3A%2FCampaign/column%3Atable%253A%252FCampaign%2FprogramId/", + "kind": "contains", + "to": "column:table%3A%2FCampaign/programId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 147 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Campaign", + "id": "contains:table%3A%2FCampaign/column%3Atable%253A%252FCampaign%2Fsubject/", + "kind": "contains", + "to": "column:table%3A%2FCampaign/subject" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 149 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Campaign", + "id": "contains:table%3A%2FCampaign/constraint%3Atable%253A%252FCampaign%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/", + "kind": "contains", + "to": "constraint:table%3A%2FCampaign/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 145 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Campaign", + "id": "contains:table%3A%2FCampaign/constraint%3Atable%253A%252FCampaign%2Fprimary-key%2F%255B%2522id%2522%255D/", + "kind": "contains", + "to": "constraint:table%3A%2FCampaign/primary-key/%5B%22id%22%5D" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 92 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Commission", + "id": "contains:table%3A%2FCommission/column%3Atable%253A%252FCommission%2Famount/", + "kind": "contains", + "to": "column:table%3A%2FCommission/amount" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 88 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Commission", + "id": "contains:table%3A%2FCommission/column%3Atable%253A%252FCommission%2Fid/", + "kind": "contains", + "to": "column:table%3A%2FCommission/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 90 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Commission", + "id": "contains:table%3A%2FCommission/column%3Atable%253A%252FCommission%2FpartnerId/", + "kind": "contains", + "to": "column:table%3A%2FCommission/partnerId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 91 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Commission", + "id": "contains:table%3A%2FCommission/column%3Atable%253A%252FCommission%2FpayoutId/", + "kind": "contains", + "to": "column:table%3A%2FCommission/payoutId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 89 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Commission", + "id": "contains:table%3A%2FCommission/column%3Atable%253A%252FCommission%2FprogramId/", + "kind": "contains", + "to": "column:table%3A%2FCommission/programId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 93 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Commission", + "id": "contains:table%3A%2FCommission/column%3Atable%253A%252FCommission%2Fstatus/", + "kind": "contains", + "to": "column:table%3A%2FCommission/status" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 95 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Commission", + "id": "contains:table%3A%2FCommission/constraint%3Atable%253A%252FCommission%2Fforeign-key%2F%255B%2522partnerId%2522%255D%2Ftable%253A%252FPartner/", + "kind": "contains", + "to": "constraint:table%3A%2FCommission/foreign-key/%5B%22partnerId%22%5D/table%3A%2FPartner" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 96 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Commission", + "id": "contains:table%3A%2FCommission/constraint%3Atable%253A%252FCommission%2Fforeign-key%2F%255B%2522payoutId%2522%255D%2Ftable%253A%252FPayout/", + "kind": "contains", + "to": "constraint:table%3A%2FCommission/foreign-key/%5B%22payoutId%22%5D/table%3A%2FPayout" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 94 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Commission", + "id": "contains:table%3A%2FCommission/constraint%3Atable%253A%252FCommission%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/", + "kind": "contains", + "to": "constraint:table%3A%2FCommission/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 88 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Commission", + "id": "contains:table%3A%2FCommission/constraint%3Atable%253A%252FCommission%2Fprimary-key%2F%255B%2522id%2522%255D/", + "kind": "contains", + "to": "constraint:table%3A%2FCommission/primary-key/%5B%22id%22%5D" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 139 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Discount", + "id": "contains:table%3A%2FDiscount/column%3Atable%253A%252FDiscount%2Famount/", + "kind": "contains", + "to": "column:table%3A%2FDiscount/amount" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 140 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Discount", + "id": "contains:table%3A%2FDiscount/column%3Atable%253A%252FDiscount%2FcouponId/", + "kind": "contains", + "to": "column:table%3A%2FDiscount/couponId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 137 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Discount", + "id": "contains:table%3A%2FDiscount/column%3Atable%253A%252FDiscount%2Fid/", + "kind": "contains", + "to": "column:table%3A%2FDiscount/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 138 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Discount", + "id": "contains:table%3A%2FDiscount/column%3Atable%253A%252FDiscount%2FprogramId/", + "kind": "contains", + "to": "column:table%3A%2FDiscount/programId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 141 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Discount", + "id": "contains:table%3A%2FDiscount/constraint%3Atable%253A%252FDiscount%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/", + "kind": "contains", + "to": "constraint:table%3A%2FDiscount/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 137 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Discount", + "id": "contains:table%3A%2FDiscount/constraint%3Atable%253A%252FDiscount%2Fprimary-key%2F%255B%2522id%2522%255D/", + "kind": "contains", + "to": "constraint:table%3A%2FDiscount/primary-key/%5B%22id%22%5D" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 164 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/FraudAlert", + "id": "contains:table%3A%2FFraudAlert/column%3Atable%253A%252FFraudAlert%2Fid/", + "kind": "contains", + "to": "column:table%3A%2FFraudAlert/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 166 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/FraudAlert", + "id": "contains:table%3A%2FFraudAlert/column%3Atable%253A%252FFraudAlert%2FpartnerId/", + "kind": "contains", + "to": "column:table%3A%2FFraudAlert/partnerId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 165 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/FraudAlert", + "id": "contains:table%3A%2FFraudAlert/column%3Atable%253A%252FFraudAlert%2FprogramId/", + "kind": "contains", + "to": "column:table%3A%2FFraudAlert/programId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 167 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/FraudAlert", + "id": "contains:table%3A%2FFraudAlert/column%3Atable%253A%252FFraudAlert%2Freason/", + "kind": "contains", + "to": "column:table%3A%2FFraudAlert/reason" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 169 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/FraudAlert", + "id": "contains:table%3A%2FFraudAlert/constraint%3Atable%253A%252FFraudAlert%2Fforeign-key%2F%255B%2522partnerId%2522%255D%2Ftable%253A%252FPartner/", + "kind": "contains", + "to": "constraint:table%3A%2FFraudAlert/foreign-key/%5B%22partnerId%22%5D/table%3A%2FPartner" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 168 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/FraudAlert", + "id": "contains:table%3A%2FFraudAlert/constraint%3Atable%253A%252FFraudAlert%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/", + "kind": "contains", + "to": "constraint:table%3A%2FFraudAlert/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 164 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/FraudAlert", + "id": "contains:table%3A%2FFraudAlert/constraint%3Atable%253A%252FFraudAlert%2Fprimary-key%2F%255B%2522id%2522%255D/", + "kind": "contains", + "to": "constraint:table%3A%2FFraudAlert/primary-key/%5B%22id%22%5D" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 153 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Message", + "id": "contains:table%3A%2FMessage/column%3Atable%253A%252FMessage%2Fid/", + "kind": "contains", + "to": "column:table%3A%2FMessage/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 155 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Message", + "id": "contains:table%3A%2FMessage/column%3Atable%253A%252FMessage%2FpartnerId/", + "kind": "contains", + "to": "column:table%3A%2FMessage/partnerId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 154 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Message", + "id": "contains:table%3A%2FMessage/column%3Atable%253A%252FMessage%2FprogramId/", + "kind": "contains", + "to": "column:table%3A%2FMessage/programId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 156 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Message", + "id": "contains:table%3A%2FMessage/column%3Atable%253A%252FMessage%2FsenderUserId/", + "kind": "contains", + "to": "column:table%3A%2FMessage/senderUserId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 157 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Message", + "id": "contains:table%3A%2FMessage/column%3Atable%253A%252FMessage%2Ftext/", + "kind": "contains", + "to": "column:table%3A%2FMessage/text" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 159 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Message", + "id": "contains:table%3A%2FMessage/constraint%3Atable%253A%252FMessage%2Fforeign-key%2F%255B%2522partnerId%2522%255D%2Ftable%253A%252FPartner/", + "kind": "contains", + "to": "constraint:table%3A%2FMessage/foreign-key/%5B%22partnerId%22%5D/table%3A%2FPartner" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 158 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Message", + "id": "contains:table%3A%2FMessage/constraint%3Atable%253A%252FMessage%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/", + "kind": "contains", + "to": "constraint:table%3A%2FMessage/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 160 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Message", + "id": "contains:table%3A%2FMessage/constraint%3Atable%253A%252FMessage%2Fforeign-key%2F%255B%2522senderUserId%2522%255D%2Ftable%253A%252FUser/", + "kind": "contains", + "to": "constraint:table%3A%2FMessage/foreign-key/%5B%22senderUserId%22%5D/table%3A%2FUser" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 153 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Message", + "id": "contains:table%3A%2FMessage/constraint%3Atable%253A%252FMessage%2Fprimary-key%2F%255B%2522id%2522%255D/", + "kind": "contains", + "to": "constraint:table%3A%2FMessage/primary-key/%5B%22id%22%5D" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 53 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Partner", + "id": "contains:table%3A%2FPartner/column%3Atable%253A%252FPartner%2Fcountry/", + "kind": "contains", + "to": "column:table%3A%2FPartner/country" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 52 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Partner", + "id": "contains:table%3A%2FPartner/column%3Atable%253A%252FPartner%2Femail/", + "kind": "contains", + "to": "column:table%3A%2FPartner/email" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 50 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Partner", + "id": "contains:table%3A%2FPartner/column%3Atable%253A%252FPartner%2Fid/", + "kind": "contains", + "to": "column:table%3A%2FPartner/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 51 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Partner", + "id": "contains:table%3A%2FPartner/column%3Atable%253A%252FPartner%2Fname/", + "kind": "contains", + "to": "column:table%3A%2FPartner/name" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 50 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Partner", + "id": "contains:table%3A%2FPartner/constraint%3Atable%253A%252FPartner%2Fprimary-key%2F%255B%2522id%2522%255D/", + "kind": "contains", + "to": "constraint:table%3A%2FPartner/primary-key/%5B%22id%22%5D" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 52 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Partner", + "id": "contains:table%3A%2FPartner/constraint%3Atable%253A%252FPartner%2Funique%2F%255B%2522email%2522%255D/", + "kind": "contains", + "to": "constraint:table%3A%2FPartner/unique/%5B%22email%22%5D" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 82 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/PartnerInvite", + "id": "contains:table%3A%2FPartnerInvite/column%3Atable%253A%252FPartnerInvite%2Femail/", + "kind": "contains", + "to": "column:table%3A%2FPartnerInvite/email" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 83 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/PartnerInvite", + "id": "contains:table%3A%2FPartnerInvite/column%3Atable%253A%252FPartnerInvite%2FexpiresAt/", + "kind": "contains", + "to": "column:table%3A%2FPartnerInvite/expiresAt" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 80 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/PartnerInvite", + "id": "contains:table%3A%2FPartnerInvite/column%3Atable%253A%252FPartnerInvite%2Fid/", + "kind": "contains", + "to": "column:table%3A%2FPartnerInvite/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 81 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/PartnerInvite", + "id": "contains:table%3A%2FPartnerInvite/column%3Atable%253A%252FPartnerInvite%2FprogramId/", + "kind": "contains", + "to": "column:table%3A%2FPartnerInvite/programId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 84 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/PartnerInvite", + "id": "contains:table%3A%2FPartnerInvite/constraint%3Atable%253A%252FPartnerInvite%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/", + "kind": "contains", + "to": "constraint:table%3A%2FPartnerInvite/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 80 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/PartnerInvite", + "id": "contains:table%3A%2FPartnerInvite/constraint%3Atable%253A%252FPartnerInvite%2Fprimary-key%2F%255B%2522id%2522%255D/", + "kind": "contains", + "to": "constraint:table%3A%2FPartnerInvite/primary-key/%5B%22id%22%5D" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 103 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Payout", + "id": "contains:table%3A%2FPayout/column%3Atable%253A%252FPayout%2Famount/", + "kind": "contains", + "to": "column:table%3A%2FPayout/amount" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 100 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Payout", + "id": "contains:table%3A%2FPayout/column%3Atable%253A%252FPayout%2Fid/", + "kind": "contains", + "to": "column:table%3A%2FPayout/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 102 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Payout", + "id": "contains:table%3A%2FPayout/column%3Atable%253A%252FPayout%2FpartnerId/", + "kind": "contains", + "to": "column:table%3A%2FPayout/partnerId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 101 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Payout", + "id": "contains:table%3A%2FPayout/column%3Atable%253A%252FPayout%2FprogramId/", + "kind": "contains", + "to": "column:table%3A%2FPayout/programId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 104 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Payout", + "id": "contains:table%3A%2FPayout/column%3Atable%253A%252FPayout%2Fstatus/", + "kind": "contains", + "to": "column:table%3A%2FPayout/status" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 106 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Payout", + "id": "contains:table%3A%2FPayout/constraint%3Atable%253A%252FPayout%2Fforeign-key%2F%255B%2522partnerId%2522%255D%2Ftable%253A%252FPartner/", + "kind": "contains", + "to": "constraint:table%3A%2FPayout/foreign-key/%5B%22partnerId%22%5D/table%3A%2FPartner" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 105 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Payout", + "id": "contains:table%3A%2FPayout/constraint%3Atable%253A%252FPayout%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/", + "kind": "contains", + "to": "constraint:table%3A%2FPayout/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 100 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Payout", + "id": "contains:table%3A%2FPayout/constraint%3Atable%253A%252FPayout%2Fprimary-key%2F%255B%2522id%2522%255D/", + "kind": "contains", + "to": "constraint:table%3A%2FPayout/primary-key/%5B%22id%22%5D" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 34 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Program", + "id": "contains:table%3A%2FProgram/column%3Atable%253A%252FProgram%2Fdomain/", + "kind": "contains", + "to": "column:table%3A%2FProgram/domain" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 31 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Program", + "id": "contains:table%3A%2FProgram/column%3Atable%253A%252FProgram%2Fid/", + "kind": "contains", + "to": "column:table%3A%2FProgram/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 33 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Program", + "id": "contains:table%3A%2FProgram/column%3Atable%253A%252FProgram%2Fname/", + "kind": "contains", + "to": "column:table%3A%2FProgram/name" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 32 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Program", + "id": "contains:table%3A%2FProgram/column%3Atable%253A%252FProgram%2FworkspaceId/", + "kind": "contains", + "to": "column:table%3A%2FProgram/workspaceId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 35 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Program", + "id": "contains:table%3A%2FProgram/constraint%3Atable%253A%252FProgram%2Fforeign-key%2F%255B%2522workspaceId%2522%255D%2Ftable%253A%252FWorkspace/", + "kind": "contains", + "to": "constraint:table%3A%2FProgram/foreign-key/%5B%22workspaceId%22%5D/table%3A%2FWorkspace" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 31 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Program", + "id": "contains:table%3A%2FProgram/constraint%3Atable%253A%252FProgram%2Fprimary-key%2F%255B%2522id%2522%255D/", + "kind": "contains", + "to": "constraint:table%3A%2FProgram/primary-key/%5B%22id%22%5D" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 74 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/ProgramApplication", + "id": "contains:table%3A%2FProgramApplication/column%3Atable%253A%252FProgramApplication%2Femail/", + "kind": "contains", + "to": "column:table%3A%2FProgramApplication/email" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 72 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/ProgramApplication", + "id": "contains:table%3A%2FProgramApplication/column%3Atable%253A%252FProgramApplication%2Fid/", + "kind": "contains", + "to": "column:table%3A%2FProgramApplication/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 73 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/ProgramApplication", + "id": "contains:table%3A%2FProgramApplication/column%3Atable%253A%252FProgramApplication%2FprogramId/", + "kind": "contains", + "to": "column:table%3A%2FProgramApplication/programId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 75 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/ProgramApplication", + "id": "contains:table%3A%2FProgramApplication/column%3Atable%253A%252FProgramApplication%2Fwebsite/", + "kind": "contains", + "to": "column:table%3A%2FProgramApplication/website" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 76 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/ProgramApplication", + "id": "contains:table%3A%2FProgramApplication/constraint%3Atable%253A%252FProgramApplication%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/", + "kind": "contains", + "to": "constraint:table%3A%2FProgramApplication/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 72 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/ProgramApplication", + "id": "contains:table%3A%2FProgramApplication/constraint%3Atable%253A%252FProgramApplication%2Fprimary-key%2F%255B%2522id%2522%255D/", + "kind": "contains", + "to": "constraint:table%3A%2FProgramApplication/primary-key/%5B%22id%22%5D" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 63 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/ProgramEnrollment", + "id": "contains:table%3A%2FProgramEnrollment/column%3Atable%253A%252FProgramEnrollment%2Fid/", + "kind": "contains", + "to": "column:table%3A%2FProgramEnrollment/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 65 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/ProgramEnrollment", + "id": "contains:table%3A%2FProgramEnrollment/column%3Atable%253A%252FProgramEnrollment%2FpartnerId/", + "kind": "contains", + "to": "column:table%3A%2FProgramEnrollment/partnerId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 64 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/ProgramEnrollment", + "id": "contains:table%3A%2FProgramEnrollment/column%3Atable%253A%252FProgramEnrollment%2FprogramId/", + "kind": "contains", + "to": "column:table%3A%2FProgramEnrollment/programId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 66 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/ProgramEnrollment", + "id": "contains:table%3A%2FProgramEnrollment/column%3Atable%253A%252FProgramEnrollment%2Fstatus/", + "kind": "contains", + "to": "column:table%3A%2FProgramEnrollment/status" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 68 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/ProgramEnrollment", + "id": "contains:table%3A%2FProgramEnrollment/constraint%3Atable%253A%252FProgramEnrollment%2Fforeign-key%2F%255B%2522partnerId%2522%255D%2Ftable%253A%252FPartner/", + "kind": "contains", + "to": "constraint:table%3A%2FProgramEnrollment/foreign-key/%5B%22partnerId%22%5D/table%3A%2FPartner" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 67 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/ProgramEnrollment", + "id": "contains:table%3A%2FProgramEnrollment/constraint%3Atable%253A%252FProgramEnrollment%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/", + "kind": "contains", + "to": "constraint:table%3A%2FProgramEnrollment/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 63 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/ProgramEnrollment", + "id": "contains:table%3A%2FProgramEnrollment/constraint%3Atable%253A%252FProgramEnrollment%2Fprimary-key%2F%255B%2522id%2522%255D/", + "kind": "contains", + "to": "constraint:table%3A%2FProgramEnrollment/primary-key/%5B%22id%22%5D" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 132 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Reward", + "id": "contains:table%3A%2FReward/column%3Atable%253A%252FReward%2Famount/", + "kind": "contains", + "to": "column:table%3A%2FReward/amount" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 131 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Reward", + "id": "contains:table%3A%2FReward/column%3Atable%253A%252FReward%2Fevent/", + "kind": "contains", + "to": "column:table%3A%2FReward/event" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 129 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Reward", + "id": "contains:table%3A%2FReward/column%3Atable%253A%252FReward%2Fid/", + "kind": "contains", + "to": "column:table%3A%2FReward/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 130 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Reward", + "id": "contains:table%3A%2FReward/column%3Atable%253A%252FReward%2FprogramId/", + "kind": "contains", + "to": "column:table%3A%2FReward/programId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 133 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Reward", + "id": "contains:table%3A%2FReward/constraint%3Atable%253A%252FReward%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/", + "kind": "contains", + "to": "constraint:table%3A%2FReward/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 129 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Reward", + "id": "contains:table%3A%2FReward/constraint%3Atable%253A%252FReward%2Fprimary-key%2F%255B%2522id%2522%255D/", + "kind": "contains", + "to": "constraint:table%3A%2FReward/primary-key/%5B%22id%22%5D" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 24 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/User", + "id": "contains:table%3A%2FUser/column%3Atable%253A%252FUser%2Femail/", + "kind": "contains", + "to": "column:table%3A%2FUser/email" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 23 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/User", + "id": "contains:table%3A%2FUser/column%3Atable%253A%252FUser%2Fid/", + "kind": "contains", + "to": "column:table%3A%2FUser/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 25 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/User", + "id": "contains:table%3A%2FUser/column%3Atable%253A%252FUser%2FworkspaceId/", + "kind": "contains", + "to": "column:table%3A%2FUser/workspaceId" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 26 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/User", + "id": "contains:table%3A%2FUser/constraint%3Atable%253A%252FUser%2Fforeign-key%2F%255B%2522workspaceId%2522%255D%2Ftable%253A%252FWorkspace/", + "kind": "contains", + "to": "constraint:table%3A%2FUser/foreign-key/%5B%22workspaceId%22%5D/table%3A%2FWorkspace" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 23 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/User", + "id": "contains:table%3A%2FUser/constraint%3Atable%253A%252FUser%2Fprimary-key%2F%255B%2522id%2522%255D/", + "kind": "contains", + "to": "constraint:table%3A%2FUser/primary-key/%5B%22id%22%5D" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 24 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/User", + "id": "contains:table%3A%2FUser/constraint%3Atable%253A%252FUser%2Funique%2F%255B%2522email%2522%255D/", + "kind": "contains", + "to": "constraint:table%3A%2FUser/unique/%5B%22email%22%5D" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 17 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Workspace", + "id": "contains:table%3A%2FWorkspace/column%3Atable%253A%252FWorkspace%2FcreatedAt/", + "kind": "contains", + "to": "column:table%3A%2FWorkspace/createdAt" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 13 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Workspace", + "id": "contains:table%3A%2FWorkspace/column%3Atable%253A%252FWorkspace%2Fid/", + "kind": "contains", + "to": "column:table%3A%2FWorkspace/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 14 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Workspace", + "id": "contains:table%3A%2FWorkspace/column%3Atable%253A%252FWorkspace%2Fname/", + "kind": "contains", + "to": "column:table%3A%2FWorkspace/name" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 16 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Workspace", + "id": "contains:table%3A%2FWorkspace/column%3Atable%253A%252FWorkspace%2FpartnersEnabled/", + "kind": "contains", + "to": "column:table%3A%2FWorkspace/partnersEnabled" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 15 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Workspace", + "id": "contains:table%3A%2FWorkspace/column%3Atable%253A%252FWorkspace%2Fslug/", + "kind": "contains", + "to": "column:table%3A%2FWorkspace/slug" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 13 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Workspace", + "id": "contains:table%3A%2FWorkspace/constraint%3Atable%253A%252FWorkspace%2Fprimary-key%2F%255B%2522id%2522%255D/", + "kind": "contains", + "to": "constraint:table%3A%2FWorkspace/primary-key/%5B%22id%22%5D" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 15 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "table:/Workspace", + "id": "contains:table%3A%2FWorkspace/constraint%3Atable%253A%252FWorkspace%2Funique%2F%255B%2522slug%2522%255D/", + "kind": "contains", + "to": "constraint:table%3A%2FWorkspace/unique/%5B%22slug%22%5D" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 93 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "column:table%3A%2FCommission/status", + "id": "enum-type:column%3Atable%253A%252FCommission%2Fstatus/enum%3ACommissionStatus/", + "kind": "enum-type", + "to": "enum:CommissionStatus" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 104 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "column:table%3A%2FPayout/status", + "id": "enum-type:column%3Atable%253A%252FPayout%2Fstatus/enum%3APayoutStatus/", + "kind": "enum-type", + "to": "enum:PayoutStatus" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 66 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "column:table%3A%2FProgramEnrollment/status", + "id": "enum-type:column%3Atable%253A%252FProgramEnrollment%2Fstatus/enum%3ACommissionStatus/", + "kind": "enum-type", + "to": "enum:CommissionStatus" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 115 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "column:table%3A%2FBounty/programId", + "id": "foreign-key:column%3Atable%253A%252FBounty%2FprogramId/column%3Atable%253A%252FProgram%2Fid/constraint%3Atable%253A%252FBounty%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram", + "kind": "foreign-key", + "to": "column:table%3A%2FProgram/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 124 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "column:table%3A%2FBountySubmission/bountyId", + "id": "foreign-key:column%3Atable%253A%252FBountySubmission%2FbountyId/column%3Atable%253A%252FBounty%2Fid/constraint%3Atable%253A%252FBountySubmission%2Fforeign-key%2F%255B%2522bountyId%2522%255D%2Ftable%253A%252FBounty", + "kind": "foreign-key", + "to": "column:table%3A%2FBounty/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 125 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "column:table%3A%2FBountySubmission/partnerId", + "id": "foreign-key:column%3Atable%253A%252FBountySubmission%2FpartnerId/column%3Atable%253A%252FPartner%2Fid/constraint%3Atable%253A%252FBountySubmission%2Fforeign-key%2F%255B%2522partnerId%2522%255D%2Ftable%253A%252FPartner", + "kind": "foreign-key", + "to": "column:table%3A%2FPartner/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 149 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "column:table%3A%2FCampaign/programId", + "id": "foreign-key:column%3Atable%253A%252FCampaign%2FprogramId/column%3Atable%253A%252FProgram%2Fid/constraint%3Atable%253A%252FCampaign%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram", + "kind": "foreign-key", + "to": "column:table%3A%2FProgram/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 95 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "column:table%3A%2FCommission/partnerId", + "id": "foreign-key:column%3Atable%253A%252FCommission%2FpartnerId/column%3Atable%253A%252FPartner%2Fid/constraint%3Atable%253A%252FCommission%2Fforeign-key%2F%255B%2522partnerId%2522%255D%2Ftable%253A%252FPartner", + "kind": "foreign-key", + "to": "column:table%3A%2FPartner/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 96 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "column:table%3A%2FCommission/payoutId", + "id": "foreign-key:column%3Atable%253A%252FCommission%2FpayoutId/column%3Atable%253A%252FPayout%2Fid/constraint%3Atable%253A%252FCommission%2Fforeign-key%2F%255B%2522payoutId%2522%255D%2Ftable%253A%252FPayout", + "kind": "foreign-key", + "to": "column:table%3A%2FPayout/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 94 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "column:table%3A%2FCommission/programId", + "id": "foreign-key:column%3Atable%253A%252FCommission%2FprogramId/column%3Atable%253A%252FProgram%2Fid/constraint%3Atable%253A%252FCommission%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram", + "kind": "foreign-key", + "to": "column:table%3A%2FProgram/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 141 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "column:table%3A%2FDiscount/programId", + "id": "foreign-key:column%3Atable%253A%252FDiscount%2FprogramId/column%3Atable%253A%252FProgram%2Fid/constraint%3Atable%253A%252FDiscount%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram", + "kind": "foreign-key", + "to": "column:table%3A%2FProgram/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 169 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "column:table%3A%2FFraudAlert/partnerId", + "id": "foreign-key:column%3Atable%253A%252FFraudAlert%2FpartnerId/column%3Atable%253A%252FPartner%2Fid/constraint%3Atable%253A%252FFraudAlert%2Fforeign-key%2F%255B%2522partnerId%2522%255D%2Ftable%253A%252FPartner", + "kind": "foreign-key", + "to": "column:table%3A%2FPartner/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 168 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "column:table%3A%2FFraudAlert/programId", + "id": "foreign-key:column%3Atable%253A%252FFraudAlert%2FprogramId/column%3Atable%253A%252FProgram%2Fid/constraint%3Atable%253A%252FFraudAlert%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram", + "kind": "foreign-key", + "to": "column:table%3A%2FProgram/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 159 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "column:table%3A%2FMessage/partnerId", + "id": "foreign-key:column%3Atable%253A%252FMessage%2FpartnerId/column%3Atable%253A%252FPartner%2Fid/constraint%3Atable%253A%252FMessage%2Fforeign-key%2F%255B%2522partnerId%2522%255D%2Ftable%253A%252FPartner", + "kind": "foreign-key", + "to": "column:table%3A%2FPartner/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 158 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "column:table%3A%2FMessage/programId", + "id": "foreign-key:column%3Atable%253A%252FMessage%2FprogramId/column%3Atable%253A%252FProgram%2Fid/constraint%3Atable%253A%252FMessage%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram", + "kind": "foreign-key", + "to": "column:table%3A%2FProgram/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 160 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "column:table%3A%2FMessage/senderUserId", + "id": "foreign-key:column%3Atable%253A%252FMessage%2FsenderUserId/column%3Atable%253A%252FUser%2Fid/constraint%3Atable%253A%252FMessage%2Fforeign-key%2F%255B%2522senderUserId%2522%255D%2Ftable%253A%252FUser", + "kind": "foreign-key", + "to": "column:table%3A%2FUser/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 84 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "column:table%3A%2FPartnerInvite/programId", + "id": "foreign-key:column%3Atable%253A%252FPartnerInvite%2FprogramId/column%3Atable%253A%252FProgram%2Fid/constraint%3Atable%253A%252FPartnerInvite%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram", + "kind": "foreign-key", + "to": "column:table%3A%2FProgram/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 106 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "column:table%3A%2FPayout/partnerId", + "id": "foreign-key:column%3Atable%253A%252FPayout%2FpartnerId/column%3Atable%253A%252FPartner%2Fid/constraint%3Atable%253A%252FPayout%2Fforeign-key%2F%255B%2522partnerId%2522%255D%2Ftable%253A%252FPartner", + "kind": "foreign-key", + "to": "column:table%3A%2FPartner/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 105 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "column:table%3A%2FPayout/programId", + "id": "foreign-key:column%3Atable%253A%252FPayout%2FprogramId/column%3Atable%253A%252FProgram%2Fid/constraint%3Atable%253A%252FPayout%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram", + "kind": "foreign-key", + "to": "column:table%3A%2FProgram/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 35 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "column:table%3A%2FProgram/workspaceId", + "id": "foreign-key:column%3Atable%253A%252FProgram%2FworkspaceId/column%3Atable%253A%252FWorkspace%2Fid/constraint%3Atable%253A%252FProgram%2Fforeign-key%2F%255B%2522workspaceId%2522%255D%2Ftable%253A%252FWorkspace", + "kind": "foreign-key", + "to": "column:table%3A%2FWorkspace/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 76 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "column:table%3A%2FProgramApplication/programId", + "id": "foreign-key:column%3Atable%253A%252FProgramApplication%2FprogramId/column%3Atable%253A%252FProgram%2Fid/constraint%3Atable%253A%252FProgramApplication%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram", + "kind": "foreign-key", + "to": "column:table%3A%2FProgram/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 68 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "column:table%3A%2FProgramEnrollment/partnerId", + "id": "foreign-key:column%3Atable%253A%252FProgramEnrollment%2FpartnerId/column%3Atable%253A%252FPartner%2Fid/constraint%3Atable%253A%252FProgramEnrollment%2Fforeign-key%2F%255B%2522partnerId%2522%255D%2Ftable%253A%252FPartner", + "kind": "foreign-key", + "to": "column:table%3A%2FPartner/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 67 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "column:table%3A%2FProgramEnrollment/programId", + "id": "foreign-key:column%3Atable%253A%252FProgramEnrollment%2FprogramId/column%3Atable%253A%252FProgram%2Fid/constraint%3Atable%253A%252FProgramEnrollment%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram", + "kind": "foreign-key", + "to": "column:table%3A%2FProgram/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 133 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "column:table%3A%2FReward/programId", + "id": "foreign-key:column%3Atable%253A%252FReward%2FprogramId/column%3Atable%253A%252FProgram%2Fid/constraint%3Atable%253A%252FReward%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram", + "kind": "foreign-key", + "to": "column:table%3A%2FProgram/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 26 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "column:table%3A%2FUser/workspaceId", + "id": "foreign-key:column%3Atable%253A%252FUser%2FworkspaceId/column%3Atable%253A%252FWorkspace%2Fid/constraint%3Atable%253A%252FUser%2Fforeign-key%2F%255B%2522workspaceId%2522%255D%2Ftable%253A%252FWorkspace", + "kind": "foreign-key", + "to": "column:table%3A%2FWorkspace/id" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 115 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FBounty/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "id": "references:constraint%3Atable%253A%252FBounty%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/table%3A%2FProgram/", + "kind": "references", + "to": "table:/Program" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 124 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FBountySubmission/foreign-key/%5B%22bountyId%22%5D/table%3A%2FBounty", + "id": "references:constraint%3Atable%253A%252FBountySubmission%2Fforeign-key%2F%255B%2522bountyId%2522%255D%2Ftable%253A%252FBounty/table%3A%2FBounty/", + "kind": "references", + "to": "table:/Bounty" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 125 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FBountySubmission/foreign-key/%5B%22partnerId%22%5D/table%3A%2FPartner", + "id": "references:constraint%3Atable%253A%252FBountySubmission%2Fforeign-key%2F%255B%2522partnerId%2522%255D%2Ftable%253A%252FPartner/table%3A%2FPartner/", + "kind": "references", + "to": "table:/Partner" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 149 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FCampaign/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "id": "references:constraint%3Atable%253A%252FCampaign%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/table%3A%2FProgram/", + "kind": "references", + "to": "table:/Program" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 95 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FCommission/foreign-key/%5B%22partnerId%22%5D/table%3A%2FPartner", + "id": "references:constraint%3Atable%253A%252FCommission%2Fforeign-key%2F%255B%2522partnerId%2522%255D%2Ftable%253A%252FPartner/table%3A%2FPartner/", + "kind": "references", + "to": "table:/Partner" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 96 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FCommission/foreign-key/%5B%22payoutId%22%5D/table%3A%2FPayout", + "id": "references:constraint%3Atable%253A%252FCommission%2Fforeign-key%2F%255B%2522payoutId%2522%255D%2Ftable%253A%252FPayout/table%3A%2FPayout/", + "kind": "references", + "to": "table:/Payout" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 94 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FCommission/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "id": "references:constraint%3Atable%253A%252FCommission%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/table%3A%2FProgram/", + "kind": "references", + "to": "table:/Program" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 141 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FDiscount/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "id": "references:constraint%3Atable%253A%252FDiscount%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/table%3A%2FProgram/", + "kind": "references", + "to": "table:/Program" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 169 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FFraudAlert/foreign-key/%5B%22partnerId%22%5D/table%3A%2FPartner", + "id": "references:constraint%3Atable%253A%252FFraudAlert%2Fforeign-key%2F%255B%2522partnerId%2522%255D%2Ftable%253A%252FPartner/table%3A%2FPartner/", + "kind": "references", + "to": "table:/Partner" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 168 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FFraudAlert/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "id": "references:constraint%3Atable%253A%252FFraudAlert%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/table%3A%2FProgram/", + "kind": "references", + "to": "table:/Program" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 159 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FMessage/foreign-key/%5B%22partnerId%22%5D/table%3A%2FPartner", + "id": "references:constraint%3Atable%253A%252FMessage%2Fforeign-key%2F%255B%2522partnerId%2522%255D%2Ftable%253A%252FPartner/table%3A%2FPartner/", + "kind": "references", + "to": "table:/Partner" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 158 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FMessage/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "id": "references:constraint%3Atable%253A%252FMessage%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/table%3A%2FProgram/", + "kind": "references", + "to": "table:/Program" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 160 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FMessage/foreign-key/%5B%22senderUserId%22%5D/table%3A%2FUser", + "id": "references:constraint%3Atable%253A%252FMessage%2Fforeign-key%2F%255B%2522senderUserId%2522%255D%2Ftable%253A%252FUser/table%3A%2FUser/", + "kind": "references", + "to": "table:/User" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 84 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FPartnerInvite/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "id": "references:constraint%3Atable%253A%252FPartnerInvite%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/table%3A%2FProgram/", + "kind": "references", + "to": "table:/Program" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 106 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FPayout/foreign-key/%5B%22partnerId%22%5D/table%3A%2FPartner", + "id": "references:constraint%3Atable%253A%252FPayout%2Fforeign-key%2F%255B%2522partnerId%2522%255D%2Ftable%253A%252FPartner/table%3A%2FPartner/", + "kind": "references", + "to": "table:/Partner" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 105 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FPayout/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "id": "references:constraint%3Atable%253A%252FPayout%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/table%3A%2FProgram/", + "kind": "references", + "to": "table:/Program" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 35 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FProgram/foreign-key/%5B%22workspaceId%22%5D/table%3A%2FWorkspace", + "id": "references:constraint%3Atable%253A%252FProgram%2Fforeign-key%2F%255B%2522workspaceId%2522%255D%2Ftable%253A%252FWorkspace/table%3A%2FWorkspace/", + "kind": "references", + "to": "table:/Workspace" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 76 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FProgramApplication/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "id": "references:constraint%3Atable%253A%252FProgramApplication%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/table%3A%2FProgram/", + "kind": "references", + "to": "table:/Program" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 68 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FProgramEnrollment/foreign-key/%5B%22partnerId%22%5D/table%3A%2FPartner", + "id": "references:constraint%3Atable%253A%252FProgramEnrollment%2Fforeign-key%2F%255B%2522partnerId%2522%255D%2Ftable%253A%252FPartner/table%3A%2FPartner/", + "kind": "references", + "to": "table:/Partner" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 67 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FProgramEnrollment/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "id": "references:constraint%3Atable%253A%252FProgramEnrollment%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/table%3A%2FProgram/", + "kind": "references", + "to": "table:/Program" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 133 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FReward/foreign-key/%5B%22programId%22%5D/table%3A%2FProgram", + "id": "references:constraint%3Atable%253A%252FReward%2Fforeign-key%2F%255B%2522programId%2522%255D%2Ftable%253A%252FProgram/table%3A%2FProgram/", + "kind": "references", + "to": "table:/Program" + }, + { + "confidence": "authoritative", + "data": {}, + "evidence": [ + { + "kind": "prisma-schema", + "location": { + "line": 26 + }, + "source": "prisma/schema.prisma" + } + ], + "from": "constraint:table%3A%2FUser/foreign-key/%5B%22workspaceId%22%5D/table%3A%2FWorkspace", + "id": "references:constraint%3Atable%253A%252FUser%2Fforeign-key%2F%255B%2522workspaceId%2522%255D%2Ftable%253A%252FWorkspace/table%3A%2FWorkspace/", + "kind": "references", + "to": "table:/Workspace" + } + ], + "schema": "database/v0" +} diff --git a/packages/renderers/database/fixtures/prisma-partners/after/prisma/schema.prisma b/packages/renderers/database/fixtures/prisma-partners/after/prisma/schema.prisma new file mode 100644 index 000000000..c6cf82e36 --- /dev/null +++ b/packages/renderers/database/fixtures/prisma-partners/after/prisma/schema.prisma @@ -0,0 +1,25 @@ +datasource db { + provider = "postgresql" + url = env("DATABASE_URL") +} + +generator client { + provider = "prisma-client-js" +} + +// A link shortener's workspaces and users, once its partner program is retired. + +model Workspace { + id String @id @default(cuid()) + name String + slug String @unique + createdAt DateTime @default(now()) + users User[] +} + +model User { + id String @id @default(cuid()) + email String @unique + workspaceId String + workspace Workspace @relation(fields: [workspaceId], references: [id]) +} diff --git a/packages/renderers/database/fixtures/prisma-partners/before/prisma/schema.prisma b/packages/renderers/database/fixtures/prisma-partners/before/prisma/schema.prisma new file mode 100644 index 000000000..32b9b3314 --- /dev/null +++ b/packages/renderers/database/fixtures/prisma-partners/before/prisma/schema.prisma @@ -0,0 +1,182 @@ +datasource db { + provider = "postgresql" + url = env("DATABASE_URL") +} + +generator client { + provider = "prisma-client-js" +} + +// A link shortener's workspaces and users, with the partner program it later retires. + +model Workspace { + id String @id @default(cuid()) + name String + slug String @unique + partnersEnabled Boolean @default(false) + createdAt DateTime @default(now()) + users User[] + programWorkspaces Program[] @relation("ProgramWorkspace") +} + +model User { + id String @id @default(cuid()) + email String @unique + workspaceId String + workspace Workspace @relation(fields: [workspaceId], references: [id]) + messageSenderUsers Message[] @relation("MessageSenderUser") +} + +model Program { + id String @id @default(cuid()) + workspaceId String + name String + domain String? + workspace Workspace @relation("ProgramWorkspace", fields: [workspaceId], references: [id]) + programEnrollmentPrograms ProgramEnrollment[] @relation("ProgramEnrollmentProgram") + programApplicationPrograms ProgramApplication[] @relation("ProgramApplicationProgram") + partnerInvitePrograms PartnerInvite[] @relation("PartnerInviteProgram") + commissionPrograms Commission[] @relation("CommissionProgram") + payoutPrograms Payout[] @relation("PayoutProgram") + bountyPrograms Bounty[] @relation("BountyProgram") + rewardPrograms Reward[] @relation("RewardProgram") + discountPrograms Discount[] @relation("DiscountProgram") + campaignPrograms Campaign[] @relation("CampaignProgram") + messagePrograms Message[] @relation("MessageProgram") + fraudAlertPrograms FraudAlert[] @relation("FraudAlertProgram") +} + +model Partner { + id String @id @default(cuid()) + name String + email String @unique + country String? + programEnrollmentPartners ProgramEnrollment[] @relation("ProgramEnrollmentPartner") + commissionPartners Commission[] @relation("CommissionPartner") + payoutPartners Payout[] @relation("PayoutPartner") + bountySubmissionPartners BountySubmission[] @relation("BountySubmissionPartner") + messagePartners Message[] @relation("MessagePartner") + fraudAlertPartners FraudAlert[] @relation("FraudAlertPartner") +} + +model ProgramEnrollment { + id String @id @default(cuid()) + programId String + partnerId String + status CommissionStatus + program Program @relation("ProgramEnrollmentProgram", fields: [programId], references: [id]) + partner Partner @relation("ProgramEnrollmentPartner", fields: [partnerId], references: [id]) +} + +model ProgramApplication { + id String @id @default(cuid()) + programId String + email String + website String? + program Program @relation("ProgramApplicationProgram", fields: [programId], references: [id]) +} + +model PartnerInvite { + id String @id @default(cuid()) + programId String + email String + expiresAt DateTime + program Program @relation("PartnerInviteProgram", fields: [programId], references: [id]) +} + +model Commission { + id String @id @default(cuid()) + programId String + partnerId String + payoutId String? + amount Int + status CommissionStatus + program Program @relation("CommissionProgram", fields: [programId], references: [id]) + partner Partner @relation("CommissionPartner", fields: [partnerId], references: [id]) + payout Payout? @relation("CommissionPayout", fields: [payoutId], references: [id]) +} + +model Payout { + id String @id @default(cuid()) + programId String + partnerId String + amount Int + status PayoutStatus + program Program @relation("PayoutProgram", fields: [programId], references: [id]) + partner Partner @relation("PayoutPartner", fields: [partnerId], references: [id]) + commissionPayouts Commission[] @relation("CommissionPayout") +} + +model Bounty { + id String @id @default(cuid()) + programId String + name String + rewardAmount Int + program Program @relation("BountyProgram", fields: [programId], references: [id]) + bountySubmissionBountys BountySubmission[] @relation("BountySubmissionBounty") +} + +model BountySubmission { + id String @id @default(cuid()) + bountyId String + partnerId String + url String + bounty Bounty @relation("BountySubmissionBounty", fields: [bountyId], references: [id]) + partner Partner @relation("BountySubmissionPartner", fields: [partnerId], references: [id]) +} + +model Reward { + id String @id @default(cuid()) + programId String + event String + amount Int + program Program @relation("RewardProgram", fields: [programId], references: [id]) +} + +model Discount { + id String @id @default(cuid()) + programId String + amount Int + couponId String? + program Program @relation("DiscountProgram", fields: [programId], references: [id]) +} + +model Campaign { + id String @id @default(cuid()) + programId String + subject String + body String + program Program @relation("CampaignProgram", fields: [programId], references: [id]) +} + +model Message { + id String @id @default(cuid()) + programId String + partnerId String + senderUserId String + text String + program Program @relation("MessageProgram", fields: [programId], references: [id]) + partner Partner @relation("MessagePartner", fields: [partnerId], references: [id]) + senderUser User @relation("MessageSenderUser", fields: [senderUserId], references: [id]) +} + +model FraudAlert { + id String @id @default(cuid()) + programId String + partnerId String + reason String + program Program @relation("FraudAlertProgram", fields: [programId], references: [id]) + partner Partner @relation("FraudAlertPartner", fields: [partnerId], references: [id]) +} + +enum CommissionStatus { + pending + processed + paid +} + +enum PayoutStatus { + pending + sent + failed +} diff --git a/packages/renderers/database/scenarios.json b/packages/renderers/database/scenarios.json index 7ada8cf5c..5a0e7f48c 100644 --- a/packages/renderers/database/scenarios.json +++ b/packages/renderers/database/scenarios.json @@ -32,6 +32,13 @@ "before": "fixtures/prisma-licensing-before.json", "after": "fixtures/prisma-licensing-after.json" }, + { + "id": "prisma-partners", + "title": "Prisma: a partner program retired", + "description": "A link shortener retires its partner program: 14 tables and 2 enums leave together, and workspaces lose their partnersEnabled flag. A dozen or more tables removed together fold into one card, 14 tables removed, that opens in place; their foreign keys to workspaces and users are drawn once from it.", + "before": "fixtures/prisma-partners-before.json", + "after": "fixtures/prisma-partners-after.json" + }, { "id": "extensions", "title": "Postgres extensions beside the tables", diff --git a/packages/renderers/database/src/schema-links.ts b/packages/renderers/database/src/schema-links.ts index 14b8f38c6..c079c00c3 100644 --- a/packages/renderers/database/src/schema-links.ts +++ b/packages/renderers/database/src/schema-links.ts @@ -36,6 +36,8 @@ export function linksOf(state: SchemaState, {nodes, tableSet, tableOf, columnNam if (isEnum(nodes.get(edge.to)) && (tableOf.has(edge.from) || tableSet.has(edge.from))) { // A column typed by an enum links to the enum's card. if (tableOf.has(edge.from)) addLink(edge.id, tableOf.get(edge.from)!, edge.to, edge.from, undefined, 'enum') + // A fold of tables types its tables' columns: the link runs from its header. + else if (isMassFold(edge.from)) addLink(edge.id, edge.from, edge.to, undefined, undefined, 'enum') continue } if (edge.kind === 'many-to-many') { diff --git a/packages/renderers/database/test/mass-fold.test.mjs b/packages/renderers/database/test/mass-fold.test.mjs new file mode 100644 index 000000000..2eb0d065c --- /dev/null +++ b/packages/renderers/database/test/mass-fold.test.mjs @@ -0,0 +1,123 @@ +import {test} from 'node:test' +import assert from 'node:assert/strict' +import {readFileSync} from 'node:fs' +import {createElement} from 'react' +import {renderToStaticMarkup} from 'react-dom/server' +import {createNativeEngine} from '@githubnext/projections-engine/native' +import {comparisonModel, foldMassChanges, massFoldPrefix} from '@githubnext/projections-renderer-kit' +// `npm test` compiles src/ (without the browser entry) to this cache directory first. +import {createDatabaseDiff} from '../node_modules/.cache/test/diff.js' +import {DatabaseRenderer} from '../node_modules/.cache/test/view.js' + +const noop = () => undefined +const engine = createNativeEngine() +const load = name => JSON.parse(readFileSync(new URL(`../fixtures/${name}`, import.meta.url), 'utf8')) +const before = load('prisma-partners-before.json'), + after = load('prisma-partners-after.json') +const model = comparisonModel(before, after, await engine.compare(before, after)) +const fold = `${massFoldPrefix}removed:table:` +const noun = kind => ({singular: kind, plural: kind === 'index' ? 'indexes' : `${kind}s`}) + +test('tables removed together are drawn as one header-only card, their foreign keys once from it', () => { + const whole = createDatabaseDiff(model, {available: 1300}).frame + const {frame} = createDatabaseDiff(foldMassChanges(model, {noun}).model, {available: 1300}) + const tables = frame.tables.map(table => table.change.id) + // Two enums leave too: fewer than a dozen, so each keeps its own card. + assert.deepEqual(tables.toSorted(), ['enum:CommissionStatus', 'enum:PayoutStatus', fold, 'table:/User', 'table:/Workspace'].toSorted()) + const card = frame.tables.find(table => table.change.id === fold) + assert.equal(card.entity.label, '14 tables removed') + assert.equal(card.columns.length, 0) + assert.ok(card.box.height < card.header + 4, `a fold is its header alone: ${card.box.height}`) + assert.ok(frame.height * 3 < whole.height, `${frame.height} against ${whole.height}`) + // Program's foreign key to Workspace and Message's to User, each drawn once from the card's header to the key column. + // The columns they hold typed by the enums, each drawn once from the header too. + const links = frame.links.filter(link => link.dependent === fold) + assert.deepEqual(links.map(link => [link.principal, link.principalColumn, link.dependentColumn, link.type]).toSorted(), [ + ['enum:CommissionStatus', undefined, undefined, 'enum'], + ['enum:PayoutStatus', undefined, undefined, 'enum'], + ['table:/User', 'column:table%3A%2FUser/id', undefined, undefined], + ['table:/Workspace', 'column:table%3A%2FWorkspace/id', undefined, undefined], + ]) +}) + +const render = (props = {}) => + renderToStaticMarkup( + createElement(DatabaseRenderer, { + init: {}, + model, + direction: 1, + onOpen: noop, + reportSteps: noop, + declareControls: noop, + onAction: () => noop, + viewport: undefined, + schedule: [], + progress: 1, + highlighting: 1, + emphasis: item => (item.status === 'unchanged' ? 0 : 1), + comparing: true, + diff: true, + selectedId: null, + hoveredId: null, + onSelect: noop, + controls: {}, + options: {}, + reducedMotion: true, + locale: 'en', + rendererName: 'database', + ...props, + }), + ) + +test("a fold's card presents its tables to the host, in the removed style, and opens as an action", () => { + const html = render() + const card = html.match(new RegExp(`]*data-entity-id="${fold}"[^>]*>`, 'u'))?.[0] + assert.ok(card, 'the fold is drawn as a card') + assert.match(card, /data-fold="closed"/u) + assert.match(card, /data-projections-action=""/u) + assert.match(card, /data-change="removed"/u) + const aliases = JSON.parse(card.match(/data-entity-aliases="([^"]*)"/u)[1].replaceAll('"', '"')) + for (const id of ['table:/Program', 'table:/FraudAlert', 'column:table%3A%2FCommission/amount']) assert.ok(aliases.includes(id), id) + assert.ok(html.includes('>14 tables removed<')) + assert.ok(!html.includes('data-entity-id="table:/Program"'), 'a folded table draws no card of its own') + // The host's selection of a folded table is shown on the card. + assert.match( + render({selectedId: 'table:/Program'}), + new RegExp(`class="[^"]*database-mass-fold selected"[^>]*data-entity-id="${fold}"`, 'u'), + ) + // A single revision folds nothing. + assert.ok(!render({comparing: false, diff: false}).includes(massFoldPrefix)) +}) + +test('columns and indexes removed together from a table that stays fold into one row each, after its other rows', async () => { + const extraction = extra => { + const entities = [ + {id: 'table:Links', kind: 'table', label: 'Links'}, + {id: 'column:Links.id', kind: 'column', label: 'id', data: {type: 'uuid', primaryKey: true}}, + ] + const relationships = [{id: 'contains:Links.id', kind: 'contains', from: 'table:Links', to: 'column:Links.id'}] + if (extra) { + for (let index = 0; index < 13; index++) { + const column = `column:Links.tracked${index}` + const key = `index:IX_Links_tracked${index}` + entities.push({id: column, kind: 'column', label: `tracked${index}`, data: {type: 'text'}}) + entities.push({id: key, kind: 'index', label: `IX_Links_tracked${index}`, data: {columns: [`tracked${index}`]}}) + relationships.push({id: `contains:${column}`, kind: 'contains', from: 'table:Links', to: column}) + relationships.push({id: `index:${key}`, kind: 'index', from: 'table:Links', to: key}) + } + } + return {protocolVersion: 0, schema: 'database/v0', entities, relationships} + } + const [from, to] = [extraction(true), extraction(false)] + const folded = foldMassChanges(comparisonModel(from, to, await engine.compare(from, to)), {noun}) + const {frame} = createDatabaseDiff(folded.model, {available: 1300}) + const [table] = frame.tables + assert.deepEqual( + table.columns.map(row => [row.change.id, row.entity.label]), + [ + ['column:Links.id', 'id'], + [`${massFoldPrefix}removed:column:table:Links`, '13 columns removed'], + [`${massFoldPrefix}removed:index:table:Links`, '13 indexes removed'], + ], + ) +}) From 7982bdb1346f4a7fe3cce317754dd6c4dd1a3e71 Mon Sep 17 00:00:00 2001 From: agorischek <6295280+agorischek@users.noreply.github.com> Date: Fri, 4 Dec 2026 23:27:12 +0000 Subject: [PATCH 3/4] Docs: regenerate the renderer kit reference for mass folds Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --- docs/reference/renderer-kit.md | 169 ++++++++++++++++++++++++++++++++- 1 file changed, 165 insertions(+), 4 deletions(-) diff --git a/docs/reference/renderer-kit.md b/docs/reference/renderer-kit.md index a2089ed36..2b46e2c43 100644 --- a/docs/reference/renderer-kit.md +++ b/docs/reference/renderer-kit.md @@ -1623,6 +1623,30 @@ A list with every run of items `shown` leaves out folded into one entry, keyed b names is listed after its fold, `open`. A run of one item stays, as its fold would take as much room. Every item is shown when `shown` is undefined. Fold the union of a comparison (or each pane's list in the union's order) so both revisions fold alike. +### `foldMassChanges` + +```ts +foldMassChanges(model: ComparisonModel, options?: MassFoldOptions): MassFolded +``` + +Folds every run of `minimum` or more sibling items removed together, or added together, into one card: items of +one kind with the same status in the same container (or at the top level, outside any) when the container itself +stays. The card takes their kind and status, so it is drawn in the removed (or added) style, and counts them with the +definition's noun (`48 tables removed`). It stands for the items, the parts they contain and the relationships among +them; a relationship from one of them to an item that stays is drawn once from the card, for each item, kind and +direction. Steps place the card and its links in the first step that changes what they stand for. A fold in `open` +draws its items, and its card stays, labeled `Hide 48 removed tables`, as the way to fold them again. A model with no +such run is returned as it is. + +### `foldMassSteps` + +```ts +foldMassSteps(steps: Array, folding: Pick, "folded" | "folds" | "stands">): Array +``` + +Steps (a model's, or a schedule) with a fold's cards and links in place of what they stand for: each in the first +step that changes any of it, and in no other. A step left with nothing keeps its place, so timing doesn't move. + ### `foldPrefix` ```ts @@ -1951,6 +1975,14 @@ isKind(change: EntityChange, ...kinds: Array): false | true Whether either version of the row has one of `kinds`, so a row that changed kind matches both. +### `isMassFold` + +```ts +isMassFold(id: string): false | true +``` + +Whether an item is a card or link `foldMassChanges` adds. + ### `isSortable` ```ts @@ -2005,6 +2037,15 @@ kindNote(kind: KindLineText | undefined, inferred: false | true): string The note after a kind line (the renderer's, then `Inferred`), or nothing. +### `kindNoun` + +```ts +kindNoun(kind: string, kinds?: Record | undefined, nouns?: Readonly> | undefined | { (kind: string, collection: "entities" | "relationships"): SummaryKindCount | SummaryNoun | false | undefined }): SummaryNoun +``` + +A kind's words, as the summary bar words its count: the definition's noun (`presentation.kinds..noun`), else +the renderer's (`SummaryNouns`), else the host's (`humanizeKind`). + ### `kindText` ```ts @@ -2177,6 +2218,89 @@ lineSpline(from: Point, to: Point): Spline A straight segment as one cubic, so every route is a uniform chain. +### `MassFold` + +```ts +interface MassFold +``` + +One fold of sibling items removed or added together. + +| Member | Signature | Description | +|---|---|---| +| `id` | `"id": string` | The fold card's row ID (`massFoldPrefix`). | +| `items` | `"items": Array` | The sibling entity rows it folds, in the model's order. | +| `kind` | `"kind": string` | The folded items' kind, which the card takes. | +| `label` | `"label": string` | The card's label: `48 tables removed`, or open, `Hide 48 removed tables`. | +| `open` | `"open": false \| true` | Whether it is open: its items drawn on their own, and the card the way to fold them again. | +| `presents` | `"presents": Array` | Every row the card presents while closed: the siblings, the parts they contain and the relationships among them or to them, for the card's `data-entity-aliases`. | +| `status` | `"status": MassStatus` | Whether its items were removed or added: the card's status, and so its style. | + +### `MassFolded` + +```ts +interface MassFolded +``` + +A model with its mass changes folded (`foldMassChanges`), and what each fold stands for. + +| Member | Signature | Description | +|---|---|---| +| `folded` | `"folded": ReadonlyMap` | Each row a closed fold hides (entity or relationship), and the card or link drawn for it. | +| `folds` | `"folds": ReadonlyMap` | Each fold, by its card's ID; empty when nothing folds (and `model` is the one passed). | +| `model` | `"model": ComparisonModel` | The model with each fold's card and links in place of what they stand for, steps included. | +| `stands` | `"stands": ReadonlyMap>` | Each card and link a fold adds, and the rows it stands for: their step and emphasis are its. | + +### `massFoldLabel` + +```ts +massFoldLabel(count: number, status: MassStatus, noun: SummaryNoun, open?: false | true, locale?: string): string +``` + +A fold's card label: `48 tables removed`; open, `Hide 48 removed tables`. + +### `massFoldMinimum` + +```ts +massFoldMinimum: 12 +``` + +The fewest sibling items removed (or added) together that fold into one card: twice a sibling block's +`blockMinimum`, two full lines of its tray, past which more cards add height without saying more than their count. +It is also where a stack of removed database tables alone outgrows a frame: on one schema, 48 removed tables drew a +frame 81,546 px tall, about 1,700 px a table, so a dozen pass the 20,000 px most hosts render. + +### `MassFoldOptions` + +```ts +interface MassFoldOptions +``` + +How `foldMassChanges` folds. + +| Member | Signature | Description | +|---|---|---| +| `locale` | `"locale"?: string` | BCP 47 locale for the count (`en-US` by default). | +| `minimum` | `"minimum"?: number` | The fewest siblings that fold (`massFoldMinimum` by default). | +| `noun` | `"noun"?: { (kind: string): SummaryNoun \| undefined }` | A kind's words (the definition's noun); `humanizeKind` by default. | +| `open` | `"open"?: ReadonlySet` | Folds the person opened, by card ID: their items are drawn, and the card stays as the way to fold them again. | + +### `massFoldPrefix` + +```ts +massFoldPrefix: "pk-mass:" +``` + +The ID prefix of the cards and links `foldMassChanges` adds. + +### `MassStatus` + +```ts +type MassStatus = "added" | "removed" +``` + +The statuses that fold: items that only one revision has. + ### `maxZoom` ```ts @@ -3986,7 +4110,10 @@ The corner radius a graph card's shape is drawn with, in card units, where the t CardGrid(__0: { "children": ReactNode; "label"?: string }): Element ``` -Cards in a responsive grid: as many columns as fit, one on a phone. +Cards in a responsive grid: as many columns as fit, one on a phone. In a comparison, a dozen or more of its +`EntityCard`s removed (or added) together, of one kind, fold into one card that counts them and opens in place +(`GridFoldCard`), and a run of a dozen or more unchanged ones folds into a band across the grid (`GridBand`), except +under the Changes scope. ### `CategoriesView` @@ -4302,12 +4429,14 @@ labels ("Runs on"), use `Facts` and `Fact`. ### `Fold` ```ts -Fold(__0: { "as"?: ElementType; "className"?: string; "columns"?: number; "count": number; "noun": string; "onToggle": { (): void }; "open"?: false | true | undefined }): Element +Fold(__0: { "as"?: ElementType; "className"?: string; "columns"?: number; "count": number; "id"?: string | undefined; "noun": string; "onToggle": { (): void }; "open"?: false | true | undefined; "presents"?: Array | undefined }): Element ``` A fold: "12 unchanged declarations", a button that opens the run in place; `open`, "Hide 12 unchanged declarations" above the opened run, which folds it again. `as` sets its element (`div` by default, `tr` or `li` in tables and lists; -a `tr` puts the button in one cell spanning `columns`). +a `tr` puts the button in one cell spanning `columns`). Given an `id`, the fold is an item the host sees, and while +closed it presents the items it folds (`presents`, in `data-entity-aliases`), so the host's selection, hover and +filter of one find it. ### `GeneratedMark` @@ -4362,7 +4491,9 @@ The staged graph canvas shared by the graph, DAG and architecture renderers: ELK layouts per comparison step (laid out off the main thread before the first paint), identity-stable cards, spline relationships that morph on the same clock as their cards, stable framing across the whole transition, and -host-driven change emphasis. +host-driven change emphasis. A dozen or more sibling cards removed (or added) +together fold into one card that counts them and opens in place +(`foldMassChanges`). ### `graphCanvasControls` @@ -4556,6 +4687,23 @@ KitRenderer(__0: { "component": ComponentType>; "option Connects a kit renderer component to its host through the renderer frame protocol. +### `MassFolding` + +```ts +interface MassFolding

+``` + +A renderer's props with its mass changes folded (`useMassFolds`), and the folds. + +| Member | Signature | Description | +|---|---|---| +| `aliases` | `"aliases": { (id: string): Array \| undefined }` | The items a closed fold's card presents (for its `data-entity-aliases`, the SDK's `entityAliasesAttribute`), so the host's selection, hover and filter of one find the card; undefined for an open fold or any other item. | +| `drawnFor` | `"drawnFor": { (id: string): string }` | The card or link drawn for an item: the fold's, while it hides the item, else the item itself. | +| `foldOf` | `"foldOf": { (id: string): string \| undefined }` | The fold a card, or a link drawn for one, opens or closes. | +| `folds` | `"folds": ReadonlyMap` | Each fold, by its card's ID; empty when nothing folds. | +| `props` | `"props": P` | The props to draw: `model` and `schedule` with each fold's card and links in place of what they stand for, a card's or link's emphasis the most of what it stands for, the host's selection and focus of a folded item moved onto its card, and `onSelect` of a fold's card, or of a link drawn for it, opening or closing the fold. The props passed, when nothing folds. | +| `toggle` | `"toggle": { (id: string): void }` | Opens a fold, or closes an open one. | + ### `MatrixAxis` ```ts @@ -5105,6 +5253,19 @@ host draws it once beside every pane. Pass `undefined` (or no items) to clear it; unmounting clears it too. Describe the whole document, not the current progress, so the legend never changes while scrubbing. +### `useMassFolds` + +```ts +useMassFolds

, "comparing" | "emphasis" | "focusRequest" | "locale" | "model" | "onSelect" | "schedule" | "scope" | "selectedId">>(props: P, document?: unknown): MassFolding

+``` + +Folds a renderer's mass changes (`foldMassChanges`) as the graph canvas and card grid do, for a renderer that lays out +its own model: draw `props` and give each fold's card (an entity row whose ID `isMassFold`) its label, its status's +style, `data-entity-aliases` from `aliases` and `data-fold`, and activate it with `onSelect` (or `toggle`). The cards +are labeled with the definition's plural noun for their kind, as the summary bar counts it. What the person opened +stays open while the same `document` is shown (by default the Changes scope's `all`, else `model`), the Changes +scope's views of it included. A single revision folds nothing. + ### `useOpeningFloor` ```ts From 97f5d488d33c0b58c0c2f916e207637805e7b64e Mon Sep 17 00:00:00 2001 From: agorischek <6295280+agorischek@users.noreply.github.com> Date: Fri, 4 Dec 2026 23:30:03 +0000 Subject: [PATCH 4/4] Changelog: fold mass changes in the database renderer (#402) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --- changelog.d/402-kit.md | 5 +++++ changelog.d/402.md | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 changelog.d/402-kit.md create mode 100644 changelog.d/402.md diff --git a/changelog.d/402-kit.md b/changelog.d/402-kit.md new file mode 100644 index 000000000..404a8c8fb --- /dev/null +++ b/changelog.d/402-kit.md @@ -0,0 +1,5 @@ +--- +section: kit +--- + +- **`useMassFolds` folds mass changes for a renderer with its own layout** (#402). `useMassFolds(props)` from `@githubnext/projections-renderer-kit/react` returns the props to draw, with `model` and `schedule` folded (`foldMassChanges`), emphasis, selection and focus requests moved onto each fold's card, and `onSelect` of a fold or its links opening it, along with the items each closed fold presents (`aliases`) for its `data-entity-aliases`. `GraphCanvas` folds through the same hook. See [the graph canvas guide](docs/guides/renderer-kit-graphs.md). diff --git a/changelog.d/402.md b/changelog.d/402.md new file mode 100644 index 000000000..d21c224bb --- /dev/null +++ b/changelog.d/402.md @@ -0,0 +1,5 @@ +--- +section: renderers +--- + +- **The database renderer folds a dozen or more tables removed together into one card** (#402). A comparison that removes a whole set of tables (48 in one schema) used to draw every removed table, which could make the frame too tall to render as an image. The database renderer now draws one card in the removed style, such as "48 tables removed", worded with the definition's noun, and draws each foreign key or enum type from those tables to what stays once from its header. Views and enums fold the same way, and a dozen or more columns or keys removed from a table that stays fold into one row of it ("17 columns removed"). Activating a fold opens its items in place. The host's selection, hover, filter and focus (`--entity`) of a folded item find the fold. Additions of a dozen or more fold the same way.