1
1
mirror of https://github.com/ZeroCatDev/ClassworksKV.git synced 2026-03-05 05:03:10 +00:00

fix: make id fields optional in Account, AppInstall, AutoAuth, and Device models

This commit is contained in:
Sunwuyuan 2026-02-09 10:34:17 +08:00
parent 88d5062638
commit 9bd5b4d64a
No known key found for this signature in database
GPG Key ID: A6A54CF66F56BB64
5 changed files with 25 additions and 36 deletions

View File

@ -20,7 +20,7 @@ const config: runtime.GetPrismaClientConfig = {
"clientVersion": "7.3.0",
"engineVersion": "9d6ad21cbbceab97458517b147a6a09ff43aa735",
"activeProvider": "postgresql",
"inlineSchema": "generator client {\n provider = \"prisma-client\"\n output = \"../generated/prisma\"\n}\n\ndatasource db {\n provider = \"postgresql\"\n}\n\nmodel Account {\n id String @id(map: \"idx_18303_PRIMARY\") @db.VarChar(191)\n provider String @db.VarChar(191)\n providerId String @db.VarChar(191)\n email String? @db.VarChar(191)\n name String? @db.VarChar(191)\n avatarUrl String? @db.VarChar(191)\n providerData Json? @db.Json\n accessToken String?\n createdAt DateTime @default(now()) @db.Timestamptz(6)\n updatedAt DateTime @default(now()) @updatedAt @db.Timestamptz(6)\n refreshToken String?\n refreshTokenExpiry DateTime? @db.Timestamptz(6)\n tokenVersion Int @default(1)\n\n devices Device[]\n\n @@unique([provider, providerId], map: \"idx_18303_Account_provider_providerId_key\")\n}\n\nmodel AppInstall {\n id String @id(map: \"idx_18310_PRIMARY\") @db.VarChar(191)\n deviceId Int\n appId String @db.VarChar(191)\n token String @unique(map: \"idx_18310_AppInstall_token_key\") @db.VarChar(191)\n note String? @db.VarChar(191)\n installedAt DateTime @default(now()) @db.Timestamptz(6)\n updatedAt DateTime @default(now()) @updatedAt @db.Timestamptz(6)\n deviceType String? @db.VarChar(191)\n isReadOnly Boolean @default(false)\n\n device Device @relation(fields: [deviceId], references: [id], onDelete: Cascade)\n\n @@index([deviceId], map: \"idx_18310_AppInstall_deviceId_fkey\")\n}\n\nmodel AutoAuth {\n id String @id(map: \"idx_18317_PRIMARY\") @db.VarChar(191)\n deviceId Int\n password String? @db.VarChar(191)\n deviceType String? @db.VarChar(191)\n isReadOnly Boolean @default(false)\n createdAt DateTime @default(now()) @db.Timestamptz(6)\n updatedAt DateTime @default(now()) @updatedAt @db.Timestamptz(6)\n\n device Device @relation(fields: [deviceId], references: [id], onDelete: Cascade)\n\n @@unique([deviceId, password], map: \"idx_18317_AutoAuth_deviceId_password_key\")\n}\n\nmodel Device {\n id Int @id(map: \"idx_18324_PRIMARY\")\n uuid String @unique(map: \"idx_18324_Device_uuid_key\") @db.VarChar(191)\n name String? @db.VarChar(191)\n accountId String? @db.VarChar(191)\n createdAt DateTime @default(now()) @db.Timestamptz(6)\n updatedAt DateTime @default(now()) @updatedAt @db.Timestamptz(6)\n password String? @db.VarChar(191)\n passwordHint String? @db.VarChar(191)\n namespace String? @unique(map: \"idx_18324_Device_namespace_key\") @db.VarChar(191)\n\n // 关联关系\n account Account? @relation(fields: [accountId], references: [id], onDelete: SetNull)\n appInstalls AppInstall[]\n kvStore KVStore[] // 设备相关的KV存储\n autoAuths AutoAuth[] // 自动授权配置\n\n @@index([accountId], map: \"idx_18324_Device_accountId_fkey\")\n}\n\nmodel KVStore {\n deviceId Int\n key String @db.VarChar(191)\n value Json @db.Json\n creatorIp String? @default(\"\") @db.VarChar(191)\n createdAt DateTime @default(now()) @db.Timestamptz(6)\n updatedAt DateTime @default(now()) @updatedAt @db.Timestamptz(6)\n\n device Device @relation(fields: [deviceId], references: [id], onDelete: Cascade)\n\n @@id([deviceId, key], map: \"idx_18330_PRIMARY\")\n}\n",
"inlineSchema": "generator client {\n provider = \"prisma-client\"\n output = \"../generated/prisma\"\n}\n\ndatasource db {\n provider = \"postgresql\"\n}\n\nmodel Account {\n id String @id(map: \"idx_18303_PRIMARY\") @default(cuid()) @db.VarChar(191)\n provider String @db.VarChar(191)\n providerId String @db.VarChar(191)\n email String? @db.VarChar(191)\n name String? @db.VarChar(191)\n avatarUrl String? @db.VarChar(191)\n providerData Json? @db.Json\n accessToken String?\n createdAt DateTime @default(now()) @db.Timestamptz(6)\n updatedAt DateTime @default(now()) @updatedAt @db.Timestamptz(6)\n refreshToken String?\n refreshTokenExpiry DateTime? @db.Timestamptz(6)\n tokenVersion Int @default(1)\n\n devices Device[]\n\n @@unique([provider, providerId], map: \"idx_18303_Account_provider_providerId_key\")\n}\n\nmodel AppInstall {\n id String @id(map: \"idx_18310_PRIMARY\") @default(cuid()) @db.VarChar(191)\n deviceId Int\n appId String @db.VarChar(191)\n token String @unique(map: \"idx_18310_AppInstall_token_key\") @db.VarChar(191)\n note String? @db.VarChar(191)\n installedAt DateTime @default(now()) @db.Timestamptz(6)\n updatedAt DateTime @default(now()) @updatedAt @db.Timestamptz(6)\n deviceType String? @db.VarChar(191)\n isReadOnly Boolean @default(false)\n\n device Device @relation(fields: [deviceId], references: [id], onDelete: Cascade)\n\n @@index([deviceId], map: \"idx_18310_AppInstall_deviceId_fkey\")\n}\n\nmodel AutoAuth {\n id String @id(map: \"idx_18317_PRIMARY\") @default(cuid()) @db.VarChar(191)\n deviceId Int\n password String? @db.VarChar(191)\n deviceType String? @db.VarChar(191)\n isReadOnly Boolean @default(false)\n createdAt DateTime @default(now()) @db.Timestamptz(6)\n updatedAt DateTime @default(now()) @updatedAt @db.Timestamptz(6)\n\n device Device @relation(fields: [deviceId], references: [id], onDelete: Cascade)\n\n @@unique([deviceId, password], map: \"idx_18317_AutoAuth_deviceId_password_key\")\n}\n\nmodel Device {\n id Int @id(map: \"idx_18324_PRIMARY\") @default(autoincrement())\n uuid String @unique(map: \"idx_18324_Device_uuid_key\") @db.VarChar(191)\n name String? @db.VarChar(191)\n accountId String? @db.VarChar(191)\n createdAt DateTime @default(now()) @db.Timestamptz(6)\n updatedAt DateTime @default(now()) @updatedAt @db.Timestamptz(6)\n password String? @db.VarChar(191)\n passwordHint String? @db.VarChar(191)\n namespace String? @unique(map: \"idx_18324_Device_namespace_key\") @db.VarChar(191)\n\n // 关联关系\n account Account? @relation(fields: [accountId], references: [id], onDelete: SetNull)\n appInstalls AppInstall[]\n kvStore KVStore[] // 设备相关的KV存储\n autoAuths AutoAuth[] // 自动授权配置\n\n @@index([accountId], map: \"idx_18324_Device_accountId_fkey\")\n}\n\nmodel KVStore {\n deviceId Int\n key String @db.VarChar(191)\n value Json @db.Json\n creatorIp String? @default(\"\") @db.VarChar(191)\n createdAt DateTime @default(now()) @db.Timestamptz(6)\n updatedAt DateTime @default(now()) @updatedAt @db.Timestamptz(6)\n\n device Device @relation(fields: [deviceId], references: [id], onDelete: Cascade)\n\n @@id([deviceId, key], map: \"idx_18330_PRIMARY\")\n}\n",
"runtimeDataModel": {
"models": {},
"enums": {},

View File

@ -358,7 +358,7 @@ export type AccountScalarWhereWithAggregatesInput = {
}
export type AccountCreateInput = {
id: string
id?: string
provider: string
providerId: string
email?: string | null
@ -375,7 +375,7 @@ export type AccountCreateInput = {
}
export type AccountUncheckedCreateInput = {
id: string
id?: string
provider: string
providerId: string
email?: string | null
@ -426,7 +426,7 @@ export type AccountUncheckedUpdateInput = {
}
export type AccountCreateManyInput = {
id: string
id?: string
provider: string
providerId: string
email?: string | null
@ -578,7 +578,7 @@ export type AccountUpdateOneWithoutDevicesNestedInput = {
}
export type AccountCreateWithoutDevicesInput = {
id: string
id?: string
provider: string
providerId: string
email?: string | null
@ -594,7 +594,7 @@ export type AccountCreateWithoutDevicesInput = {
}
export type AccountUncheckedCreateWithoutDevicesInput = {
id: string
id?: string
provider: string
providerId: string
email?: string | null

View File

@ -313,7 +313,7 @@ export type AppInstallScalarWhereWithAggregatesInput = {
}
export type AppInstallCreateInput = {
id: string
id?: string
appId: string
token: string
note?: string | null
@ -325,7 +325,7 @@ export type AppInstallCreateInput = {
}
export type AppInstallUncheckedCreateInput = {
id: string
id?: string
deviceId: number
appId: string
token: string
@ -361,7 +361,7 @@ export type AppInstallUncheckedUpdateInput = {
}
export type AppInstallCreateManyInput = {
id: string
id?: string
deviceId: number
appId: string
token: string
@ -496,7 +496,7 @@ export type AppInstallUncheckedUpdateManyWithoutDeviceNestedInput = {
}
export type AppInstallCreateWithoutDeviceInput = {
id: string
id?: string
appId: string
token: string
note?: string | null
@ -507,7 +507,7 @@ export type AppInstallCreateWithoutDeviceInput = {
}
export type AppInstallUncheckedCreateWithoutDeviceInput = {
id: string
id?: string
appId: string
token: string
note?: string | null
@ -559,7 +559,7 @@ export type AppInstallScalarWhereInput = {
}
export type AppInstallCreateManyDeviceInput = {
id: string
id?: string
appId: string
token: string
note?: string | null

View File

@ -290,7 +290,7 @@ export type AutoAuthScalarWhereWithAggregatesInput = {
}
export type AutoAuthCreateInput = {
id: string
id?: string
password?: string | null
deviceType?: string | null
isReadOnly?: boolean
@ -300,7 +300,7 @@ export type AutoAuthCreateInput = {
}
export type AutoAuthUncheckedCreateInput = {
id: string
id?: string
deviceId: number
password?: string | null
deviceType?: string | null
@ -330,7 +330,7 @@ export type AutoAuthUncheckedUpdateInput = {
}
export type AutoAuthCreateManyInput = {
id: string
id?: string
deviceId: number
password?: string | null
deviceType?: string | null
@ -454,7 +454,7 @@ export type AutoAuthUncheckedUpdateManyWithoutDeviceNestedInput = {
}
export type AutoAuthCreateWithoutDeviceInput = {
id: string
id?: string
password?: string | null
deviceType?: string | null
isReadOnly?: boolean
@ -463,7 +463,7 @@ export type AutoAuthCreateWithoutDeviceInput = {
}
export type AutoAuthUncheckedCreateWithoutDeviceInput = {
id: string
id?: string
password?: string | null
deviceType?: string | null
isReadOnly?: boolean
@ -511,7 +511,7 @@ export type AutoAuthScalarWhereInput = {
}
export type AutoAuthCreateManyDeviceInput = {
id: string
id?: string
password?: string | null
deviceType?: string | null
isReadOnly?: boolean

View File

@ -322,7 +322,6 @@ export type DeviceScalarWhereWithAggregatesInput = {
}
export type DeviceCreateInput = {
id: number
uuid: string
name?: string | null
createdAt?: Date | string
@ -337,7 +336,7 @@ export type DeviceCreateInput = {
}
export type DeviceUncheckedCreateInput = {
id: number
id?: number
uuid: string
name?: string | null
accountId?: string | null
@ -352,7 +351,6 @@ export type DeviceUncheckedCreateInput = {
}
export type DeviceUpdateInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
uuid?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
@ -382,7 +380,7 @@ export type DeviceUncheckedUpdateInput = {
}
export type DeviceCreateManyInput = {
id: number
id?: number
uuid: string
name?: string | null
accountId?: string | null
@ -394,7 +392,6 @@ export type DeviceCreateManyInput = {
}
export type DeviceUpdateManyMutationInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
uuid?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
@ -560,7 +557,6 @@ export type DeviceUpdateOneRequiredWithoutKvStoreNestedInput = {
}
export type DeviceCreateWithoutAccountInput = {
id: number
uuid: string
name?: string | null
createdAt?: Date | string
@ -574,7 +570,7 @@ export type DeviceCreateWithoutAccountInput = {
}
export type DeviceUncheckedCreateWithoutAccountInput = {
id: number
id?: number
uuid: string
name?: string | null
createdAt?: Date | string
@ -629,7 +625,6 @@ export type DeviceScalarWhereInput = {
}
export type DeviceCreateWithoutAppInstallsInput = {
id: number
uuid: string
name?: string | null
createdAt?: Date | string
@ -643,7 +638,7 @@ export type DeviceCreateWithoutAppInstallsInput = {
}
export type DeviceUncheckedCreateWithoutAppInstallsInput = {
id: number
id?: number
uuid: string
name?: string | null
accountId?: string | null
@ -673,7 +668,6 @@ export type DeviceUpdateToOneWithWhereWithoutAppInstallsInput = {
}
export type DeviceUpdateWithoutAppInstallsInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
uuid?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
@ -701,7 +695,6 @@ export type DeviceUncheckedUpdateWithoutAppInstallsInput = {
}
export type DeviceCreateWithoutAutoAuthsInput = {
id: number
uuid: string
name?: string | null
createdAt?: Date | string
@ -715,7 +708,7 @@ export type DeviceCreateWithoutAutoAuthsInput = {
}
export type DeviceUncheckedCreateWithoutAutoAuthsInput = {
id: number
id?: number
uuid: string
name?: string | null
accountId?: string | null
@ -745,7 +738,6 @@ export type DeviceUpdateToOneWithWhereWithoutAutoAuthsInput = {
}
export type DeviceUpdateWithoutAutoAuthsInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
uuid?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
@ -773,7 +765,6 @@ export type DeviceUncheckedUpdateWithoutAutoAuthsInput = {
}
export type DeviceCreateWithoutKvStoreInput = {
id: number
uuid: string
name?: string | null
createdAt?: Date | string
@ -787,7 +778,7 @@ export type DeviceCreateWithoutKvStoreInput = {
}
export type DeviceUncheckedCreateWithoutKvStoreInput = {
id: number
id?: number
uuid: string
name?: string | null
accountId?: string | null
@ -817,7 +808,6 @@ export type DeviceUpdateToOneWithWhereWithoutKvStoreInput = {
}
export type DeviceUpdateWithoutKvStoreInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
uuid?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
@ -845,7 +835,7 @@ export type DeviceUncheckedUpdateWithoutKvStoreInput = {
}
export type DeviceCreateManyAccountInput = {
id: number
id?: number
uuid: string
name?: string | null
createdAt?: Date | string
@ -856,7 +846,6 @@ export type DeviceCreateManyAccountInput = {
}
export type DeviceUpdateWithoutAccountInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
uuid?: Prisma.StringFieldUpdateOperationsInput | string
name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string