-
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
21 changed files
with
210 additions
and
328 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
prisma/migrations/20231004084305_project_relation/migration.sql
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
prisma/migrations/20231012093339_user_avatar/migration.sql
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
prisma/migrations/20231013051930_team_relation/migration.sql
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
prisma/migrations/20231017041831_rename_collection_title_name/migration.sql
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
prisma/migrations/20231122082949_visited_history/migration.sql
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
prisma/migrations/20231122091108_visited_proeject_date/migration.sql
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
-- CreateTable | ||
CREATE TABLE "User" ( | ||
"id" TEXT NOT NULL PRIMARY KEY, | ||
"username" TEXT NOT NULL, | ||
"email" TEXT NOT NULL, | ||
"avatar" TEXT NOT NULL, | ||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" DATETIME NOT NULL, | ||
"deletedAt" DATETIME | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Password" ( | ||
"hash" TEXT NOT NULL, | ||
"userId" TEXT NOT NULL, | ||
CONSTRAINT "Password_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Team" ( | ||
"id" TEXT NOT NULL PRIMARY KEY, | ||
"name" TEXT NOT NULL DEFAULT '', | ||
"description" TEXT NOT NULL DEFAULT '', | ||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" DATETIME NOT NULL | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "TeamMember" ( | ||
"id" TEXT NOT NULL PRIMARY KEY, | ||
"role" TEXT NOT NULL DEFAULT 'MEMBER', | ||
"userId" TEXT NOT NULL, | ||
"teamId" TEXT NOT NULL, | ||
"status" TEXT NOT NULL DEFAULT 'Success', | ||
CONSTRAINT "TeamMember_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE, | ||
CONSTRAINT "TeamMember_teamId_fkey" FOREIGN KEY ("teamId") REFERENCES "Team" ("id") ON DELETE CASCADE ON UPDATE CASCADE | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Project" ( | ||
"id" TEXT NOT NULL PRIMARY KEY, | ||
"name" TEXT NOT NULL, | ||
"description" TEXT NOT NULL, | ||
"visibility" TEXT NOT NULL DEFAULT 'PRIVATE', | ||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" DATETIME NOT NULL, | ||
"teamId" TEXT NOT NULL, | ||
CONSTRAINT "Project_teamId_fkey" FOREIGN KEY ("teamId") REFERENCES "Team" ("id") ON DELETE CASCADE ON UPDATE CASCADE | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "ProjectMember" ( | ||
"id" TEXT NOT NULL PRIMARY KEY, | ||
"role" TEXT NOT NULL, | ||
"userId" TEXT NOT NULL, | ||
"projectId" TEXT NOT NULL, | ||
CONSTRAINT "ProjectMember_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE, | ||
CONSTRAINT "ProjectMember_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "Project" ("id") ON DELETE CASCADE ON UPDATE CASCADE | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Collection" ( | ||
"id" TEXT NOT NULL PRIMARY KEY, | ||
"pid" TEXT, | ||
"name" TEXT NOT NULL, | ||
"order" INTEGER NOT NULL, | ||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" DATETIME NOT NULL, | ||
"projectId" TEXT NOT NULL, | ||
CONSTRAINT "Collection_pid_fkey" FOREIGN KEY ("pid") REFERENCES "Collection" ("id") ON DELETE SET NULL ON UPDATE CASCADE, | ||
CONSTRAINT "Collection_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "Project" ("id") ON DELETE CASCADE ON UPDATE CASCADE | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Api" ( | ||
"id" TEXT NOT NULL PRIMARY KEY, | ||
"name" TEXT NOT NULL DEFAULT '', | ||
"description" TEXT NOT NULL DEFAULT '', | ||
"endpoint" TEXT NOT NULL, | ||
"method" TEXT NOT NULL, | ||
"params" TEXT NOT NULL, | ||
"body" TEXT NOT NULL, | ||
"headers" TEXT NOT NULL, | ||
"authorization" TEXT NOT NULL, | ||
"preRequestScript" TEXT NOT NULL DEFAULT '', | ||
"postResponseScript" TEXT NOT NULL DEFAULT '', | ||
"tags" TEXT NOT NULL, | ||
"versions" TEXT NOT NULL, | ||
"order" INTEGER NOT NULL, | ||
"status" TEXT NOT NULL DEFAULT 'DRAFT', | ||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" DATETIME NOT NULL, | ||
"projectId" TEXT NOT NULL, | ||
"collectionId" TEXT, | ||
CONSTRAINT "Api_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "Project" ("id") ON DELETE CASCADE ON UPDATE CASCADE, | ||
CONSTRAINT "Api_collectionId_fkey" FOREIGN KEY ("collectionId") REFERENCES "Collection" ("id") ON DELETE SET NULL ON UPDATE CASCADE | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "VisitedHistory" ( | ||
"id" TEXT NOT NULL PRIMARY KEY, | ||
"projectId" TEXT NOT NULL, | ||
"userId" TEXT NOT NULL, | ||
"date" TEXT NOT NULL DEFAULT '', | ||
CONSTRAINT "VisitedHistory_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "Project" ("id") ON DELETE CASCADE ON UPDATE CASCADE, | ||
CONSTRAINT "VisitedHistory_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "User_username_key" ON "User"("username"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "User_email_key" ON "User"("email"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Password_userId_key" ON "Password"("userId"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "TeamMember_userId_teamId_key" ON "TeamMember"("userId", "teamId"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "ProjectMember_userId_projectId_key" ON "ProjectMember"("userId", "projectId"); |
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) | ||
provider = "mysql" | ||
provider = "sqlite" |
Oops, something went wrong.