Spaces:
Sleeping
Sleeping
| // This is your Prisma schema file, | |
| // learn more about it in the docs: https://pris.ly/d/prisma-schema | |
| generator client { | |
| provider = "prisma-client-js" | |
| } | |
| // Python generator disabled — prisma-client-py is optional and not installed in this env. | |
| // generator python { | |
| // provider = "prisma-client-py" | |
| // } | |
| datasource db { | |
| provider = "sqlite" // Start with SQLite for MVP, easy migration to Postgres later | |
| url = env("DATABASE_URL") | |
| } | |
| // Core Deals table - matches your provided table structure + temporal metadata | |
| model Deal { | |
| id String // UUID for new deals, custom IDs allowed in seed | |
| date String? // "2024-05-22" or "2024" or "2021-2024" | |
| period String? // For ranges like "2021-2024" | |
| // Temporal metadata | |
| announcementDate DateTime? | |
| effectiveStartDate DateTime? | |
| effectiveEndDate DateTime? | |
| discoveryDate DateTime? | |
| lastVerified DateTime? | |
| sourcePublicationDate DateTime? | |
| modality String // "Text", "Image", "Audio", "Video", "Satellite", etc. | |
| provider String | |
| buyer String // Can be comma-separated for multiple buyers | |
| dataType String // Short description | |
| reportedTerms String? // Headline terms | |
| creatorsCompensated Boolean? // Yes/No/Unclear | |
| exclusive Boolean? // Yes/No/N/A | |
| pricingMechanism String | |
| // Enhanced content metadata | |
| contentType String? // text, image, audio, etc. | |
| volumeDescription String? | |
| updateFrequency String? // streaming, batch, one-time | |
| historicalArchiveAccess Boolean? | |
| // Pricing structure (JSON) | |
| pricingStructure String? // JSON: {headline_price, currency, billing_interval, estimated_unit_cost} | |
| billingInterval String? // annual, monthly, one-time | |
| estimatedUnitCost String? // per 1000 API calls, etc. | |
| // Linkages metadata (JSON) | |
| linkagesMetadata String? // JSON: {likely_used_by_models, impact_on_training_data, modality_integration, feed_type} | |
| // Extended fields from your schema plan | |
| dealType String? // aggregate, per-unit, commissioning, etc. | |
| priceUsd Float? | |
| priceRangeMinUsd Float? | |
| priceRangeMaxUsd Float? | |
| priceCurrency String? | |
| durationYears Float? | |
| startDate DateTime? | |
| endDate DateTime? | |
| // Rights & restrictions | |
| trainingAllowed Boolean? | |
| finetuningAllowed Boolean? | |
| inferenceAllowed Boolean? | |
| redistributionAllowed Boolean? | |
| deletionRequired Boolean? | |
| // Compensation details | |
| creatorSplitPercentage Float? | |
| revenueShare Boolean? | |
| // Provenance & Discovery | |
| sources String // JSON array of URLs | |
| sourcePrimary String? // "Reuters", "SEC filing", etc. | |
| discoveredVia String? // exa, manual, filing, etc. | |
| exaQuery String? | |
| exaScore Float? | |
| exaRetrievedAt DateTime? | |
| // Extraction metadata | |
| extractionMetadata String? // JSON | |
| rawTextSnippets String? // JSON array | |
| regexConfidence String? // high, medium, low | |
| llmConfidence String? // high, medium, low | |
| lastExtracted DateTime? | |
| notes String? | |
| dealStage String? // announced, rumored, confirmed, settled | |
| confidenceScore Float? // 0-1 | |
| // Linkages to models | |
| modelLinkages DealModelLinkage[] | |
| // Relations | |
| providerRelation Provider? | |
| providerId String? | |
| buyerRelations DealBuyer[] | |
| // Pricing normalization | |
| pricingNormalizations PricingNormalization[] | |
| // Versioning | |
| version String? | |
| // Timestamps | |
| createdAt DateTime | |
| updatedAt DateTime | |
| @ | |
| @ | |
| @ | |
| @ | |
| @ | |
| @ | |
| @ | |
| @ | |
| } | |
| // Model Registry table | |
| model ModelRegistry { | |
| id String | |
| modelId String | |
| family String? | |
| provider String | |
| releaseDate DateTime? | |
| lastUpdated DateTime? | |
| // Parameters | |
| params Float? // in billions | |
| paramsActive Float? // for MoE | |
| // Architecture | |
| architectureType String? | |
| isMoe Boolean? | |
| numExperts Int? | |
| activeExperts Int? | |
| longContext Int? | |
| multimodal Boolean? | |
| // Training compute | |
| flopsReported Float? | |
| flopsEstimated Float? | |
| computeSources String? // JSON array | |
| // Token estimates | |
| tokensEstMin Float? | |
| tokensEstMax Float? | |
| tokensEstMid Float? | |
| tokensRangeGeneratedAt DateTime? | |
| openDataTokensReported Float? | |
| // Estimation metadata | |
| estimationMethod String? // JSON array of methods used | |
| estimationConfidence Float? // 0-1 confidence score | |
| estimationDate DateTime? | |
| estimationVersion String? | |
| // Evidence profile | |
| evidenceTypes String? // JSON array | |
| evidenceStrength String? // S-High, S-Medium, S-Low | |
| uncertaintySources String? // JSON array | |
| evidenceProfileGeneratedAt DateTime? | |
| // Data composition | |
| compositionEstimates String? // JSON | |
| // Sources | |
| sources String? // JSON array | |
| rawEvidenceSnippets String? // JSON array | |
| // Temporal | |
| trainingPeriodStart DateTime? | |
| trainingPeriodEnd DateTime? | |
| inferenceGeneratedAt DateTime? | |
| // Versioning | |
| version String? | |
| // Linkages | |
| modelLinkages DealModelLinkage[] | |
| // Timestamps | |
| createdAt DateTime | |
| updatedAt DateTime | |
| @ | |
| @ | |
| @ | |
| @ | |
| } | |
| // Linkage between deals and models | |
| model DealModelLinkage { | |
| id String | |
| dealId String | |
| modelId String | |
| linkageType String // temporal_overlap, inferred, explicit | |
| linkageStrength String // high, medium, low | |
| impactInference String? | |
| analysisTimestamp DateTime | |
| deal Deal | |
| model ModelRegistry | |
| @ | |
| @ | |
| @ | |
| @ | |
| } | |
| // Provider table (normalized) | |
| model Provider { | |
| id String | |
| name String | |
| industry String? | |
| country String? | |
| annualRevenue Float? | |
| contentType String? | |
| ownershipStructure String? // publisher, creator-owned, platform, commons | |
| deals Deal[] | |
| createdAt DateTime | |
| updatedAt DateTime | |
| @ | |
| } | |
| // Buyer table (normalized) | |
| model Buyer { | |
| id String | |
| name String | |
| orgType String? // lab, cloud, aggregator, startup, research | |
| modelsAffected String? // JSON array | |
| deals DealBuyer[] | |
| createdAt DateTime | |
| updatedAt DateTime | |
| @ | |
| } | |
| // Many-to-many relationship (deals can have multiple buyers) | |
| model DealBuyer { | |
| id String | |
| dealId String | |
| buyerId String | |
| deal Deal | |
| buyer Buyer | |
| @ | |
| @ | |
| } | |
| // Pricing normalization table | |
| model PricingNormalization { | |
| id String | |
| dealId String | |
| unitType String // token, record, dataset, corpus, stream, minute, image, track | |
| normalizedCostPerUnit Float | |
| normalizationMethod String // manual, inferred, approximate | |
| assumptions String? // JSON for assumptions used | |
| deal Deal | |
| createdAt DateTime | |
| @ | |
| @ | |
| } | |
| // Source tracking for provenance | |
| model DealSource { | |
| id String | |
| dealId String | |
| url String | |
| sourceType String // news, filing, press_release, rss | |
| scrapedAt DateTime? | |
| htmlArchive String? // Path to stored HTML | |
| extractedFields String? // JSON of what was extracted | |
| createdAt DateTime | |
| @ | |
| @ | |
| } | |