-
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.
Signed-off-by: Amit Amrutiya <[email protected]>
- Loading branch information
1 parent
1421f26
commit 4bbe1bb
Showing
18 changed files
with
187 additions
and
63 deletions.
There are no files selected for viewing
2 changes: 0 additions & 2 deletions
2
frontend/prisma/migrations/20240627052059_remove/migration.sql
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
44 changes: 44 additions & 0 deletions
44
frontend/prisma/migrations/20240628062328_make_some_optional_field/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,44 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the `users` table. If the table is not empty, all the data it contains will be lost. | ||
*/ | ||
-- DropForeignKey | ||
ALTER TABLE "chats" DROP CONSTRAINT "chats_userId_fkey"; | ||
|
||
-- DropTable | ||
DROP TABLE "users"; | ||
|
||
-- CreateTable | ||
CREATE TABLE "user" ( | ||
"_id" TEXT NOT NULL, | ||
"email" TEXT, | ||
"password" TEXT, | ||
"username" TEXT, | ||
"fullname" TEXT, | ||
"profile_image" TEXT, | ||
"bio" TEXT NOT NULL DEFAULT 'Hey there! I am available on ChatApp', | ||
"phone_number" TEXT, | ||
"friends" TEXT[], | ||
"is_online" BOOLEAN NOT NULL DEFAULT false, | ||
"is_verified" BOOLEAN NOT NULL DEFAULT false, | ||
"verifyCode" TEXT, | ||
"verifyCodeExpiry" TIMESTAMP(3), | ||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updated_at" TIMESTAMP(3) NOT NULL, | ||
|
||
CONSTRAINT "user_pkey" PRIMARY KEY ("_id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "user_email_key" ON "user"("email"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "user_username_key" ON "user"("username"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "user_phone_number_key" ON "user"("phone_number"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "chats" ADD CONSTRAINT "chats_userId_fkey" FOREIGN KEY ("userId") REFERENCES "user"("_id") ON DELETE SET NULL ON UPDATE CASCADE; |
23 changes: 23 additions & 0 deletions
23
frontend/prisma/migrations/20240628062705_add_account/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,23 @@ | ||
-- CreateTable | ||
CREATE TABLE "Account" ( | ||
"id" TEXT NOT NULL, | ||
"userId" TEXT NOT NULL, | ||
"type" TEXT NOT NULL, | ||
"provider" TEXT NOT NULL, | ||
"providerAccountId" TEXT NOT NULL, | ||
"refresh_token" TEXT, | ||
"access_token" TEXT, | ||
"expires_at" INTEGER, | ||
"token_type" TEXT, | ||
"scope" TEXT, | ||
"id_token" TEXT, | ||
"session_state" TEXT, | ||
|
||
CONSTRAINT "Account_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Account_provider_providerAccountId_key" ON "Account"("provider", "providerAccountId"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Account" ADD CONSTRAINT "Account_userId_fkey" FOREIGN KEY ("userId") REFERENCES "user"("_id") ON DELETE CASCADE ON UPDATE CASCADE; |
3 changes: 3 additions & 0 deletions
3
frontend/prisma/migrations/20240629032643_modify_schema/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 "chats" ALTER COLUMN "senderId" SET DATA TYPE TEXT, | ||
ALTER COLUMN "receiverId" SET DATA TYPE TEXT; |
9 changes: 9 additions & 0 deletions
9
frontend/prisma/migrations/20240629033144_change_full_name_to_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,9 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `fullname` on the `user` table. All the data in the column will be lost. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "user" DROP COLUMN "fullname", | ||
ADD COLUMN "name" TEXT; |
9 changes: 9 additions & 0 deletions
9
frontend/prisma/migrations/20240629035013_change_profile_image_to_image/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,9 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `profile_image` on the `user` table. All the data in the column will be lost. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "user" DROP COLUMN "profile_image", | ||
ADD COLUMN "image" TEXT; |
9 changes: 9 additions & 0 deletions
9
frontend/prisma/migrations/20240629035403_change_is_verified_to_email_verified/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,9 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `is_verified` on the `user` table. All the data in the column will be lost. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "user" DROP COLUMN "is_verified", | ||
ADD COLUMN "emailVerified" BOOLEAN NOT NULL DEFAULT false; |
9 changes: 9 additions & 0 deletions
9
frontend/prisma/migrations/20240629041750_modify_schema/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,9 @@ | ||
/* | ||
Warnings: | ||
- The `emailVerified` column on the `user` table would be dropped and recreated. This will lead to data loss if there is data in the column. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "user" DROP COLUMN "emailVerified", | ||
ADD COLUMN "emailVerified" TIMESTAMP(3); |
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
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