Character name field is always unique, updated init migration
This commit is contained in:
@ -23,6 +23,7 @@ CREATE TABLE `Character` (
|
||||
`rotation` INTEGER NOT NULL,
|
||||
`zoneId` INTEGER NOT NULL,
|
||||
|
||||
UNIQUE INDEX `Character_name_key`(`name`),
|
||||
PRIMARY KEY (`id`)
|
||||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
|
@ -30,7 +30,7 @@ model Character {
|
||||
id Int @id @default(autoincrement())
|
||||
userId Int
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
name String
|
||||
name String @unique
|
||||
hitpoints Int @default(100)
|
||||
mana Int @default(100)
|
||||
level Int @default(1)
|
||||
|
Reference in New Issue
Block a user