-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from mrExplorist/db-migrations/workflows
migration schemas and workflows merges db-migrations/workflows to main
- Loading branch information
Showing
7 changed files
with
124 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
121 changes: 121 additions & 0 deletions
121
prisma/migrations/20240531104818_init_db_aiven/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
-- CreateTable | ||
CREATE TABLE `Store` ( | ||
`id` VARCHAR(191) NOT NULL, | ||
`name` VARCHAR(191) NOT NULL, | ||
`userId` VARCHAR(191) NOT NULL, | ||
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), | ||
`updatedAt` DATETIME(3) NOT NULL, | ||
|
||
PRIMARY KEY (`id`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|
||
-- CreateTable | ||
CREATE TABLE `Billboard` ( | ||
`id` VARCHAR(191) NOT NULL, | ||
`storeId` VARCHAR(191) NOT NULL, | ||
`label` VARCHAR(191) NOT NULL, | ||
`imageUrl` VARCHAR(191) NOT NULL, | ||
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), | ||
`updatedAt` DATETIME(3) NOT NULL, | ||
|
||
INDEX `Billboard_storeId_idx`(`storeId`), | ||
PRIMARY KEY (`id`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|
||
-- CreateTable | ||
CREATE TABLE `Category` ( | ||
`id` VARCHAR(191) NOT NULL, | ||
`storeId` VARCHAR(191) NOT NULL, | ||
`billboardId` VARCHAR(191) NOT NULL, | ||
`name` VARCHAR(191) NOT NULL, | ||
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), | ||
`updatedAt` DATETIME(3) NOT NULL, | ||
|
||
INDEX `Category_storeId_idx`(`storeId`), | ||
INDEX `Category_billboardId_idx`(`billboardId`), | ||
PRIMARY KEY (`id`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|
||
-- CreateTable | ||
CREATE TABLE `Size` ( | ||
`id` VARCHAR(191) NOT NULL, | ||
`storeId` VARCHAR(191) NOT NULL, | ||
`name` VARCHAR(191) NOT NULL, | ||
`value` VARCHAR(191) NOT NULL, | ||
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), | ||
`updatedAt` DATETIME(3) NOT NULL, | ||
|
||
INDEX `Size_storeId_idx`(`storeId`), | ||
PRIMARY KEY (`id`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|
||
-- CreateTable | ||
CREATE TABLE `Color` ( | ||
`id` VARCHAR(191) NOT NULL, | ||
`storeId` VARCHAR(191) NOT NULL, | ||
`name` VARCHAR(191) NOT NULL, | ||
`value` VARCHAR(191) NOT NULL, | ||
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), | ||
`updatedAt` DATETIME(3) NOT NULL, | ||
|
||
INDEX `Color_storeId_idx`(`storeId`), | ||
PRIMARY KEY (`id`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|
||
-- CreateTable | ||
CREATE TABLE `Product` ( | ||
`id` VARCHAR(191) NOT NULL, | ||
`storeId` VARCHAR(191) NOT NULL, | ||
`categoryId` VARCHAR(191) NOT NULL, | ||
`name` VARCHAR(191) NOT NULL, | ||
`price` DECIMAL(65, 30) NOT NULL, | ||
`isFeatured` BOOLEAN NOT NULL DEFAULT false, | ||
`isArchived` BOOLEAN NOT NULL DEFAULT false, | ||
`sizeId` VARCHAR(191) NOT NULL, | ||
`colorId` VARCHAR(191) NOT NULL, | ||
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), | ||
`updatedAt` DATETIME(3) NOT NULL, | ||
|
||
INDEX `Product_storeId_idx`(`storeId`), | ||
INDEX `Product_categoryId_idx`(`categoryId`), | ||
INDEX `Product_sizeId_idx`(`sizeId`), | ||
INDEX `Product_colorId_idx`(`colorId`), | ||
PRIMARY KEY (`id`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|
||
-- CreateTable | ||
CREATE TABLE `Image` ( | ||
`id` VARCHAR(191) NOT NULL, | ||
`productId` VARCHAR(191) NOT NULL, | ||
`url` VARCHAR(191) NOT NULL, | ||
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), | ||
`updatedAt` DATETIME(3) NOT NULL, | ||
|
||
INDEX `Image_productId_idx`(`productId`), | ||
PRIMARY KEY (`id`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|
||
-- CreateTable | ||
CREATE TABLE `Order` ( | ||
`id` VARCHAR(191) NOT NULL, | ||
`storeId` VARCHAR(191) NOT NULL, | ||
`isPaid` BOOLEAN NOT NULL DEFAULT false, | ||
`phone` VARCHAR(191) NOT NULL DEFAULT '', | ||
`address` VARCHAR(191) NOT NULL DEFAULT '', | ||
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), | ||
`updatedAt` DATETIME(3) NOT NULL, | ||
|
||
INDEX `Order_storeId_idx`(`storeId`), | ||
PRIMARY KEY (`id`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|
||
-- CreateTable | ||
CREATE TABLE `OrderItem` ( | ||
`id` VARCHAR(191) NOT NULL, | ||
`orderId` VARCHAR(191) NOT NULL, | ||
`productId` VARCHAR(191) NOT NULL, | ||
|
||
INDEX `OrderItem_orderId_idx`(`orderId`), | ||
INDEX `OrderItem_productId_idx`(`productId`), | ||
PRIMARY KEY (`id`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Please do not edit this file manually | ||
# It should be added in your version-control system (i.e. Git) | ||
provider = "mysql" |