Skip to content

Commit 7113fcb

Browse files
committed
✨ Add url slug to workbook (#2020)
1 parent 8795e0b commit 7113fcb

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

prisma/ERD.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ OTHERS OTHERS
178178
Boolean isOfficial
179179
Boolean isReplenished
180180
WorkBookType workBookType
181+
String urlSlug "❓"
181182
DateTime createdAt
182183
DateTime updatedAt
183184
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
Warnings:
3+
4+
- A unique constraint covering the columns `[urlSlug]` on the table `workbook` will be added. If there are existing duplicate values, this will fail.
5+
6+
*/
7+
-- AlterTable
8+
ALTER TABLE "workbook" ADD COLUMN "urlSlug" TEXT;
9+
10+
-- CreateIndex
11+
CREATE UNIQUE INDEX "workbook_urlSlug_key" ON "workbook"("urlSlug");
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Please do not edit this file manually
2-
# It should be added in your version-control system (i.e. Git)
3-
provider = "postgresql"
2+
# It should be added in your version-control system (e.g., Git)
3+
provider = "postgresql"

prisma/schema.prisma

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ model WorkBook {
181181
isOfficial Boolean @default(false)
182182
isReplenished Boolean @default(false) // カリキュラムの【補充】を識別するために使用
183183
workBookType WorkBookType @default(CREATED_BY_USER)
184+
urlSlug String? @unique // 問題集(カリキュラムと解法別)をURLで識別するためのオプション。a-z、0-9、(-)ハイフンのみ使用可能。例: bfs、dfs、dp、union-find、2-sat。
184185
createdAt DateTime @default(now())
185186
updatedAt DateTime @updatedAt
186187
@@ -231,7 +232,7 @@ enum ContestType {
231232
}
232233

233234
// 11Q(最も簡単)〜6D(最難関)。
234-
// 注: 基準は非公開
235+
// 注: 基準は一般公開中
235236
enum TaskGrade {
236237
PENDING // 未確定
237238
Q11 // 11Qのように表記したいが、数字を最初の文字として利用できないため

0 commit comments

Comments
 (0)