Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
final-exam
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nawasan Wisitsingkhon
final-exam
Commits
50e809da
Commit
50e809da
authored
Oct 07, 2023
by
Nawasan Wisitsingkhon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove migrate
parent
42198965
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
0 additions
and
248 deletions
+0
-248
migration.sql
prisma/migrations/20230928134430_dev/migration.sql
+0
-10
migration.sql
prisma/migrations/20230929051549_dev/migration.sql
+0
-122
migration.sql
prisma/migrations/20230929051908_/migration.sql
+0
-92
migration.sql
prisma/migrations/20231001054534_/migration.sql
+0
-2
migration.sql
prisma/migrations/20231001054815_dev/migration.sql
+0
-2
migration.sql
prisma/migrations/20231001055031_dev/migration.sql
+0
-2
migration.sql
prisma/migrations/20231002144825_dev/migration.sql
+0
-14
migration_lock.toml
prisma/migrations/migration_lock.toml
+0
-4
No files found.
prisma/migrations/20230928134430_dev/migration.sql
deleted
100644 → 0
View file @
42198965
-- CreateTable
CREATE
TABLE
`users`
(
`id`
INTEGER
NOT
NULL
AUTO_INCREMENT
,
`name`
VARCHAR
(
191
)
NOT
NULL
,
`username`
VARCHAR
(
191
)
NOT
NULL
,
`password`
VARCHAR
(
191
)
NOT
NULL
,
UNIQUE
INDEX
`users_username_key`
(
`username`
),
PRIMARY
KEY
(
`id`
)
)
DEFAULT
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
;
prisma/migrations/20230929051549_dev/migration.sql
deleted
100644 → 0
View file @
42198965
/*
Warnings:
- You are about to drop the `users` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropTable
DROP
TABLE
`users`
;
-- CreateTable
CREATE
TABLE
`user`
(
`id`
INTEGER
NOT
NULL
AUTO_INCREMENT
,
`name`
VARCHAR
(
191
)
NOT
NULL
,
`email`
VARCHAR
(
191
)
NOT
NULL
,
`phone`
VARCHAR
(
191
)
NOT
NULL
,
`photo`
VARCHAR
(
191
)
NOT
NULL
,
`google_token`
VARCHAR
(
191
)
NOT
NULL
,
`username`
VARCHAR
(
191
)
NOT
NULL
,
`password`
VARCHAR
(
191
)
NOT
NULL
,
`rank`
BOOLEAN
NOT
NULL
,
`register_date`
DATETIME
(
3
)
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
(
3
),
UNIQUE
INDEX
`user_username_key`
(
`username`
),
PRIMARY
KEY
(
`id`
)
)
DEFAULT
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
;
-- CreateTable
CREATE
TABLE
`product`
(
`id`
INTEGER
NOT
NULL
AUTO_INCREMENT
,
`name`
VARCHAR
(
191
)
NOT
NULL
,
`detail`
VARCHAR
(
191
)
NOT
NULL
,
`price`
INTEGER
NOT
NULL
,
`discount`
INTEGER
NOT
NULL
,
`cateId`
INTEGER
NOT
NULL
,
`watch_count`
INTEGER
NOT
NULL
,
`buy_count`
INTEGER
NOT
NULL
,
`image`
VARCHAR
(
191
)
NOT
NULL
,
`stock`
INTEGER
NOT
NULL
,
PRIMARY
KEY
(
`id`
)
)
DEFAULT
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
;
-- CreateTable
CREATE
TABLE
`category`
(
`id`
INTEGER
NOT
NULL
AUTO_INCREMENT
,
`name`
VARCHAR
(
191
)
NOT
NULL
,
UNIQUE
INDEX
`category_name_key`
(
`name`
),
PRIMARY
KEY
(
`id`
)
)
DEFAULT
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
;
-- CreateTable
CREATE
TABLE
`wishlist`
(
`id`
INTEGER
NOT
NULL
AUTO_INCREMENT
,
`productId`
INTEGER
NOT
NULL
,
`userId`
INTEGER
NOT
NULL
,
`date`
DATETIME
(
3
)
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
(
3
),
PRIMARY
KEY
(
`id`
)
)
DEFAULT
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
;
-- CreateTable
CREATE
TABLE
`cart`
(
`id`
INTEGER
NOT
NULL
AUTO_INCREMENT
,
`userId`
INTEGER
NOT
NULL
,
`productId`
INTEGER
NOT
NULL
,
PRIMARY
KEY
(
`id`
)
)
DEFAULT
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
;
-- CreateTable
CREATE
TABLE
`order`
(
`id`
INTEGER
NOT
NULL
AUTO_INCREMENT
,
`userId`
INTEGER
NOT
NULL
,
`total_price`
INTEGER
NOT
NULL
,
`product_count`
INTEGER
NOT
NULL
,
`date`
DATETIME
(
3
)
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
(
3
),
`shipping_price`
INTEGER
NOT
NULL
,
`pay_status`
INTEGER
NOT
NULL
,
`send_status`
INTEGER
NOT
NULL
,
PRIMARY
KEY
(
`id`
)
)
DEFAULT
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
;
-- CreateTable
CREATE
TABLE
`order_detail`
(
`id`
INTEGER
NOT
NULL
AUTO_INCREMENT
,
`orderId`
INTEGER
NOT
NULL
,
`userId`
INTEGER
NOT
NULL
,
`productId`
INTEGER
NOT
NULL
,
`product_price`
INTEGER
NOT
NULL
,
`product_discount`
INTEGER
NOT
NULL
,
PRIMARY
KEY
(
`id`
)
)
DEFAULT
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
;
-- AddForeignKey
ALTER
TABLE
`product`
ADD
CONSTRAINT
`product_cateId_fkey`
FOREIGN
KEY
(
`cateId`
)
REFERENCES
`category`
(
`id`
)
ON
DELETE
RESTRICT
ON
UPDATE
CASCADE
;
-- AddForeignKey
ALTER
TABLE
`wishlist`
ADD
CONSTRAINT
`wishlist_productId_fkey`
FOREIGN
KEY
(
`productId`
)
REFERENCES
`product`
(
`id`
)
ON
DELETE
RESTRICT
ON
UPDATE
CASCADE
;
-- AddForeignKey
ALTER
TABLE
`wishlist`
ADD
CONSTRAINT
`wishlist_userId_fkey`
FOREIGN
KEY
(
`userId`
)
REFERENCES
`user`
(
`id`
)
ON
DELETE
RESTRICT
ON
UPDATE
CASCADE
;
-- AddForeignKey
ALTER
TABLE
`cart`
ADD
CONSTRAINT
`cart_userId_fkey`
FOREIGN
KEY
(
`userId`
)
REFERENCES
`user`
(
`id`
)
ON
DELETE
RESTRICT
ON
UPDATE
CASCADE
;
-- AddForeignKey
ALTER
TABLE
`cart`
ADD
CONSTRAINT
`cart_productId_fkey`
FOREIGN
KEY
(
`productId`
)
REFERENCES
`product`
(
`id`
)
ON
DELETE
RESTRICT
ON
UPDATE
CASCADE
;
-- AddForeignKey
ALTER
TABLE
`order`
ADD
CONSTRAINT
`order_userId_fkey`
FOREIGN
KEY
(
`userId`
)
REFERENCES
`user`
(
`id`
)
ON
DELETE
RESTRICT
ON
UPDATE
CASCADE
;
-- AddForeignKey
ALTER
TABLE
`order_detail`
ADD
CONSTRAINT
`order_detail_orderId_fkey`
FOREIGN
KEY
(
`orderId`
)
REFERENCES
`order`
(
`id`
)
ON
DELETE
RESTRICT
ON
UPDATE
CASCADE
;
-- AddForeignKey
ALTER
TABLE
`order_detail`
ADD
CONSTRAINT
`order_detail_userId_fkey`
FOREIGN
KEY
(
`userId`
)
REFERENCES
`user`
(
`id`
)
ON
DELETE
RESTRICT
ON
UPDATE
CASCADE
;
-- AddForeignKey
ALTER
TABLE
`order_detail`
ADD
CONSTRAINT
`order_detail_productId_fkey`
FOREIGN
KEY
(
`productId`
)
REFERENCES
`product`
(
`id`
)
ON
DELETE
RESTRICT
ON
UPDATE
CASCADE
;
prisma/migrations/20230929051908_/migration.sql
deleted
100644 → 0
View file @
42198965
/*
Warnings:
- You are about to drop the column `productId` on the `cart` table. All the data in the column will be lost.
- You are about to drop the column `userId` on the `cart` table. All the data in the column will be lost.
- You are about to drop the column `userId` on the `order` table. All the data in the column will be lost.
- You are about to drop the column `orderId` on the `order_detail` table. All the data in the column will be lost.
- You are about to drop the column `productId` on the `order_detail` table. All the data in the column will be lost.
- You are about to drop the column `userId` on the `order_detail` table. All the data in the column will be lost.
- You are about to drop the column `productId` on the `wishlist` table. All the data in the column will be lost.
- You are about to drop the column `userId` on the `wishlist` table. All the data in the column will be lost.
- Added the required column `product_id` to the `cart` table without a default value. This is not possible if the table is not empty.
- Added the required column `user_id` to the `cart` table without a default value. This is not possible if the table is not empty.
- Added the required column `user_id` to the `order` table without a default value. This is not possible if the table is not empty.
- Added the required column `order_id` to the `order_detail` table without a default value. This is not possible if the table is not empty.
- Added the required column `product_id` to the `order_detail` table without a default value. This is not possible if the table is not empty.
- Added the required column `user_id` to the `order_detail` table without a default value. This is not possible if the table is not empty.
- Added the required column `product_id` to the `wishlist` table without a default value. This is not possible if the table is not empty.
- Added the required column `user_id` to the `wishlist` table without a default value. This is not possible if the table is not empty.
*/
-- DropForeignKey
ALTER
TABLE
`cart`
DROP
FOREIGN
KEY
`cart_productId_fkey`
;
-- DropForeignKey
ALTER
TABLE
`cart`
DROP
FOREIGN
KEY
`cart_userId_fkey`
;
-- DropForeignKey
ALTER
TABLE
`order`
DROP
FOREIGN
KEY
`order_userId_fkey`
;
-- DropForeignKey
ALTER
TABLE
`order_detail`
DROP
FOREIGN
KEY
`order_detail_orderId_fkey`
;
-- DropForeignKey
ALTER
TABLE
`order_detail`
DROP
FOREIGN
KEY
`order_detail_productId_fkey`
;
-- DropForeignKey
ALTER
TABLE
`order_detail`
DROP
FOREIGN
KEY
`order_detail_userId_fkey`
;
-- DropForeignKey
ALTER
TABLE
`wishlist`
DROP
FOREIGN
KEY
`wishlist_productId_fkey`
;
-- DropForeignKey
ALTER
TABLE
`wishlist`
DROP
FOREIGN
KEY
`wishlist_userId_fkey`
;
-- AlterTable
ALTER
TABLE
`cart`
DROP
COLUMN
`productId`
,
DROP
COLUMN
`userId`
,
ADD
COLUMN
`product_id`
INTEGER
NOT
NULL
,
ADD
COLUMN
`user_id`
INTEGER
NOT
NULL
;
-- AlterTable
ALTER
TABLE
`order`
DROP
COLUMN
`userId`
,
ADD
COLUMN
`user_id`
INTEGER
NOT
NULL
;
-- AlterTable
ALTER
TABLE
`order_detail`
DROP
COLUMN
`orderId`
,
DROP
COLUMN
`productId`
,
DROP
COLUMN
`userId`
,
ADD
COLUMN
`order_id`
INTEGER
NOT
NULL
,
ADD
COLUMN
`product_id`
INTEGER
NOT
NULL
,
ADD
COLUMN
`user_id`
INTEGER
NOT
NULL
;
-- AlterTable
ALTER
TABLE
`wishlist`
DROP
COLUMN
`productId`
,
DROP
COLUMN
`userId`
,
ADD
COLUMN
`product_id`
INTEGER
NOT
NULL
,
ADD
COLUMN
`user_id`
INTEGER
NOT
NULL
;
-- AddForeignKey
ALTER
TABLE
`wishlist`
ADD
CONSTRAINT
`wishlist_product_id_fkey`
FOREIGN
KEY
(
`product_id`
)
REFERENCES
`product`
(
`id`
)
ON
DELETE
RESTRICT
ON
UPDATE
CASCADE
;
-- AddForeignKey
ALTER
TABLE
`wishlist`
ADD
CONSTRAINT
`wishlist_user_id_fkey`
FOREIGN
KEY
(
`user_id`
)
REFERENCES
`user`
(
`id`
)
ON
DELETE
RESTRICT
ON
UPDATE
CASCADE
;
-- AddForeignKey
ALTER
TABLE
`cart`
ADD
CONSTRAINT
`cart_user_id_fkey`
FOREIGN
KEY
(
`user_id`
)
REFERENCES
`user`
(
`id`
)
ON
DELETE
RESTRICT
ON
UPDATE
CASCADE
;
-- AddForeignKey
ALTER
TABLE
`cart`
ADD
CONSTRAINT
`cart_product_id_fkey`
FOREIGN
KEY
(
`product_id`
)
REFERENCES
`product`
(
`id`
)
ON
DELETE
RESTRICT
ON
UPDATE
CASCADE
;
-- AddForeignKey
ALTER
TABLE
`order`
ADD
CONSTRAINT
`order_user_id_fkey`
FOREIGN
KEY
(
`user_id`
)
REFERENCES
`user`
(
`id`
)
ON
DELETE
RESTRICT
ON
UPDATE
CASCADE
;
-- AddForeignKey
ALTER
TABLE
`order_detail`
ADD
CONSTRAINT
`order_detail_order_id_fkey`
FOREIGN
KEY
(
`order_id`
)
REFERENCES
`order`
(
`id`
)
ON
DELETE
RESTRICT
ON
UPDATE
CASCADE
;
-- AddForeignKey
ALTER
TABLE
`order_detail`
ADD
CONSTRAINT
`order_detail_user_id_fkey`
FOREIGN
KEY
(
`user_id`
)
REFERENCES
`user`
(
`id`
)
ON
DELETE
RESTRICT
ON
UPDATE
CASCADE
;
-- AddForeignKey
ALTER
TABLE
`order_detail`
ADD
CONSTRAINT
`order_detail_product_id_fkey`
FOREIGN
KEY
(
`product_id`
)
REFERENCES
`product`
(
`id`
)
ON
DELETE
RESTRICT
ON
UPDATE
CASCADE
;
prisma/migrations/20231001054534_/migration.sql
deleted
100644 → 0
View file @
42198965
-- AlterTable
ALTER
TABLE
`product`
MODIFY
`image`
LONGTEXT
NOT
NULL
;
prisma/migrations/20231001054815_dev/migration.sql
deleted
100644 → 0
View file @
42198965
-- AlterTable
ALTER
TABLE
`product`
MODIFY
`detail`
LONGTEXT
NOT
NULL
;
prisma/migrations/20231001055031_dev/migration.sql
deleted
100644 → 0
View file @
42198965
-- AlterTable
ALTER
TABLE
`user`
MODIFY
`photo`
LONGTEXT
NOT
NULL
;
prisma/migrations/20231002144825_dev/migration.sql
deleted
100644 → 0
View file @
42198965
/*
Warnings:
- Added the required column `count` to the `order_detail` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER
TABLE
`order`
ADD
COLUMN
`address`
LONGTEXT
NOT
NULL
DEFAULT
''
;
-- AlterTable
ALTER
TABLE
`order_detail`
ADD
COLUMN
`count`
INTEGER
NOT
NULL
;
-- AlterTable
ALTER
TABLE
`user`
ADD
COLUMN
`address`
LONGTEXT
NOT
NULL
DEFAULT
''
;
prisma/migrations/migration_lock.toml
deleted
100644 → 0
View file @
42198965
# Please do not edit this file manually
# It should be added in your version-control system (i.e. Git)
provider
=
"mysql"
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment