Skip to content

Commit

Permalink
Merge pull request #16 from mrExplorist/db-migrations/workflows
Browse files Browse the repository at this point in the history
migration schemas and workflows merges db-migrations/workflows to main
  • Loading branch information
lalitdotdev authored May 31, 2024
2 parents ed33acb + fb8bbdb commit c532101
Show file tree
Hide file tree
Showing 7 changed files with 124 additions and 0 deletions.
Empty file modified .github/dependabot.yml
100644 → 100755
Empty file.
Empty file modified .github/workflows/dependency-review.yml
100644 → 100755
Empty file.
Empty file modified .github/workflows/label.yml
100644 → 100755
Empty file.
Empty file modified package-lock.json
100644 → 100755
Empty file.
Empty file modified package.json
100644 → 100755
Empty file.
121 changes: 121 additions & 0 deletions prisma/migrations/20240531104818_init_db_aiven/migration.sql
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;
3 changes: 3 additions & 0 deletions prisma/migrations/migration_lock.toml
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"

0 comments on commit c532101

Please sign in to comment.