mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-06-05 05:45:16 -04:00
Define relations on evj
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { type SQL, and, eq, exists, sql } from "drizzle-orm";
|
||||
import { Elysia, t } from "elysia";
|
||||
import { entries, entryVideoJoint, showTranslations, shows } from "~/db/schema";
|
||||
import { entries, entryVideoJoin, showTranslations, shows } from "~/db/schema";
|
||||
import { getColumns, sqlarr } from "~/db/utils";
|
||||
import { KError } from "~/models/error";
|
||||
import { bubble } from "~/models/examples";
|
||||
@@ -81,8 +81,8 @@ export const movies = new Elysia({ prefix: "/movies", tags: ["movies"] })
|
||||
exists(
|
||||
db
|
||||
.select()
|
||||
.from(entryVideoJoint)
|
||||
.where(eq(entries.pk, entryVideoJoint.entry)),
|
||||
.from(entryVideoJoin)
|
||||
.where(eq(entries.pk, entryVideoJoin.entry)),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -258,8 +258,8 @@ export const movies = new Elysia({ prefix: "/movies", tags: ["movies"] })
|
||||
exists(
|
||||
db
|
||||
.select()
|
||||
.from(entryVideoJoint)
|
||||
.where(eq(entries.pk, entryVideoJoint.entry)),
|
||||
.from(entryVideoJoin)
|
||||
.where(eq(entries.pk, entryVideoJoin.entry)),
|
||||
),
|
||||
)
|
||||
.as("video");
|
||||
|
||||
@@ -3,7 +3,7 @@ import { db } from "~/db";
|
||||
import {
|
||||
entries,
|
||||
entryTranslations,
|
||||
entryVideoJoint as entryVideoJoin,
|
||||
entryVideoJoin,
|
||||
videos,
|
||||
} from "~/db/schema";
|
||||
import { conflictUpdateAllExcept, values } from "~/db/utils";
|
||||
|
||||
Reference in New Issue
Block a user