Skip to content

Commit

Permalink
refactor(database): use mongodb
Browse files Browse the repository at this point in the history
  • Loading branch information
jmrl23 committed Aug 28, 2024
1 parent 2b2a093 commit 3ef48bf
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 50 deletions.
7 changes: 1 addition & 6 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 0 additions & 15 deletions prisma/migrations/20240827121910_initial_migration/migration.sql

This file was deleted.

22 changes: 0 additions & 22 deletions prisma/migrations/20240828043558_add_project/migration.sql

This file was deleted.

3 changes: 0 additions & 3 deletions prisma/migrations/migration_lock.toml

This file was deleted.

6 changes: 3 additions & 3 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion run
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh

npx prisma migrate deploy
npx prisma db push

node $@

0 comments on commit 3ef48bf

Please sign in to comment.