Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-- CreateTable
CREATE TABLE "UserMediaProfile" (
"id" TEXT NOT NULL,
"userId" TEXT NOT NULL,
"languageInterestIds" TEXT[],
"countryInterestIds" TEXT[],
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,

CONSTRAINT "UserMediaProfile_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "_UserMediaProfileToVideo" (
"A" TEXT NOT NULL,
"B" TEXT NOT NULL,

CONSTRAINT "_UserMediaProfileToVideo_AB_pkey" PRIMARY KEY ("A","B")
);

-- CreateIndex
CREATE INDEX "_UserMediaProfileToVideo_B_index" ON "_UserMediaProfileToVideo"("B");

-- AddForeignKey
ALTER TABLE "_UserMediaProfileToVideo" ADD CONSTRAINT "_UserMediaProfileToVideo_A_fkey" FOREIGN KEY ("A") REFERENCES "UserMediaProfile"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "_UserMediaProfileToVideo" ADD CONSTRAINT "_UserMediaProfileToVideo_B_fkey" FOREIGN KEY ("B") REFERENCES "Video"("id") ON DELETE CASCADE ON UPDATE CASCADE;
19 changes: 15 additions & 4 deletions libs/prisma/media/db/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ model Video {
publishedAt DateTime?
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
userMediaProfiles UserMediaProfile[]

@@index(label)
@@index(childIds)
Expand Down Expand Up @@ -272,7 +273,7 @@ model VideoEdition {
}

model VideoSubtitle {
id String @id @default(uuid())
id String @id @default(uuid())
videoId String
edition String @default("base")
vttAssetId String? @unique
Expand Down Expand Up @@ -528,6 +529,16 @@ model UserMediaRole {
updatedAt DateTime @default(now()) @updatedAt
}

model UserMediaProfile {
id String @id @default(uuid())
userId String
userInterests Video[]
languageInterestIds String[]
countryInterestIds String[]
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
}

model ShortLinkDomain {
id String @id @default(uuid())
/// the hostname including subdomain, domain, and TLD, but excluding port
Expand Down Expand Up @@ -567,9 +578,9 @@ model ShortLink {

model ShortLinkBlocklistDomain {
/// the hostname including subdomain, domain, and TLD, but excluding port
hostname String @id
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
hostname String @id
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
}

model VideoOrigin {
Expand Down
31 changes: 28 additions & 3 deletions libs/prisma/media/src/__generated__/pothos-types.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.