-
Notifications
You must be signed in to change notification settings - Fork 3
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 #8 from Varkoff/05-build-that-app
Build That App
- Loading branch information
Showing
37 changed files
with
2,312 additions
and
115 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"tabWidth": 2, | ||
"useTabs": false | ||
} |
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
34 changes: 34 additions & 0 deletions
34
backend/prisma/migrations/20240512104520_add_offers_and_transactions/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 @@ | ||
-- CreateTable | ||
CREATE TABLE "Offer" ( | ||
"id" TEXT NOT NULL, | ||
"title" TEXT NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3) NOT NULL, | ||
"description" TEXT NOT NULL, | ||
"price" DOUBLE PRECISION NOT NULL, | ||
"active" BOOLEAN NOT NULL DEFAULT false, | ||
"recurring" BOOLEAN NOT NULL DEFAULT false, | ||
"userId" TEXT NOT NULL, | ||
|
||
CONSTRAINT "Offer_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Transaction" ( | ||
"id" TEXT NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3) NOT NULL, | ||
"offerId" TEXT NOT NULL, | ||
"userId" TEXT NOT NULL, | ||
|
||
CONSTRAINT "Transaction_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Offer" ADD CONSTRAINT "Offer_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Transaction" ADD CONSTRAINT "Transaction_offerId_fkey" FOREIGN KEY ("offerId") REFERENCES "Offer"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Transaction" ADD CONSTRAINT "Transaction_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; |
8 changes: 8 additions & 0 deletions
8
backend/prisma/migrations/20240514173402_unique_user_offer/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,8 @@ | ||
/* | ||
Warnings: | ||
- A unique constraint covering the columns `[offerId,userId]` on the table `Transaction` will be added. If there are existing duplicate values, this will fail. | ||
*/ | ||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Transaction_offerId_userId_key" ON "Transaction"("offerId", "userId"); |
17 changes: 17 additions & 0 deletions
17
backend/prisma/migrations/20240528171404_messages/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,17 @@ | ||
-- CreateTable | ||
CREATE TABLE "Message" ( | ||
"id" TEXT NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3) NOT NULL, | ||
"content" TEXT NOT NULL, | ||
"userId" TEXT NOT NULL, | ||
"transactionId" TEXT NOT NULL, | ||
|
||
CONSTRAINT "Message_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Message" ADD CONSTRAINT "Message_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Message" ADD CONSTRAINT "Message_transactionId_fkey" FOREIGN KEY ("transactionId") REFERENCES "Transaction"("id") ON DELETE RESTRICT ON UPDATE CASCADE; |
3 changes: 3 additions & 0 deletions
3
backend/prisma/migrations/20240601114100_add_offer_in_message/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,3 @@ | ||
-- AlterTable | ||
ALTER TABLE "Message" ADD COLUMN "price" DOUBLE PRECISION, | ||
ADD COLUMN "status" INTEGER DEFAULT 0; |
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
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,64 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.7.1/schema.json", | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"files": { | ||
"ignore": ["**/*.json"] | ||
}, | ||
|
||
"formatter": { | ||
"enabled": true, | ||
"indentStyle": "space", | ||
"indentWidth": 2 | ||
}, | ||
"javascript": { | ||
"parser": { | ||
"unsafeParameterDecoratorsEnabled": true | ||
} | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": true, | ||
"correctness": { | ||
"noUnusedImports": "error", | ||
"noUnusedVariables": "error", | ||
"useExhaustiveDependencies": "off", | ||
"noUnsafeOptionalChaining": "off" | ||
}, | ||
"style": { | ||
"noUnusedTemplateLiteral": "off", | ||
"useTemplate": "off", | ||
"useSelfClosingElements": "off", | ||
"noParameterAssign": "off", | ||
"noUselessElse": "off", | ||
"useImportType": "off" | ||
}, | ||
"security": { | ||
"noDangerouslySetInnerHtml": "off" | ||
}, | ||
"a11y": { | ||
"useButtonType": "off", | ||
"noSvgWithoutTitle": "off", | ||
"noAutofocus": "off" | ||
}, | ||
"complexity": { | ||
"noUselessFragments": "off", | ||
"useLiteralKeys": "off", | ||
"noForEach": "off", | ||
"useOptionalChain": "off" | ||
}, | ||
"suspicious": { | ||
"noArrayIndexKey": "off", | ||
"noExplicitAny": "off", | ||
"noMisleadingCharacterClass": "off", | ||
"noAssignInExpressions": "off", | ||
"noShadowRestrictedNames": "off", | ||
"noGlobalIsNan": "off", | ||
"useDefaultSwitchClauseLast": "off" | ||
} | ||
} | ||
} | ||
} | ||
|
Binary file not shown.
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.