Skip to content
Merged
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
6 changes: 3 additions & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ Closes #

## Checklist

- [ ] My code follows the project's coding style (`pnpm -r run lint` passes).
- [ ] TypeScript compiles without errors (`pnpm -r run typecheck`).
- [ ] My code follows the project's coding style (`npm run lint` passes).
- [ ] TypeScript compiles without errors (`npm run typecheck --workspaces --if-present`).
- [ ] I have added or updated tests for the changes I made.
- [ ] All tests pass locally (`pnpm -r run test`).
- [ ] All tests pass locally (`npm run test --workspaces --if-present`).
- [ ] I have updated documentation where necessary.
- [ ] No new `console.log` or debug statements left in the code.
- [ ] Breaking changes are documented in this PR description.
Expand Down
99 changes: 0 additions & 99 deletions apps/backend/prisma/migrations/20260312125106_init/migration.sql

This file was deleted.

This file was deleted.

25 changes: 24 additions & 1 deletion apps/backend/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,40 @@ model PlatformLink {
@@map("platform_links")
}

enum CardVisibility {
PUBLIC // Anyone can view the card
UNLISTED // Anyone with the link can view, but not publicly listed
PRIVATE // Only the card owner can view
}

model Card {
id String @id @default(uuid())
userId String @map("user_id")

title String
description String?

slug String @unique

visibility CardVisibility @default(PUBLIC)

qrEnabled Boolean @default(true)

viewCount Int @default(0)

isDefault Boolean @default(false) @map("is_default")
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")

user User @relation(fields: [userId], references: [id], onDelete: Cascade)

cardLinks CardLink[]
views CardView[]


@@map("cards")
@@index([userId])
@@index([viewCount])
}

model CardLink {
Expand Down Expand Up @@ -145,7 +166,7 @@ model CardView {
cardId String? @map("card_id") // null = default profile view
ownerId String @map("owner_id") // card/profile owner
viewerId String? @map("viewer_id") // null = anonymous web viewer
viewerIp String? @map("viewer_ip")
viewerIp String? @map("viewer_ip") //hashed
viewerAgent String? @map("viewer_agent")
source String @default("qr") // "qr" | "link" | "web" | "app"
createdAt DateTime @default(now()) @map("created_at")
Expand All @@ -155,6 +176,8 @@ model CardView {
viewer User? @relation("cardViewer", fields: [viewerId], references: [id], onDelete: SetNull)

@@map("card_views")
@@index([cardId])
@@index([ownerId])
}

model FollowLog {
Expand Down
Loading
Loading