diff --git a/docker-compose.yaml b/docker-compose.yaml index 3ba6b04..97b31c7 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -3,16 +3,11 @@ services: build: . environment: - REDIS_URL=redis://redis - - DATABASE_URL=postgresql://postgres:password@postgres/portfolio?schema=public - AUTH_KEY=auth.docker + # - DATABASE_URL=mongodb+srv://user:password@host/portfolio?retryWrites=true&w=majority&appName=Cluster0 ports: - 3001:3001 depends_on: - redis - - postgres redis: image: redis:7-alpine - postgres: - image: postgres - environment: - - POSTGRES_PASSWORD=password diff --git a/prisma/migrations/20240827121910_initial_migration/migration.sql b/prisma/migrations/20240827121910_initial_migration/migration.sql deleted file mode 100644 index e829ab2..0000000 --- a/prisma/migrations/20240827121910_initial_migration/migration.sql +++ /dev/null @@ -1,15 +0,0 @@ --- CreateTable -CREATE TABLE "File" ( - "id" TEXT NOT NULL, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "fileId" TEXT NOT NULL, - "name" TEXT NOT NULL, - "size" INTEGER NOT NULL, - "mimetype" TEXT NOT NULL, - "url" TEXT NOT NULL, - - CONSTRAINT "File_pkey" PRIMARY KEY ("id") -); - --- CreateIndex -CREATE UNIQUE INDEX "File_fileId_key" ON "File"("fileId"); diff --git a/prisma/migrations/20240828043558_add_project/migration.sql b/prisma/migrations/20240828043558_add_project/migration.sql deleted file mode 100644 index 9443ff1..0000000 --- a/prisma/migrations/20240828043558_add_project/migration.sql +++ /dev/null @@ -1,22 +0,0 @@ --- AlterTable -ALTER TABLE "File" ADD COLUMN "projectId" TEXT; - --- CreateTable -CREATE TABLE "Project" ( - "id" TEXT NOT NULL, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - "name" TEXT NOT NULL, - "description" TEXT NOT NULL, - "repositoryUrl" TEXT NOT NULL, - "previewUrl" TEXT, - "topics" TEXT[] DEFAULT ARRAY[]::TEXT[], - - CONSTRAINT "Project_pkey" PRIMARY KEY ("id") -); - --- CreateIndex -CREATE UNIQUE INDEX "Project_name_key" ON "Project"("name"); - --- AddForeignKey -ALTER TABLE "File" ADD CONSTRAINT "File_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "Project"("id") ON DELETE SET NULL ON UPDATE CASCADE; diff --git a/prisma/migrations/migration_lock.toml b/prisma/migrations/migration_lock.toml deleted file mode 100644 index fbffa92..0000000 --- a/prisma/migrations/migration_lock.toml +++ /dev/null @@ -1,3 +0,0 @@ -# Please do not edit this file manually -# It should be added in your version-control system (i.e. Git) -provider = "postgresql" \ No newline at end of file diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 65ee320..b197a4a 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -3,12 +3,12 @@ generator client { } datasource db { - provider = "postgresql" + provider = "mongodb" url = env("DATABASE_URL") } model File { - id String @id @default(uuid()) + id String @id @default(uuid()) @map("_id") createdAt DateTime @default(now()) fileId String @unique @@ -22,7 +22,7 @@ model File { } model Project { - id String @id @default(uuid()) + id String @id @default(uuid()) @map("_id") createdAt DateTime @default(now()) updatedAt DateTime @updatedAt diff --git a/run b/run index 1a250b5..226f0fc 100644 --- a/run +++ b/run @@ -1,5 +1,5 @@ #!/bin/sh -npx prisma migrate deploy +npx prisma db push node $@