mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-20 03:31:13 +10:00
chore: commit prototype
This commit is contained in:
@ -0,0 +1,32 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- Added the required column `mCoverObjectId` to the `Company` table without a default value. This is not possible if the table is not empty.
|
||||
|
||||
*/
|
||||
-- CreateEnum
|
||||
CREATE TYPE "StoreComponentType" AS ENUM ('BigCarousel', 'SmallCarousel');
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "Company" ADD COLUMN "mCoverObjectId" TEXT NOT NULL;
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "StorePage" (
|
||||
"url" TEXT NOT NULL,
|
||||
"acls" TEXT[] DEFAULT ARRAY[]::TEXT[],
|
||||
|
||||
CONSTRAINT "StorePage_pkey" PRIMARY KEY ("url")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "StoreComponent" (
|
||||
"id" TEXT NOT NULL,
|
||||
"type" "StoreComponentType" NOT NULL,
|
||||
"configuration" JSONB NOT NULL,
|
||||
"pageUrl" TEXT,
|
||||
|
||||
CONSTRAINT "StoreComponent_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "StoreComponent" ADD CONSTRAINT "StoreComponent_pageUrl_fkey" FOREIGN KEY ("pageUrl") REFERENCES "StorePage"("url") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
@ -157,6 +157,7 @@ model Company {
|
||||
mShortDescription String
|
||||
mDescription String
|
||||
mLogoObjectId String
|
||||
mCoverObjectId String
|
||||
mBannerObjectId String
|
||||
mWebsite String
|
||||
|
||||
|
||||
21
prisma/models/store.prisma
Normal file
21
prisma/models/store.prisma
Normal file
@ -0,0 +1,21 @@
|
||||
model StorePage {
|
||||
url String @id
|
||||
components StoreComponent[]
|
||||
|
||||
acls String[] @default([]) // Empty ACL means just "store:read"
|
||||
}
|
||||
|
||||
enum StoreComponentType {
|
||||
BigCarousel
|
||||
SmallCarousel
|
||||
}
|
||||
|
||||
model StoreComponent {
|
||||
id String @id
|
||||
|
||||
type StoreComponentType
|
||||
configuration Json
|
||||
|
||||
pageUrl String?
|
||||
page StorePage? @relation(fields: [pageUrl], references: [url])
|
||||
}
|
||||
Reference in New Issue
Block a user