-
Notifications
You must be signed in to change notification settings - Fork 14
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
Allen Zhang (张涛)
committed
May 7, 2024
1 parent
cc027fa
commit b68c26b
Showing
13 changed files
with
299 additions
and
61 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
112 changes: 112 additions & 0 deletions
112
packages/canyon-backend/prisma/migrations/20240507111800_ini/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,112 @@ | ||
-- CreateTable | ||
CREATE TABLE "user" ( | ||
"id" INTEGER NOT NULL, | ||
"username" TEXT NOT NULL, | ||
"password" TEXT NOT NULL, | ||
"nickname" TEXT NOT NULL, | ||
"avatar" TEXT NOT NULL, | ||
"refresh_token" TEXT NOT NULL, | ||
"access_token" TEXT NOT NULL, | ||
"email" TEXT NOT NULL, | ||
"favor" TEXT NOT NULL, | ||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
|
||
CONSTRAINT "user_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Git" ( | ||
"id" TEXT NOT NULL, | ||
"userID" TEXT NOT NULL, | ||
"provider" TEXT NOT NULL, | ||
"providerAccountId" TEXT NOT NULL, | ||
"providerRefreshToken" TEXT NOT NULL, | ||
"providerAccessToken" TEXT NOT NULL, | ||
"providerScope" TEXT NOT NULL, | ||
"loggedIn" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
|
||
CONSTRAINT "Git_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "GitProvider" ( | ||
"id" TEXT NOT NULL, | ||
"url" TEXT NOT NULL, | ||
"clientID" TEXT NOT NULL, | ||
"clientSecret" TEXT NOT NULL, | ||
"type" TEXT NOT NULL, | ||
"name" TEXT NOT NULL, | ||
"disabled" BOOLEAN NOT NULL, | ||
|
||
CONSTRAINT "GitProvider_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "coverage" ( | ||
"id" TEXT NOT NULL, | ||
"key" TEXT NOT NULL, | ||
"sha" TEXT NOT NULL, | ||
"branch" TEXT NOT NULL, | ||
"compare_target" TEXT NOT NULL, | ||
"provider" TEXT NOT NULL, | ||
"project_id" TEXT NOT NULL, | ||
"instrument_cwd" TEXT NOT NULL, | ||
"reporter" TEXT NOT NULL, | ||
"report_id" TEXT NOT NULL, | ||
"cov_type" TEXT NOT NULL, | ||
"relation_id" JSONB NOT NULL, | ||
"summary" JSONB NOT NULL, | ||
"tag" JSONB NOT NULL, | ||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
|
||
CONSTRAINT "coverage_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "coveragedata" ( | ||
"id" TEXT NOT NULL, | ||
"compresseddata" TEXT NOT NULL, | ||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
|
||
CONSTRAINT "coveragedata_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "project" ( | ||
"id" TEXT NOT NULL, | ||
"name" TEXT NOT NULL, | ||
"path_with_namespace" TEXT NOT NULL, | ||
"description" TEXT NOT NULL, | ||
"bu" TEXT NOT NULL, | ||
"tag" TEXT NOT NULL, | ||
"coverage" TEXT NOT NULL, | ||
"default_branch" TEXT NOT NULL, | ||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
|
||
CONSTRAINT "project_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "codechange" ( | ||
"id" TEXT NOT NULL, | ||
"project_id" TEXT NOT NULL, | ||
"compare_target" TEXT NOT NULL, | ||
"sha" TEXT NOT NULL, | ||
"path" TEXT NOT NULL, | ||
"additions" INTEGER[], | ||
"deletions" INTEGER[], | ||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
|
||
CONSTRAINT "codechange_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "distributedlock" ( | ||
"lockName" TEXT NOT NULL, | ||
"isLocked" BOOLEAN NOT NULL DEFAULT false, | ||
"lockTimestamp" TIMESTAMP(3), | ||
"lockExpiration" TIMESTAMP(3), | ||
|
||
CONSTRAINT "distributedlock_pkey" PRIMARY KEY ("lockName") | ||
); |
3 changes: 3 additions & 0 deletions
3
packages/canyon-backend/prisma/migrations/migration_lock.toml
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 @@ | ||
# Please do not edit this file manually | ||
# It should be added in your version-control system (i.e. Git) | ||
provider = "postgresql" |
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 |
---|---|---|
|
@@ -183,7 +183,7 @@ export class ProjectResolver { | |
args.tag, | ||
args.coverage, | ||
args.defaultBranch, | ||
args.rules, | ||
// args.rules, | ||
); | ||
} | ||
} |
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
Oops, something went wrong.