eeb7ff4a6d
Support for Partial Indexes was available in Doctrine 1 following http://www.doctrine-project.org/jira/browse/DC-82. This commit reintroduce support for Doctrine 2. We use the same syntax with an optionnal "where" attribute for Index and UniqueConstraint.
83 lines
1.7 KiB
YAML
83 lines
1.7 KiB
YAML
Doctrine\Tests\ORM\Mapping\User:
|
|
type: entity
|
|
table: cms_users
|
|
options:
|
|
foo: bar
|
|
baz:
|
|
key: val
|
|
namedQueries:
|
|
all: SELECT u FROM __CLASS__ u
|
|
id:
|
|
id:
|
|
type: integer
|
|
generator:
|
|
strategy: AUTO
|
|
sequenceGenerator:
|
|
sequenceName: tablename_seq
|
|
allocationSize: 100
|
|
initialValue: 1
|
|
options:
|
|
foo: bar
|
|
fields:
|
|
name:
|
|
type: string
|
|
length: 50
|
|
nullable: true
|
|
unique: true
|
|
options:
|
|
foo: bar
|
|
baz:
|
|
key: val
|
|
email:
|
|
type: string
|
|
column: user_email
|
|
columnDefinition: CHAR(32) NOT NULL
|
|
version:
|
|
type: integer
|
|
version: true
|
|
oneToOne:
|
|
address:
|
|
targetEntity: Address
|
|
inversedBy: user
|
|
joinColumn:
|
|
name: address_id
|
|
referencedColumnName: id
|
|
onDelete: CASCADE
|
|
cascade: [ remove ]
|
|
oneToMany:
|
|
phonenumbers:
|
|
targetEntity: Phonenumber
|
|
orphanRemoval: true
|
|
mappedBy: user
|
|
orderBy:
|
|
number: ASC
|
|
cascade: [ persist ]
|
|
manyToMany:
|
|
groups:
|
|
targetEntity: Group
|
|
joinTable:
|
|
name: cms_users_groups
|
|
joinColumns:
|
|
user_id:
|
|
referencedColumnName: id
|
|
nullable: false
|
|
unique: false
|
|
inverseJoinColumns:
|
|
group_id:
|
|
referencedColumnName: id
|
|
columnDefinition: INT NULL
|
|
cascade:
|
|
- all
|
|
lifecycleCallbacks:
|
|
prePersist: [ doStuffOnPrePersist, doOtherStuffOnPrePersistToo ]
|
|
postPersist: [ doStuffOnPostPersist ]
|
|
uniqueConstraints:
|
|
search_idx:
|
|
columns: name,user_email
|
|
where: name IS NOT NULL
|
|
indexes:
|
|
name_idx:
|
|
columns: name
|
|
0:
|
|
columns: user_email
|