Skip to content
Open
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
8 changes: 8 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ const nextConfig = {
hostname: 'images.unsplash.com',
protocol: 'https',
},
{
hostname: 'storage.aceternity.com',
protocol: 'https',
},
{
hostname: 'sltoipimgzzeegsdygra.supabase.co',
protocol: 'https',
},
],
},
};
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"@radix-ui/react-toast": "^1.2.1",
"@radix-ui/react-tooltip": "^1.1.6",
"@react-email/render": "^1.1.2",
"@supabase/ssr": "^0.6.1",
"@tabler/icons-react": "^3.12.0",
"@tanstack/react-query": "^5.53.1",
"@tsparticles/engine": "^3.5.0",
Expand Down
133 changes: 130 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions prisma/migrations/20250609200043_add_setup_model/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
Warnings:

- A unique constraint covering the columns `[userId,setupId]` on the table `Like` will be added. If there are existing duplicate values, this will fail.

*/
-- AlterTable
ALTER TABLE "Like" ADD COLUMN "setupId" TEXT,
ALTER COLUMN "adviseId" DROP NOT NULL;

-- CreateTable
CREATE TABLE "Setup" (
"id" TEXT NOT NULL,
"title" TEXT NOT NULL,
"content" TEXT NOT NULL,
"imageUrl" TEXT NOT NULL,
"authorId" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,

CONSTRAINT "Setup_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE UNIQUE INDEX "Like_userId_setupId_key" ON "Like"("userId", "setupId");

-- AddForeignKey
ALTER TABLE "Setup" ADD CONSTRAINT "Setup_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "Like" ADD CONSTRAINT "Like_setupId_fkey" FOREIGN KEY ("setupId") REFERENCES "Setup"("id") ON DELETE CASCADE ON UPDATE CASCADE;
24 changes: 22 additions & 2 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ model User {
linkedinUrl String?
sessions Session[]
advises Advise[]
setups Setup[]
languages UserLanguage[]
comments Comment[]
likes Like[]
Expand Down Expand Up @@ -51,6 +52,21 @@ model Advise {
updatedAt DateTime @updatedAt
}

model Setup {
id String @id @default(cuid())
title String
content String
imageUrl String

author User @relation(fields: [authorId], references: [id])
authorId String
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Que opinas de que el nombre del campo sea owner en lugar de author?


likes Like[]

createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}

model Comment {
id String @id @default(cuid())
content String
Expand Down Expand Up @@ -111,13 +127,17 @@ model Image {
model Like {
id String @id @default(cuid())
userId String
adviseId String
adviseId String?
setupId String?

user User @relation(fields: [userId], references: [id], onDelete: Cascade)
advise Advise @relation(fields: [adviseId], references: [id], onDelete: Cascade)
advise Advise? @relation(fields: [adviseId], references: [id], onDelete: Cascade)
setup Setup? @relation(fields: [setupId], references: [id], onDelete: Cascade)

createdAt DateTime @default(now())
updatedAt DateTime @updatedAt

@@unique([userId, adviseId])
@@unique([userId, setupId])
}

Binary file added public/elementor-placeholder-image.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading