Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen Zhang (张涛) committed Apr 7, 2024
1 parent 75f1fa1 commit cc65e0d
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 181 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- CreateTable
CREATE TABLE "user" (
CREATE TABLE "user_0407" (
"id" INTEGER NOT NULL,
"username" TEXT NOT NULL,
"password" TEXT NOT NULL,
Expand All @@ -10,33 +10,43 @@ CREATE TABLE "user" (
"email" TEXT NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,

CONSTRAINT "user_pkey" PRIMARY KEY ("id")
CONSTRAINT "user_0407_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "coverage" (
CREATE TABLE "coverage_0407" (
"id" TEXT NOT NULL,
"key" TEXT,
"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,
"reporter" INTEGER NOT NULL,
"instrument_cwd" TEXT NOT NULL,
"reporter" TEXT NOT NULL,
"report_id" TEXT NOT NULL,
"cov_type" TEXT NOT NULL,
"relation_id" TEXT NOT NULL,
"cov_origin" 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,
"consumer" INTEGER NOT NULL,
"children" TEXT[],
"tags" JSONB[],

CONSTRAINT "coverage_pkey" PRIMARY KEY ("id")
CONSTRAINT "coverage_0407_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "project" (
CREATE TABLE "coveragedata_0407" (
"id" TEXT NOT NULL,
"compresseddata" TEXT NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,

CONSTRAINT "coveragedata_0407_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "project_0407" (
"id" TEXT NOT NULL,
"name" TEXT NOT NULL,
"path_with_namespace" TEXT NOT NULL,
Expand All @@ -47,44 +57,29 @@ CREATE TABLE "project" (
"default_branch" TEXT NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,

CONSTRAINT "project_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "summary" (
"id" TEXT NOT NULL,
"total" INTEGER NOT NULL,
"covered" INTEGER NOT NULL,
"skipped" INTEGER NOT NULL,
"metric_type" TEXT NOT NULL,
"cov_type" TEXT NOT NULL,
"report_id" TEXT NOT NULL,
"sha" TEXT NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,

CONSTRAINT "summary_pkey" PRIMARY KEY ("id")
CONSTRAINT "project_0407_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "codechange" (
CREATE TABLE "codechange_0407" (
"id" TEXT NOT NULL,
"project_id" TEXT NOT NULL,
"compare_target" TEXT NOT NULL,
"sha" TEXT NOT NULL,
"sha_0407" 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")
CONSTRAINT "codechange_0407_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "distributedlock" (
CREATE TABLE "distributedlock_0407" (
"lockName" TEXT NOT NULL,
"isLocked" BOOLEAN NOT NULL DEFAULT false,
"lockTimestamp" TIMESTAMP(3),
"lockExpiration" TIMESTAMP(3),

CONSTRAINT "distributedlock_pkey" PRIMARY KEY ("lockName")
CONSTRAINT "distributedlock_0407_pkey" PRIMARY KEY ("lockName")
);
12 changes: 6 additions & 6 deletions packages/canyon-backend/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ model User {
email String
createdAt DateTime @default(now()) @map("created_at") @db.Timestamp(3)
@@map("user")
@@map("user_0407")
}

model Coverage {
Expand All @@ -41,15 +41,15 @@ model Coverage {
createdAt DateTime @default(now()) @map("created_at") @db.Timestamp(3)
updatedAt DateTime @default(now()) @map("updated_at") @db.Timestamp(3)
@@map("coverage")
@@map("coverage_0407")
}

model CoverageData {
id String @id @default(cuid())
compresseddata String
createdAt DateTime @default(now()) @map("created_at") @db.Timestamp(3)
@@map("coveragedata")
@@map("coveragedata_0407")
}

model Project {
Expand All @@ -63,7 +63,7 @@ model Project {
defaultBranch String @map("default_branch")
createdAt DateTime @default(now()) @map("created_at") @db.Timestamp(3)
@@map("project")
@@map("project_0407")
}

model Codechange {
Expand All @@ -82,7 +82,7 @@ model Codechange {
createdAt DateTime @default(now()) @map("created_at") @db.Timestamp(3)
@@map("codechange")
@@map("codechange_0407")
}

model Distributedlock {
Expand All @@ -91,5 +91,5 @@ model Distributedlock {
lockTimestamp DateTime?
lockExpiration DateTime?
@@map("distributedlock")
@@map("distributedlock_0407")
}

0 comments on commit cc65e0d

Please sign in to comment.