我想在我的 yml 方案中添加一个候选键。yml 可以吗?我该怎么做?我用谷歌找不到任何东西。
编辑:这是否也可以通过独特的约束来实现?如果是这样,我试过了
uniqueConstraints:
name_presId:
columns: name, presentationId
最好的问候,Given 是以下结构:
---
EFImage:
tableName: ef_images
columns:
presentation_id as presentationId: integer
data: blob
name: string(255)
is_sendable as isSendable:
type: integer(4)
default: 0
use_for as useFor:
type: integer(4)
default: 0
relations:
ButtonBackgrounds:
class: EFButton
foreign: backgroundImageId
local: id
type: many
ImageViews:
class: EFImageView
foreign: imageId
local: id
type: many
Videos:
class: EFVideo
foreign: previewImageId
local: id
type: many
Presentation:
class: EFPresentation
local: presentationId
foreign: id
type: one
options:
type: InnoDB