Download frontend/src/generated/prisma/schema.prisma from new-arc/vector: direct link, hf CLI and curl.
- Browser
- Download file 17.8 kB
-
https://huggingface.co/spaces/new-arc/vector/resolve/main/frontend/src/generated/prisma/schema.prisma
- Command line
-
hf download hf://spaces/new-arc/vector/frontend/src/generated/prisma/schema.prisma
-
curl -L -o schema.prisma https://huggingface.co/spaces/new-arc/vector/resolve/main/frontend/src/generated/prisma/schema.prisma
17.8 kB
| // This is your Prisma schema file, | |
| // learn more about it in the docs: https://pris.ly/d/prisma-schema | |
| // Looking for ways to speed up your queries, or scale easily with your serverless or edge functions? | |
| // Try Prisma Accelerate: https://pris.ly/cli/accelerate-init | |
| generator client { | |
| provider = "prisma-client-js" | |
| output = "../src/generated/prisma" | |
| binaryTargets = ["native", "linux-arm64-openssl-3.0.x", "linux-musl-openssl-3.0.x", "debian-openssl-3.0.x"] | |
| } | |
| datasource db { | |
| provider = "postgresql" | |
| url = env("DATABASE_URL") | |
| } | |
| // Public component status, editable without a frontend deployment. | |
| model ServiceStatus { | |
| id String .VarChar(80) | |
| name String .VarChar(120) | |
| status String .VarChar(20) | |
| headline String .VarChar(120) | |
| description String .VarChar(2000) | |
| updatedAt DateTime .Timestamptz | |
| @ | |
| } | |
| // Announcements managed by admins without a frontend deployment. | |
| model Announcement { | |
| id String | |
| title String .VarChar(120) | |
| description String .VarChar(2000) | |
| href String .VarChar(500) | |
| action String .VarChar(80) | |
| isPublished Boolean | |
| publishedAt DateTime .Timestamptz | |
| createdAt DateTime .Timestamptz | |
| updatedAt DateTime .Timestamptz | |
| @ | |
| @ | |
| } | |
| // Better Auth User model with backend compatibility | |
| model EmailDelivery { | |
| message_id String .VarChar(255) | |
| recipient String .VarChar(255) | |
| subject String .Text | |
| region String .VarChar(64) | |
| sent_at DateTime .Timestamptz | |
| @ | |
| @ | |
| } | |
| model User { | |
| id String | |
| name String | |
| email String | |
| emailVerified Boolean | |
| image String? | |
| createdAt DateTime .Timestamptz | |
| updatedAt DateTime .Timestamptz | |
| // Additional fields for backend compatibility | |
| first_name String? .VarChar(100) | |
| last_name String? .VarChar(100) | |
| password_hash String? .VarChar(255) | |
| // Default font preferences | |
| default_font_family String? .VarChar(100) | |
| default_font_size Int? | |
| default_font_color String? .VarChar(7) | |
| notify_on_completion Boolean | |
| default_clip_length String .VarChar(10) | |
| // What the create screen remembers between videos (lib/create-settings.ts). | |
| create_settings Json .JsonB | |
| product_updates_unsubscribed_at DateTime? .Timestamptz | |
| // Monetization and billing | |
| plan String .VarChar(20) | |
| subscription_status String .VarChar(20) | |
| subscription_provider String? .VarChar(20) | |
| is_admin Boolean | |
| stripe_customer_id String? .VarChar(255) | |
| stripe_subscription_id String? .VarChar(255) | |
| billing_period_start DateTime? .Timestamptz | |
| billing_period_end DateTime? .Timestamptz | |
| trial_ends_at DateTime? .Timestamptz | |
| subscription_cancel_at DateTime? .Timestamptz | |
| // Pro subscribers from before the 720p change keep 1080p while subscribed | |
| legacy_hd Boolean | |
| // Higher tier chosen in the billing portal, granted only after its invoice is paid. | |
| pending_plan String? .VarChar(20) | |
| pending_plan_invoice_id String? .VarChar(255) | |
| // Relationships | |
| tasks Task[] | |
| sessions Session[] | |
| accounts Account[] | |
| app_settings AppSetting[] | |
| feature_flags_updated FeatureFlag[] | |
| acquisition UserAcquisition? | |
| affiliate Affiliate? | |
| reviewed_affiliates Affiliate[] | |
| social_accounts SocialAccount[] | |
| social_oauth_states SocialOauthState[] | |
| social_posts SocialPost[] | |
| feature_tours UserFeatureTour[] | |
| @ | |
| } | |
| // First-touch campaign attribution, written once shortly after sign-up. | |
| model UserAcquisition { | |
| user_id String .VarChar(36) | |
| utm_source String? .VarChar(100) | |
| utm_medium String? .VarChar(100) | |
| utm_campaign String? .VarChar(100) | |
| utm_content String? .VarChar(100) | |
| utm_term String? .VarChar(100) | |
| ref String? .VarChar(100) | |
| referrer_host String? .VarChar(255) | |
| landing_path String? .VarChar(512) | |
| first_seen_at DateTime? .Timestamptz | |
| first_clip_exported_at DateTime? .Timestamptz | |
| created_at DateTime .Timestamptz | |
| user User | |
| @ | |
| @ | |
| } | |
| /// Creator program application. `slug` is the lowercase ref/code; it is | |
| /// cleared on decline so the name becomes available again. | |
| model Affiliate { | |
| id String .VarChar(36) | |
| user_id String .VarChar(36) | |
| slug String? .VarChar(20) | |
| status String .VarChar(20) | |
| platform String .VarChar(20) | |
| profile_url String .VarChar(500) | |
| audience_size String .VarChar(20) | |
| video_url String? .VarChar(500) | |
| promotion_plan String? .VarChar(1000) | |
| decline_reason String? .VarChar(1000) | |
| stripe_promotion_code_id String? .VarChar(255) | |
| /// When an admin added the creator's custom code to the App Store "Creator offer". | |
| app_store_code_added_at DateTime? .Timestamptz | |
| terms_accepted_at DateTime .Timestamptz | |
| reviewed_at DateTime? .Timestamptz | |
| reviewed_by String? .VarChar(36) | |
| created_at DateTime .Timestamptz | |
| updated_at DateTime .Timestamptz | |
| user User | |
| reviewer User? | |
| @ | |
| @ | |
| } | |
| // Feature flags per platform (backend/src/feature_flags.py), switched in /admin. | |
| model FeatureFlag { | |
| key String .VarChar(64) | |
| description String | |
| web_enabled Boolean | |
| ios_enabled Boolean | |
| // Admins get the feature on every platform while it is off for everyone else. | |
| admins_bypass Boolean | |
| updated_by String? .VarChar(36) | |
| created_at DateTime .Timestamptz | |
| updated_at DateTime .Timestamptz | |
| updated_by_user User? | |
| @ | |
| @ | |
| } | |
| model AppSetting { | |
| setting_key String .VarChar(100) | |
| encrypted_value String | |
| prefer_admin_value Boolean | |
| updated_by String? .VarChar(36) | |
| created_at DateTime .Timestamptz | |
| updated_at DateTime .Timestamptz | |
| user User? | |
| @ | |
| @ | |
| } | |
| // Durable billing charges with failure refunds. No task/user relation: deletion must retain usage | |
| // and the original task idempotency key. The backend owns all writes. | |
| model MinuteUsageEvent { | |
| id String .VarChar(36) | |
| user_id String | |
| task_id String? | |
| minutes Int | |
| source_duration_seconds Int | |
| created_at DateTime .Timestamptz | |
| refunded_at DateTime? .Timestamptz | |
| @ | |
| @ | |
| } | |
| // AI edit usage survives task/clip deletion. The backend reserves and refunds requests. | |
| model AIEditUsageEvent { | |
| job_id String .VarChar(32) | |
| user_id String | |
| created_at DateTime .Timestamptz | |
| refunded_at DateTime? .Timestamptz | |
| @ | |
| @ | |
| } | |
| model Task { | |
| id String | |
| user_id String | |
| source_id String? | |
| generated_clips_ids String[] | |
| status String .VarChar(20) | |
| progress Int? | |
| progress_message String? | |
| source_metadata Json .JsonB | |
| source_duration_seconds Int? | |
| completion_notification_sent_at DateTime? .Timestamptz | |
| share_token String? .VarChar(64) | |
| share_enabled Boolean | |
| // Font customization fields | |
| font_family String? .VarChar(100) | |
| font_size Int? | |
| font_color String? .VarChar(7) | |
| caption_template String? .VarChar(50) | |
| include_broll Boolean? | |
| created_at DateTime .Timestamptz | |
| updated_at DateTime .Timestamptz | |
| // Relationships | |
| user User | |
| source Source? | |
| social_posts SocialPost[] | |
| @ | |
| @ | |
| @ | |
| @ | |
| @ | |
| } | |
| // Social publishing. Owned by the backend (raw SQL, tokens encrypted with the | |
| // backend key); mirrored here so both migration runners create the same tables. | |
| model SocialAccount { | |
| id String .VarChar(36) | |
| user_id String .VarChar(36) | |
| provider String .VarChar(20) | |
| external_account_id String .VarChar(255) | |
| display_name String? .VarChar(255) | |
| username String? .VarChar(255) | |
| avatar_url String? | |
| access_token_encrypted String | |
| refresh_token_encrypted String? | |
| token_expires_at DateTime? .Timestamptz | |
| scopes String? | |
| metadata Json .JsonB | |
| status String .VarChar(20) | |
| last_error String? | |
| created_at DateTime? .Timestamptz | |
| updated_at DateTime? .Timestamptz | |
| revoked_at DateTime? .Timestamptz | |
| user User | |
| posts SocialPost[] | |
| @ | |
| @ | |
| @ | |
| } | |
| model SocialOauthState { | |
| state String .VarChar(128) | |
| user_id String .VarChar(36) | |
| provider String .VarChar(20) | |
| code_verifier String? .VarChar(255) | |
| redirect_uri String | |
| created_at DateTime? .Timestamptz | |
| expires_at DateTime .Timestamptz | |
| user User | |
| @ | |
| @ | |
| } | |
| model SocialPost { | |
| id String .VarChar(36) | |
| user_id String .VarChar(36) | |
| task_id String? .VarChar(36) | |
| /// generated_clips(id), ON DELETE SET NULL (generated_clips is not modeled here). | |
| clip_id String? .VarChar(36) | |
| social_account_id String? .VarChar(36) | |
| provider String .VarChar(20) | |
| status String .VarChar(20) | |
| scheduled_for DateTime? .Timestamptz | |
| title String? .VarChar(255) | |
| caption String? | |
| hashtags String[] | |
| privacy_level String .VarChar(40) | |
| media_token String? .VarChar(64) | |
| media_token_expires_at DateTime? .Timestamptz | |
| source_file_path String? | |
| pending_handle String? .VarChar(255) | |
| external_post_id String? .VarChar(255) | |
| external_url String? | |
| error_message String? | |
| attempts Int | |
| claimed_at DateTime? .Timestamptz | |
| hook_type String? .VarChar(50) | |
| hook_title String? .VarChar(255) | |
| virality_score Int? | |
| hook_score Int? | |
| engagement_score Int? | |
| value_score Int? | |
| shareability_score Int? | |
| clip_duration Float? | |
| published_at DateTime? .Timestamptz | |
| last_metrics_at DateTime? .Timestamptz | |
| metrics Json? .JsonB | |
| created_at DateTime? .Timestamptz | |
| updated_at DateTime? .Timestamptz | |
| user User | |
| task Task? | |
| social_account SocialAccount? | |
| metric_history SocialPostMetric[] | |
| @ | |
| @ | |
| @ | |
| @ | |
| @ | |
| } | |
| model SocialPostMetric { | |
| id String .VarChar(36) | |
| post_id String .VarChar(36) | |
| captured_at DateTime? .Timestamptz | |
| views BigInt? | |
| likes BigInt? | |
| comments BigInt? | |
| shares BigInt? | |
| saves BigInt? | |
| raw Json? .JsonB | |
| post SocialPost | |
| @ | |
| @ | |
| } | |
| model Source { | |
| id String | |
| type String .VarChar(20) | |
| title String .VarChar(500) | |
| url String? .VarChar(1000) | |
| created_at DateTime .Timestamptz | |
| updated_at DateTime .Timestamptz | |
| // Relationships | |
| tasks Task[] | |
| @ | |
| @ | |
| } | |
| // Better Auth Session management | |
| model Session { | |
| id String | |
| expiresAt DateTime | |
| token String | |
| createdAt DateTime | |
| updatedAt DateTime | |
| ipAddress String? | |
| userAgent String? | |
| userId String | |
| user User | |
| @ | |
| } | |
| model Account { | |
| id String | |
| accountId String | |
| providerId String | |
| userId String | |
| user User | |
| accessToken String? | |
| refreshToken String? | |
| idToken String? | |
| accessTokenExpiresAt DateTime? | |
| refreshTokenExpiresAt DateTime? | |
| scope String? | |
| password String? | |
| createdAt DateTime | |
| updatedAt DateTime | |
| @ | |
| } | |
| model Verification { | |
| id String | |
| identifier String | |
| value String | |
| expiresAt DateTime | |
| createdAt DateTime? | |
| updatedAt DateTime? | |
| @ | |
| } | |
| model StripeWebhookEvent { | |
| id String | |
| type String | |
| created_at DateTime .Timestamptz | |
| @ | |
| } | |
| model RevenueCatWebhookEvent { | |
| id String | |
| type String | |
| created_at DateTime .Timestamptz | |
| @ | |
| } | |
| /// One row per account and feature tour (lib/feature-tours.ts): shown, then completed or dismissed. | |
| model UserFeatureTour { | |
| user_id String .VarChar(36) | |
| tour_id String .VarChar(64) | |
| shown_at DateTime .Timestamptz | |
| completed_at DateTime? .Timestamptz | |
| dismissed_at DateTime? .Timestamptz | |
| last_step Int? | |
| user User | |
| @ | |
| @ | |
| @ | |
| } | |