Skip to content

Commit f9b4994

Browse files
committed
chore(db): mark name of ClassroomData unique
1 parent 48f8718 commit f9b4994

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

data/classroom/classroom.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,17 @@
110110
"size": 0
111111
},
112112
{
113-
"name": "操场",
113+
"name": "操场1区",
114114
"alias": "靠近旗杆",
115115
"size": 0
116116
},
117117
{
118-
"name": "操场",
118+
"name": "操场2区",
119119
"alias": "操场中间",
120120
"size": 0
121121
},
122122
{
123-
"name": "操场",
123+
"name": "操场3区",
124124
"alias": "靠近雨棚",
125125
"size": 0
126126
},
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
Warnings:
3+
4+
- A unique constraint covering the columns `[name]` on the table `ClassroomData` will be added. If there are existing duplicate values, this will fail.
5+
6+
*/
7+
-- CreateIndex
8+
CREATE UNIQUE INDEX "ClassroomData_name_key" ON "ClassroomData"("name");

db/schema.prisma

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ model GroupInfo {
103103

104104
model ClassroomData {
105105
id String @id @default(dbgenerated("gen_random_uuid()"))
106-
name String
106+
name String @unique
107107
alias String?
108108
size Int?
109109
ReservationRecord ReservationRecord[]

0 commit comments

Comments
 (0)