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
96 changes: 48 additions & 48 deletions prisma/ERD.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ erDiagram
String password "nullable"
String phoneNumber UK "nullable"
Boolean isOAuth
DateTime createAt
DateTime updateAt
DateTime createdAt
DateTime updatedAt
String userType
}
"Customer" {
Int id PK
Int services
Int regions
DateTime createAt
DateTime updateAt
DateTime createdAt
DateTime updatedAt
Int userId FK
}
"Mover" {
Expand All @@ -34,24 +34,24 @@ erDiagram
String description
String introduction
Int userId FK
DateTime createAt
DateTime updateAt
DateTime createdAt
DateTime updatedAt
}
"Service" {
Int id PK
String value
Int code UK
Boolean status
DateTime createAt
DateTime updateAt
DateTime createdAt
DateTime updatedAt
}
"Region" {
Int id PK
String value
Int code
Boolean status
DateTime createAt
DateTime updateAt
DateTime createdAt
DateTime updatedAt
}
"MovingRequest" {
Int id PK
Expand All @@ -63,23 +63,23 @@ erDiagram
Int requestCount
Int designateCount
Boolean isDesignated
DateTime createAt
DateTime updateAt
DateTime createdAt
DateTime updatedAt
Int customerId FK
}
"Quote" {
Int id PK
Int cost
String comment
DateTime createAt
DateTime updateAt
DateTime createdAt
DateTime updatedAt
Int movingRequestId FK
Int moverId FK
}
"ConfirmedQuote" {
Int id PK
DateTime createAt
DateTime updateAt
DateTime createdAt
DateTime updatedAt
Int movingRequestId FK
Int quoteId FK
Int customerId FK
Expand All @@ -90,8 +90,8 @@ erDiagram
String content
Int rating
String imageUrl
DateTime createAt
DateTime updateAt
DateTime createdAt
DateTime updatedAt
Int confirmedQuoteId FK
Int customerId FK
Int moverId FK
Expand All @@ -100,24 +100,24 @@ erDiagram
Int id PK
String content
Boolean isRead
DateTime createAt
DateTime updateAt
DateTime createdAt
DateTime updatedAt
Int userId FK
}
"ReviewComment" {
Int id PK
String content
DateTime createAt
DateTime updateAt
DateTime createdAt
DateTime updatedAt
Int reviewId FK
Int moverId FK
}
"ProfileImage" {
Int id PK
String imageUrl
Boolean status
DateTime createAt
DateTime updateAt
DateTime createdAt
DateTime updatedAt
Int customerId FK "nullable"
Int moverId FK "nullable"
}
Expand Down Expand Up @@ -161,8 +161,8 @@ erDiagram
- `password`:
- `phoneNumber`:
- `isOAuth`:
- `createAt`:
- `updateAt`:
- `createdAt`:
- `updatedAt`:
- `userType`:

### `Customer`
Expand All @@ -171,8 +171,8 @@ erDiagram
- `id`:
- `services`:
- `regions`:
- `createAt`:
- `updateAt`:
- `createdAt`:
- `updatedAt`:
- `userId`:

### `Mover`
Expand All @@ -186,8 +186,8 @@ erDiagram
- `description`:
- `introduction`:
- `userId`:
- `createAt`:
- `updateAt`:
- `createdAt`:
- `updatedAt`:

### `Service`

Expand All @@ -196,8 +196,8 @@ erDiagram
- `value`:
- `code`:
- `status`:
- `createAt`:
- `updateAt`:
- `createdAt`:
- `updatedAt`:

### `Region`

Expand All @@ -206,8 +206,8 @@ erDiagram
- `value`:
- `code`:
- `status`:
- `createAt`:
- `updateAt`:
- `createdAt`:
- `updatedAt`:

### `MovingRequest`

Expand All @@ -221,8 +221,8 @@ erDiagram
- `requestCount`:
- `designateCount`:
- `isDesignated`:
- `createAt`:
- `updateAt`:
- `createdAt`:
- `updatedAt`:
- `customerId`:

### `Quote`
Expand All @@ -231,17 +231,17 @@ erDiagram
- `id`:
- `cost`:
- `comment`:
- `createAt`:
- `updateAt`:
- `createdAt`:
- `updatedAt`:
- `movingRequestId`:
- `moverId`:

### `ConfirmedQuote`

**Properties**
- `id`:
- `createAt`:
- `updateAt`:
- `createdAt`:
- `updatedAt`:
- `movingRequestId`:
- `quoteId`:
- `customerId`:
Expand All @@ -254,8 +254,8 @@ erDiagram
- `content`:
- `rating`:
- `imageUrl`:
- `createAt`:
- `updateAt`:
- `createdAt`:
- `updatedAt`:
- `confirmedQuoteId`:
- `customerId`:
- `moverId`:
Expand All @@ -266,17 +266,17 @@ erDiagram
- `id`:
- `content`:
- `isRead`:
- `createAt`:
- `updateAt`:
- `createdAt`:
- `updatedAt`:
- `userId`:

### `ReviewComment`

**Properties**
- `id`:
- `content`:
- `createAt`:
- `updateAt`:
- `createdAt`:
- `updatedAt`:
- `reviewId`:
- `moverId`:

Expand All @@ -286,8 +286,8 @@ erDiagram
- `id`:
- `imageUrl`:
- `status`:
- `createAt`:
- `updateAt`:
- `createdAt`:
- `updatedAt`:
- `customerId`:
- `moverId`:

Expand Down
112 changes: 112 additions & 0 deletions prisma/migrations/20250106060446_update_date/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
/*
Warnings:

- You are about to drop the column `createAt` on the `ConfirmedQuote` table. All the data in the column will be lost.
- You are about to drop the column `updateAt` on the `ConfirmedQuote` table. All the data in the column will be lost.
- You are about to drop the column `createAt` on the `Customer` table. All the data in the column will be lost.
- You are about to drop the column `updateAt` on the `Customer` table. All the data in the column will be lost.
- You are about to drop the column `createAt` on the `Mover` table. All the data in the column will be lost.
- You are about to drop the column `updateAt` on the `Mover` table. All the data in the column will be lost.
- You are about to drop the column `createAt` on the `MovingRequest` table. All the data in the column will be lost.
- You are about to drop the column `updateAt` on the `MovingRequest` table. All the data in the column will be lost.
- You are about to drop the column `createAt` on the `ProfileImage` table. All the data in the column will be lost.
- You are about to drop the column `updateAt` on the `ProfileImage` table. All the data in the column will be lost.
- You are about to drop the column `createAt` on the `Quote` table. All the data in the column will be lost.
- You are about to drop the column `updateAt` on the `Quote` table. All the data in the column will be lost.
- You are about to drop the column `createAt` on the `Region` table. All the data in the column will be lost.
- You are about to drop the column `updateAt` on the `Region` table. All the data in the column will be lost.
- You are about to drop the column `createAt` on the `Review` table. All the data in the column will be lost.
- You are about to drop the column `updateAt` on the `Review` table. All the data in the column will be lost.
- You are about to drop the column `createAt` on the `ReviewComment` table. All the data in the column will be lost.
- You are about to drop the column `updateAt` on the `ReviewComment` table. All the data in the column will be lost.
- You are about to drop the column `createAt` on the `Service` table. All the data in the column will be lost.
- You are about to drop the column `updateAt` on the `Service` table. All the data in the column will be lost.
- You are about to drop the column `createAt` on the `User` table. All the data in the column will be lost.
- You are about to drop the column `updateAt` on the `User` table. All the data in the column will be lost.
- You are about to drop the column `createAt` on the `notification` table. All the data in the column will be lost.
- You are about to drop the column `updateAt` on the `notification` table. All the data in the column will be lost.
- Added the required column `updatedAt` to the `ConfirmedQuote` table without a default value. This is not possible if the table is not empty.
- Added the required column `updatedAt` to the `Customer` table without a default value. This is not possible if the table is not empty.
- Added the required column `updatedAt` to the `Mover` table without a default value. This is not possible if the table is not empty.
- Added the required column `updatedAt` to the `MovingRequest` table without a default value. This is not possible if the table is not empty.
- Added the required column `updatedAt` to the `ProfileImage` table without a default value. This is not possible if the table is not empty.
- Added the required column `updatedAt` to the `Quote` table without a default value. This is not possible if the table is not empty.
- Added the required column `updatedAt` to the `Region` table without a default value. This is not possible if the table is not empty.
- Added the required column `updatedAt` to the `Review` table without a default value. This is not possible if the table is not empty.
- Added the required column `updatedAt` to the `ReviewComment` table without a default value. This is not possible if the table is not empty.
- Added the required column `updatedAt` to the `Service` table without a default value. This is not possible if the table is not empty.
- Added the required column `updatedAt` to the `User` table without a default value. This is not possible if the table is not empty.
- Added the required column `updatedAt` to the `notification` table without a default value. This is not possible if the table is not empty.

*/
-- AlterTable
ALTER TABLE "ConfirmedQuote" DROP COLUMN "createAt",
DROP COLUMN "updateAt",
ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;

-- AlterTable
ALTER TABLE "Customer" DROP COLUMN "createAt",
DROP COLUMN "updateAt",
ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;

-- AlterTable
ALTER TABLE "Mover" DROP COLUMN "createAt",
DROP COLUMN "updateAt",
ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;

-- AlterTable
ALTER TABLE "MovingRequest" DROP COLUMN "createAt",
DROP COLUMN "updateAt",
ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;

-- AlterTable
ALTER TABLE "ProfileImage" DROP COLUMN "createAt",
DROP COLUMN "updateAt",
ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;

-- AlterTable
ALTER TABLE "Quote" DROP COLUMN "createAt",
DROP COLUMN "updateAt",
ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;

-- AlterTable
ALTER TABLE "Region" DROP COLUMN "createAt",
DROP COLUMN "updateAt",
ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;

-- AlterTable
ALTER TABLE "Review" DROP COLUMN "createAt",
DROP COLUMN "updateAt",
ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;

-- AlterTable
ALTER TABLE "ReviewComment" DROP COLUMN "createAt",
DROP COLUMN "updateAt",
ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;

-- AlterTable
ALTER TABLE "Service" DROP COLUMN "createAt",
DROP COLUMN "updateAt",
ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;

-- AlterTable
ALTER TABLE "User" DROP COLUMN "createAt",
DROP COLUMN "updateAt",
ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;

-- AlterTable
ALTER TABLE "notification" DROP COLUMN "createAt",
DROP COLUMN "updateAt",
ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;
Loading