-
-
Notifications
You must be signed in to change notification settings - Fork 0
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 #203 from codeanker/feature/landing-settings
Feature/landing settings
- Loading branch information
Showing
53 changed files
with
1,442 additions
and
462 deletions.
There are no files selected for viewing
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
This file was deleted.
Oops, something went wrong.
104 changes: 104 additions & 0 deletions
104
api/prisma/migrations/20250203181204_public_landing/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,104 @@ | ||
-- DropForeignKey | ||
ALTER TABLE "Person" DROP CONSTRAINT "Person_photoId_fkey"; | ||
|
||
-- CreateTable | ||
CREATE TABLE "faq_categories" ( | ||
"id" SERIAL NOT NULL, | ||
"name" TEXT NOT NULL, | ||
"unterveranstaltungId" INTEGER NOT NULL, | ||
|
||
CONSTRAINT "faq_categories_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "faqs" ( | ||
"id" SERIAL NOT NULL, | ||
"question" TEXT NOT NULL, | ||
"answer" TEXT NOT NULL, | ||
"categoryId" INTEGER NOT NULL, | ||
|
||
CONSTRAINT "faqs_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "UnterveranstaltungLandingSettings" ( | ||
"unterveranstaltungId" SERIAL NOT NULL, | ||
"heroTitle" TEXT NOT NULL, | ||
"heroSubtitle" TEXT NOT NULL, | ||
"eventDetailsTitle" TEXT NOT NULL, | ||
"eventDetailsContent" TEXT NOT NULL, | ||
"miscellaneousVisible" BOOLEAN, | ||
"miscellaneousTitle" TEXT, | ||
"faqVisible" BOOLEAN, | ||
"faqEmail" TEXT, | ||
"instagramVisible" BOOLEAN, | ||
"instagramUrl" TEXT, | ||
"facebookVisible" BOOLEAN, | ||
"facebookUrl" TEXT, | ||
|
||
CONSTRAINT "UnterveranstaltungLandingSettings_pkey" PRIMARY KEY ("unterveranstaltungId") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "UnterveranstaltungLandingImages" ( | ||
"id" SERIAL NOT NULL, | ||
"name" TEXT, | ||
"unterveranstaltungLandingSettingsId" INTEGER, | ||
"fileId" TEXT NOT NULL, | ||
|
||
CONSTRAINT "UnterveranstaltungLandingImages_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "UnterveranstaltungLandingMiscellaneous" ( | ||
"id" SERIAL NOT NULL, | ||
"title" TEXT NOT NULL, | ||
"content" TEXT NOT NULL, | ||
"unterveranstaltungLandingSettingsId" INTEGER, | ||
|
||
CONSTRAINT "UnterveranstaltungLandingMiscellaneous_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "_FaqToUnterveranstaltung" ( | ||
"A" INTEGER NOT NULL, | ||
"B" INTEGER NOT NULL, | ||
|
||
CONSTRAINT "_FaqToUnterveranstaltung_AB_pkey" PRIMARY KEY ("A","B") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "faq_categories_name_unterveranstaltungId_key" ON "faq_categories"("name", "unterveranstaltungId"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "UnterveranstaltungLandingImages_fileId_key" ON "UnterveranstaltungLandingImages"("fileId"); | ||
|
||
-- CreateIndex | ||
CREATE INDEX "_FaqToUnterveranstaltung_B_index" ON "_FaqToUnterveranstaltung"("B"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "faq_categories" ADD CONSTRAINT "faq_categories_unterveranstaltungId_fkey" FOREIGN KEY ("unterveranstaltungId") REFERENCES "Unterveranstaltung"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "faqs" ADD CONSTRAINT "faqs_categoryId_fkey" FOREIGN KEY ("categoryId") REFERENCES "faq_categories"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Person" ADD CONSTRAINT "Person_photoId_fkey" FOREIGN KEY ("photoId") REFERENCES "File"("id") ON DELETE SET NULL ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "UnterveranstaltungLandingSettings" ADD CONSTRAINT "UnterveranstaltungLandingSettings_unterveranstaltungId_fkey" FOREIGN KEY ("unterveranstaltungId") REFERENCES "Unterveranstaltung"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "UnterveranstaltungLandingImages" ADD CONSTRAINT "UnterveranstaltungLandingImages_unterveranstaltungLandingS_fkey" FOREIGN KEY ("unterveranstaltungLandingSettingsId") REFERENCES "UnterveranstaltungLandingSettings"("unterveranstaltungId") ON DELETE SET NULL ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "UnterveranstaltungLandingImages" ADD CONSTRAINT "UnterveranstaltungLandingImages_fileId_fkey" FOREIGN KEY ("fileId") REFERENCES "File"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "UnterveranstaltungLandingMiscellaneous" ADD CONSTRAINT "UnterveranstaltungLandingMiscellaneous_unterveranstaltungL_fkey" FOREIGN KEY ("unterveranstaltungLandingSettingsId") REFERENCES "UnterveranstaltungLandingSettings"("unterveranstaltungId") ON DELETE SET NULL ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "_FaqToUnterveranstaltung" ADD CONSTRAINT "_FaqToUnterveranstaltung_A_fkey" FOREIGN KEY ("A") REFERENCES "faqs"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "_FaqToUnterveranstaltung" ADD CONSTRAINT "_FaqToUnterveranstaltung_B_fkey" FOREIGN KEY ("B") REFERENCES "Unterveranstaltung"("id") ON DELETE CASCADE ON UPDATE CASCADE; |
34 changes: 34 additions & 0 deletions
34
api/prisma/migrations/20250204082400_edit_landing_relation/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,34 @@ | ||
/* | ||
Warnings: | ||
- The primary key for the `_AnmeldungToMahlzeit` table will be changed. If it partially fails, the table could be left without primary key constraint. | ||
- The primary key for the `_FaqToUnterveranstaltung` table will be changed. If it partially fails, the table could be left without primary key constraint. | ||
- A unique constraint covering the columns `[landingSettingsId]` on the table `Unterveranstaltung` will be added. If there are existing duplicate values, this will fail. | ||
- A unique constraint covering the columns `[A,B]` on the table `_AnmeldungToMahlzeit` will be added. If there are existing duplicate values, this will fail. | ||
- A unique constraint covering the columns `[A,B]` on the table `_FaqToUnterveranstaltung` will be added. If there are existing duplicate values, this will fail. | ||
- Added the required column `landingSettingsId` to the `Unterveranstaltung` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- DropForeignKey | ||
ALTER TABLE "UnterveranstaltungLandingSettings" DROP CONSTRAINT "UnterveranstaltungLandingSettings_unterveranstaltungId_fkey"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "Unterveranstaltung" ADD COLUMN "landingSettingsId" INTEGER NOT NULL; | ||
|
||
-- AlterTable | ||
ALTER TABLE "_AnmeldungToMahlzeit" DROP CONSTRAINT "_AnmeldungToMahlzeit_AB_pkey"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "_FaqToUnterveranstaltung" DROP CONSTRAINT "_FaqToUnterveranstaltung_AB_pkey"; | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Unterveranstaltung_landingSettingsId_key" ON "Unterveranstaltung"("landingSettingsId"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "_AnmeldungToMahlzeit_AB_unique" ON "_AnmeldungToMahlzeit"("A", "B"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "_FaqToUnterveranstaltung_AB_unique" ON "_FaqToUnterveranstaltung"("A", "B"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Unterveranstaltung" ADD CONSTRAINT "Unterveranstaltung_landingSettingsId_fkey" FOREIGN KEY ("landingSettingsId") REFERENCES "UnterveranstaltungLandingSettings"("unterveranstaltungId") ON DELETE CASCADE ON UPDATE CASCADE; |
2 changes: 2 additions & 0 deletions
2
api/prisma/migrations/20250204090657_add_subtitle/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,2 @@ | ||
-- AlterTable | ||
ALTER TABLE "UnterveranstaltungLandingSettings" ADD COLUMN "miscellaneousSubtitle" TEXT; |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Please do not edit this file manually | ||
# It should be added in your version-control system (e.g., Git) | ||
# It should be added in your version-control system (i.e. Git) | ||
provider = "postgresql" |
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 |
---|---|---|
@@ -1,14 +1,24 @@ | ||
model FaqCategory { | ||
id Int @id @default(autoincrement()) | ||
name String | ||
FAQ Faq[] | ||
unterveranstaltungId Int | ||
unterveranstaltung Unterveranstaltung @relation(fields: [unterveranstaltungId], references: [id]) | ||
faqs Faq[] | ||
@@unique([name, unterveranstaltungId]) | ||
@@map("faq_categories") | ||
} | ||
|
||
model Faq { | ||
id Int @id @default(autoincrement()) | ||
categoryId Int | ||
category FaqCategory @relation(fields: [categoryId], references: [id]) | ||
question String | ||
answer String | ||
id Int @id @default(autoincrement()) | ||
question String | ||
answer String | ||
categoryId Int | ||
category FaqCategory @relation(fields: [categoryId], references: [id]) | ||
unterveranstaltung Unterveranstaltung[] | ||
@@map("faqs") | ||
} |
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
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,46 @@ | ||
model UnterveranstaltungLandingSettings { | ||
unterveranstaltungId Int @id @default(autoincrement()) | ||
unterveranstaltung Unterveranstaltung? | ||
heroTitle String | ||
heroSubtitle String | ||
heroImages UnterveranstaltungLandingImages[] | ||
eventDetailsTitle String | ||
eventDetailsContent String | ||
miscellaneousVisible Boolean? | ||
miscellaneousTitle String? | ||
miscellaneousSubtitle String? | ||
miscellaneousItems UnterveranstaltungLandingMiscellaneous[] | ||
faqVisible Boolean? | ||
faqEmail String? | ||
instagramVisible Boolean? | ||
instagramUrl String? | ||
facebookVisible Boolean? | ||
facebookUrl String? | ||
} | ||
|
||
model UnterveranstaltungLandingImages { | ||
id Int @id @default(autoincrement()) | ||
name String? | ||
UnterveranstaltungLandingSettings UnterveranstaltungLandingSettings? @relation(fields: [unterveranstaltungLandingSettingsId], references: [unterveranstaltungId]) | ||
unterveranstaltungLandingSettingsId Int? | ||
file File @relation(fields: [fileId], references: [id]) | ||
fileId String @unique | ||
} | ||
|
||
model UnterveranstaltungLandingMiscellaneous { | ||
id Int @id @default(autoincrement()) | ||
title String | ||
content String | ||
UnterveranstaltungLandingSettings UnterveranstaltungLandingSettings? @relation(fields: [unterveranstaltungLandingSettingsId], references: [unterveranstaltungId]) | ||
unterveranstaltungLandingSettingsId Int? | ||
} |
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
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
Oops, something went wrong.