-
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.
agrega data persistente para las direcciones
- Loading branch information
1 parent
685f88f
commit 01743a6
Showing
6 changed files
with
296 additions
and
186 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
prisma/migrations/20241028235939_user_address/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,32 @@ | ||
-- CreateTable | ||
CREATE TABLE "Country" ( | ||
"id" TEXT NOT NULL, | ||
"name" TEXT NOT NULL, | ||
|
||
CONSTRAINT "Country_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "UserAddress" ( | ||
"id" TEXT NOT NULL, | ||
"firstName" TEXT NOT NULL, | ||
"lastName" TEXT NOT NULL, | ||
"address" TEXT NOT NULL, | ||
"address2" TEXT NOT NULL, | ||
"postalCode" TEXT NOT NULL, | ||
"phone" TEXT NOT NULL, | ||
"city" TEXT NOT NULL, | ||
"countryId" TEXT NOT NULL, | ||
"userId" TEXT NOT NULL, | ||
|
||
CONSTRAINT "UserAddress_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "UserAddress_userId_key" ON "UserAddress"("userId"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "UserAddress" ADD CONSTRAINT "UserAddress_countryId_fkey" FOREIGN KEY ("countryId") REFERENCES "Country"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "UserAddress" ADD CONSTRAINT "UserAddress_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("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
Oops, something went wrong.