CI: feature/user-project-ownership #18

Merged
jaybe merged 1 commits from feature/user-project-ownership into main 2025-11-30 18:29:27 +00:00
25 changed files with 44 additions and 13 deletions
Showing only changes of commit 5f541e9524 - Show all commits
@@ -0,0 +1,20 @@
-- AlterTable
ALTER TABLE "Project" ADD COLUMN "userId" TEXT;
-- CreateTable
CREATE TABLE "User" (
"id" TEXT NOT NULL,
"email" TEXT NOT NULL,
"passwordHash" TEXT NOT NULL,
"tokenVersion" INTEGER NOT NULL DEFAULT 0,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "User_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
-- AddForeignKey
ALTER TABLE "Project" ADD CONSTRAINT "Project_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;
+1 -2
View File
@@ -5,8 +5,7 @@
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
generator client {
provider = "prisma-client"
output = "../src/generated/prisma"
provider = "prisma-client-js"
binaryTargets = ["native", "linux-musl-arm64-openssl-3.0.x"]
}
+1 -1
View File
@@ -1,5 +1,5 @@
import { NextResponse } from "next/server";
import { PrismaClient } from "@/generated/prisma/client";
import { PrismaClient } from "@prisma/client";
import { verifyPassword, signAccessToken } from "@/features/auth/authCrypto";
+1 -1
View File
@@ -1,5 +1,5 @@
import { NextResponse } from "next/server";
import { PrismaClient } from "@/generated/prisma/client";
import { PrismaClient } from "@prisma/client";
import { hashPassword, signAccessToken } from "@/features/auth/authCrypto";
+1 -1
View File
@@ -1,7 +1,7 @@
import { NextResponse } from "next/server";
import { promises as fs } from "fs";
import path from "path";
import { PrismaClient } from "@/generated/prisma/client";
import { PrismaClient } from "@prisma/client";
const UPLOAD_DIR = path.join(process.cwd(), "uploads");
+1 -1
View File
@@ -2,7 +2,7 @@ import { NextResponse } from "next/server";
import { promises as fs } from "fs";
import path from "path";
import { randomUUID } from "crypto";
import { PrismaClient } from "@/generated/prisma/client";
import { PrismaClient } from "@prisma/client";
// 업로드된 이미지 파일을 저장할 디렉터리 (프로젝트 루트 기준)
const UPLOAD_DIR = path.join(process.cwd(), "uploads");
+1 -1
View File
@@ -1,5 +1,5 @@
import { NextResponse } from "next/server";
import { PrismaClient } from "@/generated/prisma/client";
import { PrismaClient } from "@prisma/client";
import { verifyAccessToken } from "@/features/auth/authCrypto";
const prisma = new PrismaClient();
+1 -1
View File
@@ -1,5 +1,5 @@
import { NextResponse } from "next/server";
import { PrismaClient } from "@/generated/prisma/client";
import { PrismaClient } from "@prisma/client";
import { verifyAccessToken } from "@/features/auth/authCrypto";
const prisma = new PrismaClient();
+1 -1
View File
@@ -1,7 +1,7 @@
import { NextResponse } from "next/server";
import { promises as fs } from "fs";
import path from "path";
import { PrismaClient } from "@/generated/prisma/client";
import { PrismaClient } from "@prisma/client";
const UPLOAD_DIR = path.join(process.cwd(), "uploads");
+1 -1
View File
@@ -2,7 +2,7 @@ import { NextResponse } from "next/server";
import { promises as fs } from "fs";
import path from "path";
import { randomUUID } from "crypto";
import { PrismaClient } from "@/generated/prisma/client";
import { PrismaClient } from "@prisma/client";
// 업로드된 비디오 파일을 저장할 디렉터리 (프로젝트 루트 기준)
const UPLOAD_DIR = path.join(process.cwd(), "uploads");
+1 -1
View File
@@ -9,7 +9,7 @@ const BASE_URL = "http://localhost";
// 이렇게 하면 CI/로컬 어디에서도 DATABASE_URL 이나 실제 DB 없이 Auth API 테스트를 실행할 수 있다.
const inMemoryUsers: any[] = [];
vi.mock("@/generated/prisma/client", () => {
vi.mock("@prisma/client", () => {
class PrismaClientMock {
user = {
findUnique: async ({ where: { email } }: any) => {
+1 -1
View File
@@ -6,7 +6,7 @@ import { signAccessToken } from "@/features/auth/authCrypto";
// 이렇게 하면 CI/로컬 어디에서도 DATABASE_URL 이나 실제 DB 없이 API 테스트를 실행할 수 있다.
const inMemoryProjects: any[] = [];
vi.mock("@/generated/prisma/client", () => {
vi.mock("@prisma/client", () => {
class PrismaClientMock {
project = {
create: async ({ data }: any) => {
+1 -1
View File
@@ -10,7 +10,7 @@ const BASE_URL = "http://localhost";
// id / servedUrl(`/api/video/:id`) 을 반환해야 한다.
// Prisma 엔진이 실제로 로드되지 않도록 PrismaClient 를 목 처리한다.
vi.mock("@/generated/prisma/client", () => {
vi.mock("@prisma/client", () => {
class PrismaClient {
project = {
upsert: async () => ({ id: "project-mock" }),
@@ -0,0 +1 @@
dummy-video
@@ -0,0 +1 @@
dummy-video
+1
View File
@@ -0,0 +1 @@
dummy-image
+1
View File
@@ -0,0 +1 @@
dummy-image
+1
View File
@@ -0,0 +1 @@
dummy-image
+1
View File
@@ -0,0 +1 @@
dummy-image
@@ -0,0 +1 @@
dummy-section-video
@@ -0,0 +1 @@
dummy-section-video
+1
View File
@@ -0,0 +1 @@
dummy-video
+1
View File
@@ -0,0 +1 @@
dummy-video
+1
View File
@@ -0,0 +1 @@
dummy-poster
+1
View File
@@ -0,0 +1 @@
dummy-poster