✅ ajout de page mon compte - en cours

This commit is contained in:
eric committed 2022-12-02 03:27:55 +01:00
1 parent 7827aa119f
commit 65efdcac94
19 files changed
+2126 -92

No files matched your search

@@ -0,0 +1,31 @@
/*
Warnings:
- You are about to alter the column `prixTtc` on the `Produit` table. The data in that column could be lost. The data in that column will be cast from `Decimal(65,30)` to `Integer`.
- You are about to drop the `Post` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `Profile` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropForeignKey
ALTER TABLE "Post" DROP CONSTRAINT "Post_authorId_fkey";
-- DropForeignKey
ALTER TABLE "Profile" DROP CONSTRAINT "Profile_userId_fkey";
-- DropIndex
DROP INDEX "Gain_userId_key";
-- AlterTable
ALTER TABLE "Produit" ALTER COLUMN "prixTtc" SET DATA TYPE INTEGER;
-- AlterTable
ALTER TABLE "users" ADD COLUMN "address" TEXT,
ADD COLUMN "phoneNumber" TEXT,
ADD COLUMN "surname" TEXT,
ADD COLUMN "zipCode" TEXT;
-- DropTable
DROP TABLE "Post";
-- DropTable
DROP TABLE "Profile";
+6 -20
View File
@@ -42,37 +42,23 @@ model Session {
model User {
id Int @id @default(autoincrement())
name String?
surname String?
address String?
zipCode String?
phoneNumber String?
email String? @unique
emailVerified DateTime? @map("email_verified")
image String?
createdAt DateTime @default(now()) @map(name: "created_at")
updatedAt DateTime @updatedAt @map(name: "updated_at")
posts Post[]
accounts Account[]
sessions Session[]
profile Profile?
gain Gain?
gain Gain[]
role Role @default(USER)
@@map(name: "users")
}
model Post {
id Int @id @default(autoincrement())
title String
content String?
published Boolean @default(false)
author User? @relation(fields: [authorId], references: [id])
authorId Int?
}
model Profile {
id Int @id @default(autoincrement())
bio String?
user User? @relation(fields: [userId], references: [id])
userId Int @unique
}
model TicketsRestants {
id Int @id @default(autoincrement())
total Int
@@ -85,7 +71,7 @@ model Gain {
produit Produit? @relation(fields: [produitId], references: [id])
produitId Int?
user User? @relation(fields: [userId], references: [id])
userId Int? @unique
userId Int?
actif Boolean @default(true)
}
+1 -1
View File
@@ -15,7 +15,7 @@ export const produitsData: Prisma.ProduitCreateInput[] = [
prixTtc: 10,
},
{
nomProduit: 'thé détox ou infusion',
nomProduit: 'thé détox',
prixTtc: 6,
},
{