Skip to content

Commit

Permalink
Merge pull request #377 from barthuijgen/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
barthuijgen committed Apr 1, 2023
2 parents ad7ba8c + 1434aec commit c2bb09b
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
-- DropForeignKey
ALTER TABLE "comment" DROP CONSTRAINT "comment_blueprint_page_id_fkey";

-- DropForeignKey
ALTER TABLE "comment" DROP CONSTRAINT "comment_user_id_fkey";

-- DropForeignKey
ALTER TABLE "session" DROP CONSTRAINT "session_user_id_fkey";

-- DropForeignKey
ALTER TABLE "user_favorites" DROP CONSTRAINT "user_favorites_blueprint_page_id_fkey";

-- DropForeignKey
ALTER TABLE "user_favorites" DROP CONSTRAINT "user_favorites_user_id_fkey";

-- CreateTable
CREATE TABLE "blueprint_string" (
"id" UUID NOT NULL,
"hash" VARCHAR(40) NOT NULL,
"string" TEXT NOT NULL,

CONSTRAINT "blueprint_string_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE UNIQUE INDEX "blueprint_string_hash_key" ON "blueprint_string"("hash");

-- AddForeignKey
ALTER TABLE "session" ADD CONSTRAINT "session_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "user"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "user_favorites" ADD CONSTRAINT "user_favorites_blueprint_page_id_fkey" FOREIGN KEY ("blueprint_page_id") REFERENCES "blueprint_page"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "user_favorites" ADD CONSTRAINT "user_favorites_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "user"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "comment" ADD CONSTRAINT "comment_blueprint_page_id_fkey" FOREIGN KEY ("blueprint_page_id") REFERENCES "blueprint_page"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "comment" ADD CONSTRAINT "comment_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "user"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- RenameIndex
ALTER INDEX "blueprint.blueprint_hash_unique" RENAME TO "blueprint_blueprint_hash_key";

-- RenameIndex
ALTER INDEX "blueprint_book.blueprint_hash_unique" RENAME TO "blueprint_book_blueprint_hash_key";

-- RenameIndex
ALTER INDEX "blueprint_page.blueprint_book_id_unique" RENAME TO "blueprint_page_blueprint_book_id_key";

-- RenameIndex
ALTER INDEX "blueprint_page.blueprint_id_unique" RENAME TO "blueprint_page_blueprint_id_key";

-- RenameIndex
ALTER INDEX "blueprint_page.factorioprints_id_unique" RENAME TO "blueprint_page_factorioprints_id_key";

-- RenameIndex
ALTER INDEX "session.session_token_unique" RENAME TO "session_session_token_key";

-- RenameIndex
ALTER INDEX "user.email_unique" RENAME TO "user_email_key";

-- RenameIndex
ALTER INDEX "user.steam_id_unique" RENAME TO "user_steam_id_key";

-- RenameIndex
ALTER INDEX "user.username_unique" RENAME TO "user_username_key";
6 changes: 6 additions & 0 deletions apps/blueprints/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ model comment {
replies comment[] @relation("commentToComment")
}

model blueprint_string {
id String @id @default(uuid()) @db.Uuid
hash String @unique @db.VarChar(40)
string String @db.Text
}

model blueprint_entities {
entity String @unique
}
Expand Down
6 changes: 6 additions & 0 deletions apps/blueprints/src/components/blueprint/Blueprint.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useEffect, useState } from "react";
import Link from "next/link";
import Head from "next/head";
import { Grid, Box } from "@chakra-ui/react";
import styled from "@emotion/styled";
import { css } from "@emotion/react";
Expand Down Expand Up @@ -91,6 +92,11 @@ export const BlueprintSubPage: React.FC<BlueprintProps> = ({
<StyledBlueptintPage
templateColumns={chakraResponsive({ mobile: "1fr", desktop: "1fr 1fr 1fr 1fr" })}
>
<Head>
<title>
{(blueprint_page.title ? `${blueprint_page.title} - ` : "") + "Factorio blueprints"}
</title>
</Head>
<Panel
className="image"
gridColumn={chakraResponsive({ mobile: "1", desktop: "3 / span 2" })}
Expand Down
6 changes: 6 additions & 0 deletions apps/blueprints/src/components/blueprint/BlueprintBook.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useEffect, useMemo, useState } from "react";
import Link from "next/link";
import Head from "next/head";
import { Box, Grid } from "@chakra-ui/react";
import styled from "@emotion/styled";
import { css } from "@emotion/react";
Expand Down Expand Up @@ -142,6 +143,11 @@ export const BlueprintBookSubPage: React.FC<BlueprintBookSubPageProps> = ({
className="bp-book"
templateColumns={chakraResponsive({ mobile: "1fr", desktop: "1fr 1fr 1fr 1fr" })}
>
<Head>
<title>
{(blueprint_page.title ? `${blueprint_page.title} - ` : "") + "Factorio blueprints"}
</title>
</Head>
<Panel
className="child-tree"
title={
Expand Down

0 comments on commit c2bb09b

Please sign in to comment.