-
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.
- Loading branch information
Showing
20 changed files
with
922 additions
and
104 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
prisma/migrations/20241226210647_added_spec_snapshot/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,27 @@ | ||
-- CreateTable | ||
CREATE TABLE "Specification" ( | ||
"id" SERIAL NOT NULL, | ||
"uuid" TEXT NOT NULL, | ||
"name" TEXT NOT NULL, | ||
|
||
CONSTRAINT "Specification_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "SpecificationSnapshot" ( | ||
"id" SERIAL NOT NULL, | ||
"uuid" TEXT NOT NULL, | ||
"specId" INTEGER NOT NULL, | ||
"prevSnapshotId" TEXT NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"versionNum" INTEGER NOT NULL, | ||
"content" TEXT NOT NULL, | ||
|
||
CONSTRAINT "SpecificationSnapshot_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "SpecificationSnapshot_prevSnapshotId_key" ON "SpecificationSnapshot"("prevSnapshotId"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "SpecificationSnapshot" ADD CONSTRAINT "SpecificationSnapshot_specId_fkey" FOREIGN KEY ("specId") REFERENCES "Specification"("id") ON DELETE CASCADE ON UPDATE CASCADE; |
26 changes: 26 additions & 0 deletions
26
prisma/migrations/20241226211957_created_spec_owner/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,26 @@ | ||
/* | ||
Warnings: | ||
- Added the required column `userId` to the `SpecificationSnapshot` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "SpecificationSnapshot" ADD COLUMN "userId" INTEGER NOT NULL; | ||
|
||
-- CreateTable | ||
CREATE TABLE "BridgeUserAndSpecfication" ( | ||
"id" SERIAL NOT NULL, | ||
"userId" INTEGER NOT NULL, | ||
"specId" INTEGER NOT NULL, | ||
|
||
CONSTRAINT "BridgeUserAndSpecfication_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "BridgeUserAndSpecfication" ADD CONSTRAINT "BridgeUserAndSpecfication_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "BridgeUserAndSpecfication" ADD CONSTRAINT "BridgeUserAndSpecfication_specId_fkey" FOREIGN KEY ("specId") REFERENCES "Specification"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "SpecificationSnapshot" ADD CONSTRAINT "SpecificationSnapshot_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; |
1 change: 1 addition & 0 deletions
1
prisma/migrations/20241226213551_updated_field_name/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 @@ | ||
-- This is an empty migration. |
16 changes: 16 additions & 0 deletions
16
prisma/migrations/20241226213753_updated_field_name/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,16 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `userId` on the `SpecificationSnapshot` table. All the data in the column will be lost. | ||
- Added the required column `creatorId` to the `SpecificationSnapshot` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- DropForeignKey | ||
ALTER TABLE "SpecificationSnapshot" DROP CONSTRAINT "SpecificationSnapshot_userId_fkey"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "SpecificationSnapshot" DROP COLUMN "userId", | ||
ADD COLUMN "creatorId" INTEGER NOT NULL; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "SpecificationSnapshot" ADD CONSTRAINT "SpecificationSnapshot_creatorId_fkey" FOREIGN KEY ("creatorId") REFERENCES "User"("id") ON DELETE CASCADE 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
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 (i.e. Git) | ||
# It should be added in your version-control system (e.g., 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
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,8 @@ | ||
POST localhost:5173/api/spec/createSpec | ||
Cookie: sessionToken=wm6yy37jowyacj73eqvdelxliyrkxc3z;HttpOnly=true;SameSite=Lax;Expires=2025-01-21T18:28:11.755Z;Path=/; | ||
|
||
{ | ||
"name": "firstSpec", | ||
"creatorUserId": "83edaa20-9f3c-49ae-b078-c10d496c27f3" | ||
} | ||
|
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,6 @@ | ||
POST localhost:5173/api/spec/getLatestSpecById | ||
Cookie: sessionToken=wm6yy37jowyacj73eqvdelxliyrkxc3z;HttpOnly=true;SameSite=Lax;Expires=2025-01-21T18:28:11.755Z;Path=/; | ||
|
||
{ | ||
"id": "97ce9b27-016f-4929-9cf9-aae2cded9d99" | ||
} |
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,6 @@ | ||
POST localhost:5173/api/spec/getSpecs | ||
Cookie: sessionToken=wm6yy37jowyacj73eqvdelxliyrkxc3z;HttpOnly=true;SameSite=Lax;Expires=2025-01-21T18:28:11.755Z;Path=/; | ||
|
||
{ | ||
"userId": "83edaa20-9f3c-49ae-b078-c10d496c27f3" | ||
} |
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,10 @@ | ||
POST localhost:5173/api/spec/updateSpec | ||
Cookie: sessionToken=wm6yy37jowyacj73eqvdelxliyrkxc3z;HttpOnly=true;SameSite=Lax;Expires=2025-01-21T18:28:11.755Z;Path=/; | ||
|
||
{ | ||
"specId": "97ce9b27-016f-4929-9cf9-aae2cded9d99", | ||
"content": "hello world", | ||
"prevSpecSnapshotId": "54fce999-8e6a-482f-b7d8-b4837b1fe66c", | ||
"updatorUserId": "83edaa20-9f3c-49ae-b078-c10d496c27f3" | ||
} | ||
|
Oops, something went wrong.