-
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 #93 from icssc/data-model-andy
Schema tweaks
- Loading branch information
Showing
6 changed files
with
146 additions
and
147 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1 @@ | ||
# Since .env is gitignored, you can use .env.example to build a new `.env` file when you clone the repo. | ||
# Keep this file up-to-date when you add new variables to \`.env\`. | ||
|
||
# This file will be committed to version control, so make sure not to have any secrets in it. | ||
# If you are cloning this repo, create a copy of this file named `.env` and populate it with your secrets. | ||
|
||
# The database URL is used to connect to your PlanetScale database. | ||
DATABASE_URL='' | ||
|
||
# @see https://next-auth.js.org/configuration/options#nextauth_url | ||
AUTH_URL='http://localhost:3000' | ||
AUTH_REDIRECT_PROXY_URL="http://localhost:3001/api" | ||
|
||
# You can generate the secret via 'openssl rand -base64 32' on Unix | ||
# @see https://next-auth.js.org/configuration/options#secret | ||
AUTH_SECRET='supersecret' | ||
|
||
# Preconfigured Discord OAuth provider, works out-of-the-box | ||
# @see https://next-auth.js.org/providers/discord | ||
AUTH_DISCORD_ID='' | ||
AUTH_DISCORD_SECRET='' | ||
DATABASE_URL="" |
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
88 changes: 88 additions & 0 deletions
88
packages/db/prisma/migrations/20240203184145_/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,88 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `menuId` on the `Restaurant` table. All the data in the column will be lost. | ||
- You are about to drop the column `stationId` on the `Restaurant` table. All the data in the column will be lost. | ||
- You are about to drop the `DietaryRestrictionInfo` table. If the table is not empty, all the data it contains will be lost. | ||
- You are about to drop the `MenuPeriod` table. If the table is not empty, all the data it contains will be lost. | ||
- Added the required column `end` to the `Menu` table without a default value. This is not possible if the table is not empty. | ||
- Added the required column `period` to the `Menu` table without a default value. This is not possible if the table is not empty. | ||
- Added the required column `restaurantId` to the `Menu` table without a default value. This is not possible if the table is not empty. | ||
- Added the required column `start` to the `Menu` table without a default value. This is not possible if the table is not empty. | ||
- Added the required column `restaurantId` to the `Station` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- CreateEnum | ||
CREATE TYPE "MenuPeriod" AS ENUM ('BREAKFAST', 'BRUNCH', 'LUNCH', 'DINNER', 'LATENIGHT'); | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "DietaryRestrictionInfo" DROP CONSTRAINT "DietaryRestrictionInfo_dishId_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "MenuPeriod" DROP CONSTRAINT "MenuPeriod_menuId_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "Restaurant" DROP CONSTRAINT "Restaurant_menuId_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "Restaurant" DROP CONSTRAINT "Restaurant_stationId_fkey"; | ||
|
||
-- DropIndex | ||
DROP INDEX "Restaurant_menuId_key"; | ||
|
||
-- DropIndex | ||
DROP INDEX "Restaurant_stationId_key"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "Menu" ADD COLUMN "end" TIMESTAMP(3) NOT NULL, | ||
ADD COLUMN "period" "MenuPeriod" NOT NULL, | ||
ADD COLUMN "restaurantId" TEXT NOT NULL, | ||
ADD COLUMN "start" TIMESTAMP(3) NOT NULL; | ||
|
||
-- AlterTable | ||
ALTER TABLE "Restaurant" DROP COLUMN "menuId", | ||
DROP COLUMN "stationId"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "Station" ADD COLUMN "restaurantId" TEXT NOT NULL; | ||
|
||
-- DropTable | ||
DROP TABLE "DietaryRestrictionInfo"; | ||
|
||
-- DropTable | ||
DROP TABLE "MenuPeriod"; | ||
|
||
-- CreateTable | ||
CREATE TABLE "DietRestriction" ( | ||
"id" TEXT NOT NULL, | ||
"containsFish" BOOLEAN, | ||
"containsMilk" BOOLEAN, | ||
"containsPeanuts" BOOLEAN, | ||
"containsSesame" BOOLEAN, | ||
"containsShellfish" BOOLEAN, | ||
"containSoy" BOOLEAN, | ||
"containsTreeNuts" BOOLEAN, | ||
"containsWheat" BOOLEAN, | ||
"isGlutenFree" BOOLEAN, | ||
"isHalal" BOOLEAN, | ||
"isKosher" BOOLEAN, | ||
"isLocallyGrown" BOOLEAN, | ||
"isOrganic" BOOLEAN, | ||
"isVegan" BOOLEAN, | ||
"isVegetarian" BOOLEAN, | ||
"dishId" TEXT NOT NULL, | ||
|
||
CONSTRAINT "DietRestriction_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "DietRestriction_dishId_key" ON "DietRestriction"("dishId"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Station" ADD CONSTRAINT "Station_restaurantId_fkey" FOREIGN KEY ("restaurantId") REFERENCES "Restaurant"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Menu" ADD CONSTRAINT "Menu_restaurantId_fkey" FOREIGN KEY ("restaurantId") REFERENCES "Restaurant"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "DietRestriction" ADD CONSTRAINT "DietRestriction_dishId_fkey" FOREIGN KEY ("dishId") REFERENCES "Dish"("id") ON DELETE RESTRICT ON UPDATE CASCADE; |
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
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 @@ | ||
import { z } from "zod"; | ||
|
||
export const GetMenuSchema = z.object({}); |