-
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.
feat(schema): schema.prisma updated to add Feed and Article models
- Loading branch information
=
committed
Nov 20, 2023
1 parent
f148482
commit 94e6547
Showing
10 changed files
with
85 additions
and
23 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
38 changes: 38 additions & 0 deletions
38
back/prisma/migrations/20231120141904_feed_and_article_creation/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,38 @@ | ||
-- CreateTable | ||
CREATE TABLE "Feed" ( | ||
"id" TEXT NOT NULL, | ||
"url" TEXT NOT NULL, | ||
|
||
CONSTRAINT "Feed_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Article" ( | ||
"id" TEXT NOT NULL, | ||
"title" TEXT NOT NULL, | ||
"url" TEXT NOT NULL, | ||
"image_url" TEXT, | ||
"content" TEXT NOT NULL, | ||
"published" TIMESTAMP(3) NOT NULL, | ||
"source_feed_id" TEXT NOT NULL, | ||
|
||
CONSTRAINT "Article_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Feed_id_key" ON "Feed"("id"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Feed_url_key" ON "Feed"("url"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Article_id_key" ON "Article"("id"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Article_url_key" ON "Article"("url"); | ||
|
||
-- CreateIndex | ||
CREATE INDEX "Article_source_feed_id_idx" ON "Article"("source_feed_id"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Article" ADD CONSTRAINT "Article_source_feed_id_fkey" FOREIGN KEY ("source_feed_id") REFERENCES "Feed"("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
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,12 +1,12 @@ | ||
import APIError from "./types/APIError"; | ||
import HttpStatusCode from "./types/HttpStatusCode"; | ||
import APIError from './types/APIError'; | ||
import HttpStatusCode from './types/HttpStatusCode'; | ||
|
||
export const ResourceNotFound: APIError = { | ||
id: "RESOURCE_NOT_FOUND", | ||
id: 'RESOURCE_NOT_FOUND', | ||
code: HttpStatusCode.NOT_FOUND_404, | ||
}; | ||
|
||
export const InvalidCredentials: APIError = { | ||
id: "INVALID_CREDENTIALS", | ||
id: 'INVALID_CREDENTIALS', | ||
code: HttpStatusCode.BAD_REQUEST_400, | ||
}; |
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
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 @@ | ||
type APIErrorId = "INVALID_CREDENTIALS" | "RESOURCE_NOT_FOUND" | "UNAUTHORIZED"; | ||
type APIErrorId = 'INVALID_CREDENTIALS' | 'RESOURCE_NOT_FOUND' | 'UNAUTHORIZED'; | ||
|
||
export default APIErrorId; |