【发布时间】:2011-02-22 23:07:25
【问题描述】:
我正在使用 symfony 命令通过运行从我的 mysql 5.1 数据库生成我的 schema.yml 文件:
symfony doctrine:build-schema
我的桌子:
CREATE TABLE `identity` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`username` VARCHAR(64) DEFAULT NULL,
`password` VARCHAR(128) DEFAULT NULL
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`)
) ENGINE=INNODB DEFAULT CHARSET=latin1
转换成:
Identity:
connection: doctrine
tableName: identity
columns:
id:
type: integer(4)
fixed: false
unsigned: true
primary: true
autoincrement: true
username:
type: string(64)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
password:
type: string(128)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
一切看起来都很好,除了我希望用户名列看起来像(例如unique: true):
username:
type: string(64)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
unique: true
有人知道我错过了什么吗?
【问题讨论】: